What is a Detector Model?
- Identify Fruits: Detect apples, bananas, and oranges in images for sorting or inventory purposes.
- Harvest Monitoring: Count and track fruit yield in orchards or farms.
Use Cases for Fruit Detection
How to Use the Detector Model for Fruit Detection
Create a New Project
- Log in to Brain Builder for AITRIOS and click New Project.
- Select the Detector model type.
- Name your project (e.g., “Fruit Detector”) and add a description.
Prepare Your Dataset
- Use your captured dataset with images containing apples, bananas, and oranges.
- Ensure the images represent real-world scenarios, such as fruits on conveyor belts, in baskets, or on store shelves.
- Annotate the Images using Brain Builder:
- Draw bounding boxes around each fruit and label them according to your specific case. In our example, we will use the following annotations: “Apple,” “Banana,” and “Orange.”
- Use annotated images in KITTI format:
- Make sure you have a ZIP in the proper format and upload
Train the model
- Navigate to the Training tab and configure the duration settings:
- Quick: For testing the setup quickly.
- Balanced: For good results without excessive time.
- Thorough: For maximum accuracy when time allows.
- Start training the model. Brain Builder will evaluate multiple AI models and optimize the best one for your dataset.
Evaluate the Results
- After training, review the metrics:
- Precision: Check how accurately the model identifies apples, bananas, and oranges without false detections.
- Recall: Ensure the model detects all the fruits in the images.
The Precision and Recall Metrics
- The Precision Metric tries to answer the question: "Of all the objects I detected, how many were correcty detected?"
- The Recall Metric tries to answer the question: “Of all the objects that exist, how many did I detect?”
Adjust Thresholds
- The options to set are:
- The Confidence Threshold
- What It Does: Determines the minimum confidence level for detections to be considered valid (range: 0.1 to 1).
- How to Adjust:
- Lower threshold → Accepts more uncertain cases → Increases Recall (fewer missed detections).
- Higher threshold → Rejects uncertain cases → Increases Precision (fewer false detections).
- Default Value: 0.5, but should be adjusted based on your dataset and goals.
- The IoU (Intersection over Union) Threshold
- What It Does: Measures the overlap between the AI's detection box and the ground truth. Determines whether a detection is a True Positive.
- How to Adjust:
- Higher threshold → Requires more overlap → Ensures stricter accuracy.
- Lower threshold → Allows less overlap → Captures more detections, even if less precise.
Export the AI model
Deploying to the Raspberry Pi AI Camera
- Run the command below which will open a window displaying the camera feed:
- Watch as your Raspberry Pi AI camera runs your model in real-time, performing tasks from object detection to classification all completely on the camera freeing up your Raspberry Pi.
Tips for Success
- Balanced data: Ensure your dataset has a similar number of apples, bananas, and oranges to prevent bias.
- Augmentation: Add variations to your dataset, such as different angles and lighting, to improve robustness.
- Iterate: Use test results to refine your model by adding more labeled data or adjusting training settings.