mirror of
https://github.com/jomjol/AI-on-the-edge-device-docs.git
synced 2025-12-06 11:36:53 +03:00
reworked and split pages
This commit is contained in:
@@ -1,33 +1,9 @@
|
||||
# Learn a model with your own images
|
||||
If your device has new, different digits and the existing models don't recognize them well, you can collect your own images and so we can train the model better. This helps you and also others as the models get more accurate. this also applies if you have a model that is already known, but the neural models do not produce good results.
|
||||
Once you have collected and selected your own images (see [Collect images to improve the models](collect-new-images.md)), you can train your very own model with them.
|
||||
|
||||
For experienced users, the training can also done by yourself (see below).
|
||||
**This is an optional step and only suggested for advances users!**
|
||||
|
||||
Before you go ahead, please check if your digits/pointers are not yet contained in the training data. A visual overview is available at [digits](https://jomjol.github.io/neural-network-digital-counter-readout) resp. [pointers](https://jomjol.github.io/neural-network-analog-needle-readout/).
|
||||
|
||||
## Before you start
|
||||
Poor recognition is often caused by blurred images, low contrast or incorrect setting of the ROIs. Therefore, check these possibilities first, as additional training will bring little improvement here.
|
||||
|
||||
You do not need train the models by yourself if you don't want (see section [Share your images](#share-your-images)). In most cases we will integrate your images in the training dataset of the models. Only if we fear a degradation of the models or you need a different behaviour, we might not include the data in the standard models (see at bottom of page for reasons).
|
||||
|
||||
## Collecting images
|
||||
The neural network is trained based on a set of images that have already been collected over time. If your digits are included or at least very similar to included images, the chance is very high that the neural network is working fine for you as well.
|
||||
|
||||
The neural network configuration is stored in the TensorFlow Lite format as `*.tfl` or `*.tflite` in the `/config` directory on the SD-Card. A model can be updated (or a new one added) by uploading the new file and activating it on the configuration page or in the config file `/config/config.ini`.
|
||||
|
||||
In order to incorporate new digits a training set of images is required. The training images needs to be collected in the final setup with the help of the `Digits` or `Analog` log settings (not to be confused with the `Data` or `Debug` log). Enable the logging of the images on the configuration page or in the config file `/config/config.ini`:
|
||||
|
||||

|
||||
|
||||
Now be patient! You have to wait until it has collected an image of each digit of every type. They wil lbe placed on the SD-Card inthe folder `/log/digit/` resp. `/log/anaolog/`. The fastest way to get the images to your PC is to remove the SD-card from the ESP32 module and insert it into the card reader of yur PC.
|
||||
Then search for two..three images of each digit (**not more! :-)**). We provide programs which will sort out duplicate images for you, see below.
|
||||
|
||||
## Collecting images for dig-class100/dig-cont/ana-class100
|
||||
For digits, [Collectmeterdigits](https://github.com/haverland/collectmeterdigits) resp for pointers [collectmeteranalog](https://github.com/haverland/collectmeteranalog) can be sused to collect the images easily. Read the project readme for detailed instructions.
|
||||
|
||||
## Train the model by yourself (optional)
|
||||
For training the model you will need a python and Jupyter installation.
|
||||
**This is optional and only suggested if you want to get into it deeper yourself!**
|
||||
|
||||
All current labeled images you can find under [ziffer_sortiert_raw](https://github.com/jomjol/neural-network-digital-counter-readout/tree/master/ziffer_sortiert_raw)
|
||||
|
||||
@@ -82,12 +58,4 @@ Run [Train_CNN_Analog-Readout_100-Small1_Dropout.ipynb](https://github.com/jomjo
|
||||
## Share your images
|
||||
If the results are good you can share the images as pull-request. Please images only!
|
||||
|
||||
If you not able to create a pull request or don't know what it is, open an [issue](https://github.com/jomjol/AI-on-the-edge-device/issues) and put the zipped images in it.
|
||||
|
||||
### Images can be rejected if
|
||||
* As same as dig-class11 collected, more than 1000 images of your device are really to much.
|
||||
* images are not good configured (ROIs) will be rejected. It reduces the accuracy of the networks.
|
||||
* Images with too little focus will be rejected.
|
||||
* Images with too much blur are rejected.
|
||||
|
||||
Our models are to small to recognize everything in any quality. So we use only images of medium or good quality.
|
||||
See [Share your images](collect-new-images.md#share-your-images) for details.
|
||||
44
docs/collect-new-images.md
Normal file
44
docs/collect-new-images.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Collect images to improve the models
|
||||
If your device has new, different digits or pointers it might be that the existing models don't recognize them well. In such case you can collect your images and so we can train the model better. This helps you and also others as the models get more accurate. Adding more images also helps if you have a model that is already known, but the neural models do not produce good results.
|
||||
|
||||
Experienced users can do the training also by themself, see [Learn a model with your own images](Learn-models-with-your-own-images.md).
|
||||
|
||||
## Before you start
|
||||
Before you go ahead, please check if your digits/pointers are not yet contained in the training data. A visual overview is available at [digits](https://jomjol.github.io/neural-network-digital-counter-readout) resp. [pointers](https://jomjol.github.io/neural-network-analog-needle-readout/).
|
||||
|
||||
Poor recognition is often caused by blurred images, low contrast or incorrect setting of the ROIs. Therefore, check these possibilities first, as additional training will bring little improvement here. See [ROI Configuration](ROI-Configuration.md) for details.
|
||||
|
||||
## Collecting images
|
||||
The neural network is trained based on a set of images that have already been collected over time. If your digits are included or at least very similar to included images, the chance is very high that the neural network is working fine for you as well.
|
||||
|
||||
The neural network configuration is stored in the TensorFlow Lite format as `*.tfl` or `*.tflite` in the `/config` directory on the SD-Card. A model can be updated (or a new one added) by uploading the new file and activating it on the configuration page or in the config file `/config/config.ini`.
|
||||
|
||||
In order to incorporate new digits a training set of images is required. The training images needs to be collected in the final setup with the help of the `Digits` or `Analog` log settings (not to be confused with the `Data` or `Debug` log). Enable the logging of the images on the configuration page or in the config file `/config/config.ini`:
|
||||
|
||||

|
||||
|
||||
Now be patient! You have to wait until it has collected an image of each digit of every type. They wil lbe placed on the SD-Card inthe folder `/log/digit/` resp. `/log/anaolog/`.
|
||||
|
||||
After some days, there will be a lot of images, many of them very similar. Because of this, it is important to select only a subset of them for the model training.
|
||||
|
||||
The tools shown below can help you with that.
|
||||
|
||||
## Collecting images for dig-class100/dig-cont/ana-class100
|
||||
For digits use [Collectmeterdigits](https://github.com/haverland/collectmeterdigits) resp. for pointers use [collectmeteranalog](https://github.com/haverland/collectmeteranalog) to fetch the images from the device and select a subset of them. Please read the detailed instructions on the mentionded links for details!
|
||||
|
||||
If the fetching of the images is too slow for you, a faster way to get the images to your PC is to remove the SD-card from the ESP32 module and insert it into the card reader of yur PC.
|
||||
Then search for two..three images of each digit (**not more! :-)**). You will have to make sure to label the images yourself matching the effective value they are supposed to show.
|
||||
|
||||
|
||||
## Share your images
|
||||
In most cases we will integrate your images in the training dataset of the models. Only if we fear a degradation of the models or you need a different behaviour, we might not include the data in the standard models (see at bottom of page for reasons).
|
||||
|
||||
To provide your images to us for training the model, open an [Github Issue](https://github.com/jomjol/AI-on-the-edge-device/issues/new/choose) and append the zipped images ito it.
|
||||
|
||||
### Images can be rejected if
|
||||
* You provide too many images. More than 1000 images of your device are really to much.
|
||||
* Images which are not good enough (see [ROI Configuration](ROI-Configuration.md)) will be rejected. It would reduce the accuracy of the networks.
|
||||
* Images with too little focus will be rejected.
|
||||
* Images with too much blur are rejected.
|
||||
|
||||
Our models are to small to recognize everything in any quality. So we use only images of medium or good quality.
|
||||
@@ -30,6 +30,7 @@ nav:
|
||||
- Configuration-Parameter-Details.md
|
||||
- Configuration.md
|
||||
- Watermeter-specific-analog---digital-transition.md
|
||||
- collect-new-images.md
|
||||
- Learn-models-with-your-own-images.md
|
||||
- Correction Algorithm.md
|
||||
- Additional-Information.md
|
||||
|
||||
Reference in New Issue
Block a user