How to reduce the number of false positives of my model?

Question/Issue:
The model i trained produces false positives even after using a large dataset (approximatively 7000 images)

Project ID:
Arribada / Thermal Elephant

Context/Use case:
We trained an YOLOv5 model using this platform to recognize and detect polar bears. The dataset used has around 7000 images, both from already created datasets by other persons, as well as data collected by our camera. We included both pictures with polar bears and pictures without any. Despite this, the model still produces false positives. Can you please give us some tips on how to solve this issue?

Hi @OMEGAMAX10

Welcome to the forum!

To improve your model, we have a number of pages in the docs dedicated to this (linked below), consider the following steps:

  1. Increase Data: Neural networks perform better with more data. Lowering the window increase to create more overlap from windows can help, but more data is always better.

  2. Ensure Data Consistency: Make sure the data used for training looks similar to the data the network will see during testing or live classification. If you find discrepancies, move the sample to the training set and update the label before retraining.

  3. Train Longer: Increase the number of training cycles and check if performance improves. If not, you might need more data or better data separation.

  4. Avoid Overfitting: If your model has high accuracy on the training set but performs poorly on new data, it might be overfitting. Add more data or reduce the learning rate.

  5. Adjust Neural Network Architecture: Experiment with the number of layers and neurons to see if performance improves.

For class imbalance issues, you can rebalance your dataset during training using Keras expert mode and adjusting class weights.

For large differences between quantized (int8) and unoptimized (float32) model performances, try adding more data, adding regularization, or increasing the network’s capacity.

How do I handle class imbalance in my dataset?What are some techniques to prevent overfitting in neural networks?How do I adjust the neural network architecture in Edge Impulse?