Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
base_model:
|
5 |
+
- Ultralytics/YOLO11
|
6 |
+
tags:
|
7 |
+
- yolo
|
8 |
+
- yolo11
|
9 |
+
- yolo11n
|
10 |
+
- yolo11n-seg
|
11 |
+
- fish
|
12 |
+
datasets:
|
13 |
+
- akridge/MOUSS_fish_imagery_dataset_grayscale_small
|
14 |
+
---
|
15 |
+
|
16 |
+
# Yolo11n-seg Fish Segmentation
|
17 |
+
|
18 |
+
## Model Overview
|
19 |
+
This model was trained to detect and segment fish in underwater **Grayscale Imagery** using the YOLO11n-seg architecture, leveraging automatic training with the **Segment Anything Model (SAM)** for generating segmentation masks. The combination of detection and SAM-powered segmentation enhances the model's ability to outline fish boundaries.
|
20 |
+
|
21 |
+
- **Model Architecture**: YOLO11n-seg
|
22 |
+
- **Task**: Fish Segmentation
|
23 |
+
- **Footage Type**: Grayscale Underwater Footage
|
24 |
+
- **Classes**: 1 (Fish)
|
25 |
+
|
26 |
+
## Auto-Training Process
|
27 |
+
The segmentation dataset was generated using an automated pipeline:
|
28 |
+
- **Detection Model**: A pre-trained YOLO model (https://huggingface.co/akridge/yolo11-fish-detector-grayscale/) was used to detect fish.
|
29 |
+
- **Segmentation**: The SAM model (`sam_b.pt`) was applied to generate precise segmentation masks around detected fish.
|
30 |
+
- **Output**: The dataset was saved at `/content/sam_dataset/`.
|
31 |
+
|
32 |
+
This automated process allowed for efficient mask generation without manual annotation, facilitating faster dataset creation.
|
33 |
+
|
34 |
+
## Model Weights
|
35 |
+
Download the model weights [here](./yolo11n_fish_seg_trained.pt)
|
36 |
+
|
37 |
+
## Intended Use
|
38 |
+
- Real-time fish detection and segmentation on grayscale underwater imagery.
|
39 |
+
- Post-processing of video or images for research purposes in marine biology and ecosystem monitoring.
|
40 |
+
|
41 |
+
## Training Configuration
|
42 |
+
- **Dataset**: SAM asisted segmentation dataset.
|
43 |
+
- **Training/Validation Split**: 80% training, 20% validation.
|
44 |
+
- **Number of Epochs**: 50
|
45 |
+
- **Learning Rate**: 0.001
|
46 |
+
- **Batch Size**: 16
|
47 |
+
- **Image Size**: 640x640
|
48 |
+
|
49 |
+
## Results and Metrics
|
50 |
+
The model was trained and evaluated on the generated segmentation dataset with the following results:
|
51 |
+
|
52 |
+
### Confusion Matrix
|
53 |
+
![Confusion Matrix](./train/results.png)
|
54 |
+
|
55 |
+
## How to Use the Model
|
56 |
+
To use the trained YOLO11n-seg model for fish segmentation:
|
57 |
+
|
58 |
+
1. **Load the Model**:
|
59 |
+
```python
|
60 |
+
from ultralytics import YOLO
|
61 |
+
|
62 |
+
# Load YOLO11n-seg model
|
63 |
+
model = YOLO("yolo11n_fish_seg_trained.pt")
|
64 |
+
|
65 |
+
# Perform inference on an image
|
66 |
+
results = model("/content/test_image.jpg")
|
67 |
+
results.show()
|
68 |
+
```
|