Convolutional Keras Layers Black and White Image Example

Keras Small Image using a Convolutional Layer

Trying to simplify Convolutional Keras Layers, which is fairly hard to do since Convolutional Layers tend to be made for images with tons of pixels. For this demo I used a 4x4 black and white "image" that you can just enter as the number 1 (black) and 0 (white)
The program then sets up a convolutional layer and trys to match the number of rows of 1's

This program estimates how many lines can be drawn in any direction in the image.

Pixels closer to white = 0 lines

Pixels closer to black = 1 line, etc

Users should make much more input images to have any chance of teaching this neural network. Typically images are very tough to work with since every pixel stores 4 integers from 0-255 for Red, Green, Blue and Aplha (transparency) making writing and visualizing the code very confusing. By converting to monochrome we make this process much easiers to understand. Thanks for your help Stan Bileschi Twitter @xtan

Test or change this data

...











Now lets try the above in a full Machine Learning Web App

Tensorflowjs Machine Learning Web App Template

As simple as possible template. Note that for simplicity this has minimal CSS

Pre-Set Values:

Learning Rate:
Samples per batch:
Epochs: (# of batches to run)
Validation Split :



Data:

xTrainingData:
yTrainingTarget:

Remember:
Pixels closer to white = 0 lines
Pixels closer to black = 1 line, etc




Compile or Load Model:

Compile, Train, Test: Import / Export
Compile Model:
Train Model: Epochs run:
Test Trained Model with New Data: New Data:Shape:

...

...

...


...











This Github, ... this Github Website Version, ... this Hosted Website Version, ... Tensorflowjs

By Jeremy Ellis
Twitter@rocksetta
Website http://rocksetta.com
Use at your own risk!