Hello,

I've finetuned a YOLOv8 nano classification model, and am using it with an OAK 1 PoE to classify an image into one of six categories.

The classification works fine on those items, but the greatest issue I'm facing is that when something that isn't one of the 6 categories shows up, the model still gives it a percentage out of those six categories.

I want to implement a confidence threshold, or be able to classify the items as 'None' (I'm assuming a confidence threshold is the best way to do this).

There's info online on how to set a conf threshold when predicting with YOLO directly. How can I do this through DepthAI (my custom model is a Neural Network Node)? I want less false positives

Edit: Just to be clear, this is a YOLOv8 classification model, not detection

Hi,
you can use this method :

classification_nn.setConfidenceThreshold(0.5)

If you converted your neural network weights from .pt to .blob using the online converter, you get a JSON file which you can use to get and modify the network settings like the number of classes or the confidence threshold. Parsing this file would be a clean way to get the network settings in my opinion 🙂

@ThomasBr76 @jakaskerl I get this error:

Error: 'depthai.node.NeuralNetwork' object has no attribute 'setConfidenceThreshold'

To be clear, I uploaded a YOLOv8 image classification model as a NeuralNet node, it isn't an image detection model