Close

Training efficientdet_lite1

A project log for Raspberry pi tracking cam

Tracking animals on lower speed boards to replace jetson & coral

lion-mclionheadlion mclionhead 02/15/2022 at 00:560 Comments

A test model with 100 images showed efficientdet_lite1 runs at 4.5fps on the raspberry pi 4b, which should rise to 5.8 after overclocking.  Efficientdet_lite2 runs at 3fps.  There is a linear relationship between the size of the .tflite files & speed.

There was a problem where training efficientdet_lite1 with 1000 images made the 3GB GPU run out of memory after performing all the epochs.  This didn't happen when training efficientdet_lite0 with 1000 images.  Tensorflow's memory usage increases with the dataset size while pytorch only cared about model size.  The step which runs out of memory is some kind of validation step & doesn't depend on batch_size.

The solution was to reduce the validation size to 100 images.  

The result of 50 epochs with 1000 images was much lower scores for the real lion & no difference in the number of false positives.  So the lower framerate wasn't worth it.

It then spent 2 hours training efficientdet_lite0 on 100 epochs with 5000 images, batch size 4.  This degraded results.  Too many images with a smaller model might actually be worse.

The best models have been 300 epochs with 1000 images.  Fewer or more images with any number of epochs degrade results.

The next step might be manually labeling footage of a lion running, supplimenting the training set with images of lions that it missed, recording lion footage from the field camera.

Since no full body detection is doing a great job, it might be better to go back to face detection.  There's still running face detection with recognition at 1fps & using optical flow to fill between frames.

Discussions