The egg fertility detection model is based on YOLOv8n, optimized for high-speed, single-column conveyor belt egg processing.
- Base model: YOLOv8n
- Task: Object Detection (Binary Classification: Fertile/Infertile)
- Output: 2 classes (Fertile 'f', Infertile 'i')
- Total samples: 179 images (139 training, 40 validation)
- Features: Preprocessed egg images from single-column conveyor belt setup
- Classes: 2 (Fertile, Infertile)
- Framework: PyTorch (via Ultralytics YOLO implementation)
- Image size: 640x640
- Batch size: 16
- Maximum epochs: 300
- Early stopping patience: 15
- Learning rate strategy:
- Initial learning rate (lr0): 0.01
- Final learning rate factor (lrf): 0.001
- Optimizer: SGD (Stochastic Gradient Descent)
- Data augmentation:
- Close mosaic: 10
- Auto augment: randaugment
- Mixed precision training: Enabled (amp=True)
- Number of test images: 20
- Test environment: Single-column conveyor belt setup
Based on the evaluation of the 20-image test dataset:
- Accuracy: 1.00 (100%)
- Precision: 1.00 (100%)
- Recall: 1.00 (100%)
- F1-score: 1.00 (100%)
These metrics indicate perfect performance on the test dataset, suggesting that the model has learned to classify egg fertility with high accuracy in the specific conveyor belt environment.
- Preprocess: 3.0ms per image
- Inference: 10.0ms per image
- Postprocess: 2.0ms per image
- Total processing time: 15.0ms per image
The model demonstrates fast processing times, suitable for high-speed conveyor belt operations.
The model occasionally detects a single egg as two objects. This is a known trade-off for achieving higher processing speed and lower computational costs. Important points:
- The conveyor belt processes eggs in a single column, ensuring only one egg is present in each image.
- Correction code is implemented in the testing scripts to handle multiple detections:
- The highest confidence detection is used for classification.
- Multiple detections are merged or filtered out.
- The system maintains high accuracy in egg type classification (fertile vs. infertile) despite occasional multiple detections.
This approach allows for:
- Faster processing speeds
- Lower computational requirements
- Reduced AWS service costs
- Maintenance of high classification accuracy
- Expand the test dataset to include a larger and more diverse set of egg images
- Fine-tune the model to further reduce multiple detections while maintaining speed
- Conduct long-term performance monitoring in production environment
- Explore potential for model quantization to further optimize inference speed
- Investigate adaptive thresholding techniques to improve robustness across varying lighting conditions