Convolutional Keras Layers Single Digit Color Image Example!

Keras Single Digit Image using a Convolutional Layer.

Working with black (1) and white (0) images is not much fun, so in this example RGB(50,150,250), by the way that is the color blue, will be converted into single digit colors, losing some information but making things much easier to understand and and also to see the image as a chart of data.

0: white
1: black
2: red
3: orange
4: yellow
5: green
6: blue
7: indigo
8: violet
9: brown

In this Convolutional Neural Network we will train the basic shapes:
no-shape, circles, triangles, rectangles. With only 4 outputs we can use one-hot vector encoding.

Note: So far only no shape and circles have been minimally trained.

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:

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



Data: Data cannot begin or end with a comma!

Multi-image load data and labels All images must be CORS (Cross-Origin Resource Sharing) compatible. Easiest solution is to put the images on the same website as this webpage.
xTrainingData:
yTrainingTarget:

Remember:
0=white, 1=black, 2-->8 = ROY-G-BIV, 9=brown




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!