It turns out the trained NN from a clean background basically does not work on noisy testing set (even with only a little noise, e.g., mean = variance = 0.1). In this project, a Yolo-v3-tiny model was re-trained (from the mnist dataset with Gaussian additive noise) to detect random digits appearing in a noisy background.
First, clode or download this GitHub repository. For Windows, put wget.exe under the project folder.
Install requirements and download pretrained weights, CMD open console:
pip install -r ./requirements.txt
# yolov3 (not needed here)
wget -P model_data https://pjreddie.com/media/files/yolov3.weights
# yolov3-tiny
wget -P model_data https://pjreddie.com/media/files/yolov3-tiny.weights
Start with using pretrained weights to test predictions on both image and video:
python show_detect_performance.py
mnist folder contains mnist images, create training data:
python mnist/make_data.py
python mnist/add_noise2images.py
You can change training hyperparameters here ./yolov3/configs.py
.
I highly recommend to train the following step on Google Colab (see the last section below).
I could use my laptop to fry eggs after 100 epochs training (~3 hours) with a GPU Quadro M1200 (computing power of 5).
python train2.py
Test detection with detect_mnist.py
script:
python detect_mnist2.py
Results:
To learn more about Google Colab Free gpu (Tesla T4 with the computing power 7!) training, visit this tutorial and demo notebook (for using Colab) in this project.