Details on setup and training of the CNN neural network
The network consists of several Conv2D, MaxPooling and Flatten Layers:
The training data consists of images of the analog pointer with the size of 32x32 pixels and RGB color code. The expected readout value is encoded in the filename itself. Details can be found Training_Data.md
For reshaping the images the following code can be used: [Image_Preparation.ipynb]
The details can be found in the Jupyter file itself: Train_CNN_Analog-Readout_Version2.ipynb
The following aspects are implemented:
Scattering the input images by brightness as well as a pixel shift for training variations improved the stability of the network a lot.
Brightness was scattered with +/-30%
The position was scattered with +/-1 pixel in each direction. As the original picture is more than 4 times bigger (142x142 pixel) this ensures enough uncertainty to the upstream image alignment and cut out procedure.
The results show the expected behaviour:
sinus / cosinus | Orginal / Prediction |
---|---|
Checking the deviation by a comparison to the label shows, that the error is very small. The statistic shows an average value of 0.0%+/-1.1% with a maximum deviation of 3.8%. With respect to the pointer, that means that the error is in the subdigit range in the maximum +/-0.38 over the full range. Part of this error is also caused by a uncetainty in the manual labeling. Taking this into account, the result is fully sufficient to be robust for continious readout of analog meters.