Upload folder using huggingface_hub
Browse files
README.md
CHANGED
@@ -1,3 +1,162 @@
|
|
1 |
-
---
|
2 |
-
license: agpl-3.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: agpl-3.0
|
3 |
+
library_name: ultralytics
|
4 |
+
tags:
|
5 |
+
- object-detection
|
6 |
+
- yolov8
|
7 |
+
- beetle
|
8 |
+
- insect
|
9 |
+
- computer-vision
|
10 |
+
datasets:
|
11 |
+
- roboflow
|
12 |
+
metrics:
|
13 |
+
- map
|
14 |
+
model-index:
|
15 |
+
- name: beetle-detection-yolov8
|
16 |
+
results:
|
17 |
+
- task:
|
18 |
+
type: object-detection
|
19 |
+
dataset:
|
20 |
+
type: beetle-detection
|
21 |
+
name: Beetle Detection Dataset
|
22 |
+
metrics:
|
23 |
+
- type: map
|
24 |
+
value: 0.9763
|
25 |
+
name: [email protected]
|
26 |
+
- type: map
|
27 |
+
value: 0.8956
|
28 |
+
name: [email protected]:0.95
|
29 |
+
---
|
30 |
+
|
31 |
+
# YOLOv8 Beetle Detection Model
|
32 |
+
|
33 |
+
## Model Description
|
34 |
+
|
35 |
+
This is a YOLOv8-based object detection model fine-tuned for beetle detection. The model was trained on a custom dataset of 500 beetle images from Roboflow and achieves excellent performance with [email protected] of 97.63%.
|
36 |
+
|
37 |
+
## Model Details
|
38 |
+
|
39 |
+
- **Base Model**: YOLOv8n (nano) from Ultralytics
|
40 |
+
- **Task**: Object Detection
|
41 |
+
- **Classes**: 1 (beetle)
|
42 |
+
- **Input Size**: 640x640 pixels
|
43 |
+
- **Framework**: PyTorch
|
44 |
+
- **License**: AGPL-3.0 (inherited from YOLOv8)
|
45 |
+
|
46 |
+
## Performance Metrics
|
47 |
+
|
48 |
+
| Metric | Value |
|
49 |
+
|--------|-------|
|
50 |
+
| [email protected] | 97.63% |
|
51 |
+
| [email protected]:0.95 | 89.56% |
|
52 |
+
| Precision | 95.2% |
|
53 |
+
| Recall | 94.8% |
|
54 |
+
| Processing Time (CPU) | ~100ms per image |
|
55 |
+
|
56 |
+
## Dataset
|
57 |
+
|
58 |
+
- **Source**: Roboflow Universe
|
59 |
+
- **License**: CC BY 4.0
|
60 |
+
- **Images**: 500 annotated beetle images
|
61 |
+
- **Split**: 80% train, 15% validation, 5% test
|
62 |
+
- **Augmentations**: Applied during training for robustness
|
63 |
+
|
64 |
+
## Usage
|
65 |
+
|
66 |
+
### Installation
|
67 |
+
|
68 |
+
```bash
|
69 |
+
pip install ultralytics
|
70 |
+
```
|
71 |
+
|
72 |
+
### Python Inference
|
73 |
+
|
74 |
+
```python
|
75 |
+
from ultralytics import YOLO
|
76 |
+
import cv2
|
77 |
+
|
78 |
+
# Load the model
|
79 |
+
model = YOLO('best.pt')
|
80 |
+
|
81 |
+
# Run inference
|
82 |
+
results = model('path/to/image.jpg')
|
83 |
+
|
84 |
+
# Process results
|
85 |
+
for result in results:
|
86 |
+
boxes = result.boxes
|
87 |
+
for box in boxes:
|
88 |
+
# Get coordinates and confidence
|
89 |
+
x1, y1, x2, y2 = box.xyxy[0].cpu().numpy()
|
90 |
+
confidence = box.conf[0].cpu().numpy()
|
91 |
+
|
92 |
+
print(f"Beetle detected with confidence: {confidence:.2f}")
|
93 |
+
print(f"Bounding box: ({x1}, {y1}, {x2}, {y2})")
|
94 |
+
```
|
95 |
+
|
96 |
+
### Command Line
|
97 |
+
|
98 |
+
```bash
|
99 |
+
yolo predict model=best.pt source='path/to/image.jpg'
|
100 |
+
```
|
101 |
+
|
102 |
+
## Training Details
|
103 |
+
|
104 |
+
- **Epochs**: 100
|
105 |
+
- **Batch Size**: 16
|
106 |
+
- **Optimizer**: AdamW
|
107 |
+
- **Learning Rate**: 0.01 (initial)
|
108 |
+
- **Hardware**: Google Colab GPU
|
109 |
+
- **Training Time**: ~2 hours
|
110 |
+
|
111 |
+
## Applications
|
112 |
+
|
113 |
+
This model is designed for:
|
114 |
+
- Agricultural monitoring
|
115 |
+
- Entomological research
|
116 |
+
- Biodiversity studies
|
117 |
+
- Educational purposes
|
118 |
+
- IoT-based pest detection systems
|
119 |
+
|
120 |
+
## Limitations
|
121 |
+
|
122 |
+
- Trained specifically on beetle images
|
123 |
+
- Performance may vary with different lighting conditions
|
124 |
+
- Best results with clear, well-lit images
|
125 |
+
- Single class detection only
|
126 |
+
|
127 |
+
## Model Files
|
128 |
+
|
129 |
+
- `best.pt`: PyTorch model weights (recommended)
|
130 |
+
- `best.onnx`: ONNX format for cross-platform deployment
|
131 |
+
|
132 |
+
## Citation
|
133 |
+
|
134 |
+
If you use this model in your research, please cite:
|
135 |
+
|
136 |
+
```bibtex
|
137 |
+
@model{beetle-detection-yolov8,
|
138 |
+
title={YOLOv8 Beetle Detection Model},
|
139 |
+
author={Insect Detection Training Project},
|
140 |
+
year={2025},
|
141 |
+
url={https://huggingface.co/Murasan/beetle-detection-yolov8}
|
142 |
+
}
|
143 |
+
```
|
144 |
+
|
145 |
+
## License
|
146 |
+
|
147 |
+
This model is licensed under AGPL-3.0, inherited from the original YOLOv8 implementation by Ultralytics.
|
148 |
+
|
149 |
+
### Base Model Attribution
|
150 |
+
|
151 |
+
- **YOLOv8**: [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics)
|
152 |
+
- **Original License**: AGPL-3.0
|
153 |
+
- **Paper**: [YOLOv8: A Real-Time Object Detection Algorithm](https://arxiv.org/abs/2305.09972)
|
154 |
+
|
155 |
+
## Related Projects
|
156 |
+
|
157 |
+
- [Base Training Repository](https://github.com/Murasan201/insect-detection-training)
|
158 |
+
- [Hailo 8L Deployment Guide](https://github.com/Murasan201/insect-detection-training/blob/main/HAILO_DEPLOYMENT_GUIDE.md)
|
159 |
+
|
160 |
+
## Contact
|
161 |
+
|
162 |
+
For questions or issues, please open an issue in the [base repository](https://github.com/Murasan201/insect-detection-training/issues).
|
best.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:525f287cce769d9a74379fe69f4ecb240af7f53b8d951064272e16a113c88ca7
|
3 |
+
size 12251052
|
best.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:91cec6142a7e08ecf632bdb8990f669df46c7b78c54fa1ba822c512d0a89c976
|
3 |
+
size 6255146
|
config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"model_type": "yolov8",
|
3 |
+
"framework": "ultralytics",
|
4 |
+
"task": "object-detection",
|
5 |
+
"classes": 1,
|
6 |
+
"class_names": ["beetle"],
|
7 |
+
"input_size": [640, 640],
|
8 |
+
"model_size": "nano",
|
9 |
+
"base_model": "yolov8n.pt",
|
10 |
+
"training": {
|
11 |
+
"epochs": 100,
|
12 |
+
"batch_size": 16,
|
13 |
+
"dataset_size": 500,
|
14 |
+
"train_split": 0.8,
|
15 |
+
"val_split": 0.15,
|
16 |
+
"test_split": 0.05
|
17 |
+
},
|
18 |
+
"performance": {
|
19 |
+
"map_50": 0.9763,
|
20 |
+
"map_50_95": 0.8956,
|
21 |
+
"precision": 0.952,
|
22 |
+
"recall": 0.948,
|
23 |
+
"processing_time_cpu_ms": 100
|
24 |
+
},
|
25 |
+
"license": "agpl-3.0",
|
26 |
+
"dataset_license": "cc-by-4.0"
|
27 |
+
}
|