atticus-carter commited on
Commit
e05ee2e
·
verified ·
1 Parent(s): 608d167

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +103 -30
README.md CHANGED
@@ -1,7 +1,17 @@
1
  ---
2
  license: mit
3
  ---
4
- # Ice Seal Detection Model Card
 
 
 
 
 
 
 
 
 
 
5
 
6
  This model is best at detecting ringed, spotted, and bearded seals. While false negatives are rare, underrepresented classes tend to be misclassified rather than completely missed. This property is beneficial in workflows that incorporate manual review (e.g., imaging surveys). It also supports advanced techniques like clustering and two-shot fine-tuning. For real-time inference, YOLO remains the recommended architecture.
7
 
@@ -15,44 +25,44 @@ This model is best at detecting ringed, spotted, and bearded seals. While false
15
  - **Gradients**: 2,591,384
16
  - **GFLOPs**: 6.4
17
  - **Classes (nc=8)**:
18
- 1. bearded_pup
19
- 2. bearded_seal
20
- 3. ribbon_pup
21
- 4. ribbon_seal
22
- 5. ringed_pup
23
- 6. ringed_seal
24
- 7. spotted_pup
25
- 8. spotted_seal
26
 
27
  ---
28
 
29
  ## Dataset and Preprocessing
30
 
31
- - **Source Imagery**:
32
  - Original resolution: 6048 × 4032
33
  - Total source images: 7,671 (including 156 null examples)
34
- - Resolution range: ~12.21 MP to ~24.39 MP
35
  - **Tiling**:
36
  - Each source image was split into 4 tiles (2 rows × 2 columns) at 1024 × 1024.
37
  - Post-tiling: **30,684 images**.
38
  - **Annotations**:
39
  - 8,948 total annotations.
40
- - ~1.2 annotations per image on average.
41
 
42
  ### Class Distribution
43
 
44
- | Class Name | Total Count | Training Count | Validation Count | Test Count |
45
- |----------------|-------------|----------------|------------------|------------|
46
- | ringed_seal | 3180 | 2190 | 674 | 316 |
47
- | bearded_seal | 1922 | 1392 | 359 | 171 |
48
- | spotted_seal | 1662 | 1142 | 344 | 176 |
49
- | unknown_seal | 812 | 585 | 153 | 74 |
50
- | bearded_pup | 420 | 300 | 77 | 43 |
51
- | unknown_pup | 392 | 275 | 63 | 54 |
52
- | spotted_pup | 238 | 174 | 46 | 18 |
53
- | ribbon_seal | 232 | 154 | 45 | 33 |
54
- | ringed_pup | 54 | 37 | 14 | 3 |
55
- | ribbon_pup | 36 | 28 | 5 | 3 |
56
 
57
  (Note: Model training specifically uses the 8 classes listed in **Model Details**.)
58
 
@@ -81,9 +91,9 @@ This model is best at detecting ringed, spotted, and bearded seals. While false
81
 
82
  ## Metrics (Epoch 64)
83
 
84
- | epoch | time | train/box_loss | train/cls_loss | train/dfl_loss | metrics/precision(B) | metrics/recall(B) | metrics/mAP50(B) | metrics/mAP50-95(B) | val/box_loss | val/cls_loss | val/dfl_loss | lr/pg0 | lr/pg1 | lr/pg2 |
85
- |-------|---------|-----------------|-----------------|----------------|-----------------------|-------------------|------------------|---------------------|--------------|-------------|-------------|------------|------------|------------|
86
- | 64 | 23230.9 | 1.34616 | 1.18894 | 0.89475 | 0.76783 | 0.43806 | 0.4671 | 0.30454 | 1.37059 | 1.77372 | 0.90735 | 0.00993763 | 0.00993763 | 0.00993763 |
87
 
88
  ---
89
 
@@ -97,15 +107,78 @@ This model is best at detecting ringed, spotted, and bearded seals. While false
97
 
98
  ---
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  ## Environmental Impact
101
 
102
  - **Compute Location**: Google Cloud Platform (GCP), `northamerica-northeast1` region
103
  - Carbon efficiency: 0.03 kgCO₂eq/kWh
104
  - **Hardware**: A100 PCIe 40/80GB (TDP of 250W)
105
- - **Compute Duration**: ~10 hours
106
- - **Total Emissions**: ~0.07 kgCO₂eq
107
-
108
 
109
  Estimation based on the [MachineLearning Impact calculator](https://mlco2.github.io/impact#compute), from [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
110
 
111
 
 
 
1
  ---
2
  license: mit
3
  ---
4
+ ## NOAA AFSC Marine Mammal Lab YOLOv11 Ice Seal Object Detection Model
5
+
6
+ Accurate identification of ice-associated seals in aerial imagery is essential for monitoring population dynamics and assessing ecological trends in Arctic and sub-Arctic environments. To facilitate the fast and accurate detection of these seals, I have developed a deep learning-based object detection model utilizing **YOLOV11n**, a lightweight neural network architecture optimized for high-performance image analysis. The model, comprising 319 layers and 2,591,400 parameters, was trained on a diverse dataset containing 7,671 high-resolution images, which were tiled into 30,684 smaller images to enhance feature recognition.
7
+
8
+ To improve generalization, data augmentation techniques, including **Blur**, **MedianBlur**, **ToGray**, and **CLAHE**, were applied. The model was trained at a resolution of 1024×1024 using an **SGD** optimizer (`lr=0.01, momentum=0.9`) with a batch size of 113 on an NVIDIA A100 GPU. Eight distinct seal categories, including bearded, ribbon, ringed, and spotted seals in both pup and adult stages, were annotated across the dataset.
9
+
10
+ The model achieved an overall mean average precision (mAP) of **0.4833**, with particularly high performance on bearded seals (0.9 mAP), ringed seals (0.833 mAP), and moderate performance on ribbon seals (0.464 mAP). Pup classes consistently underperformed due to smaller size and limited representation. Evaluation metrics indicate its effectiveness in distinguishing seal species with high precision (0.76783) and recall. Because of this high precision, the model is easily adaptable as an ROI detector by collapsing classes to one during inference and lowering the confidence threshold to 0.01, combined with a well-tuned IoU threshold. Under these settings, it successfully detected 98.27% of all seals, regardless of class. The model was successfully ported to TFLite for edge devices, enabling TPU acceleration and providing accurate inference in near real-time. These findings show the model’s potential for large-scale, automated monitoring of ice-associated seal populations in remote and challenging environments.
11
+
12
+ ---
13
+
14
+ # Ice Associated Seal Detection;
15
 
16
  This model is best at detecting ringed, spotted, and bearded seals. While false negatives are rare, underrepresented classes tend to be misclassified rather than completely missed. This property is beneficial in workflows that incorporate manual review (e.g., imaging surveys). It also supports advanced techniques like clustering and two-shot fine-tuning. For real-time inference, YOLO remains the recommended architecture.
17
 
 
25
  - **Gradients**: 2,591,384
26
  - **GFLOPs**: 6.4
27
  - **Classes (nc=8)**:
28
+ 1. bearded\_pup
29
+ 2. bearded\_seal
30
+ 3. ribbon\_pup
31
+ 4. ribbon\_seal
32
+ 5. ringed\_pup
33
+ 6. ringed\_seal
34
+ 7. spotted\_pup
35
+ 8. spotted\_seal
36
 
37
  ---
38
 
39
  ## Dataset and Preprocessing
40
 
41
+ - **Source Imagery**:
42
  - Original resolution: 6048 × 4032
43
  - Total source images: 7,671 (including 156 null examples)
44
+ - Resolution range: \~12.21 MP to \~24.39 MP
45
  - **Tiling**:
46
  - Each source image was split into 4 tiles (2 rows × 2 columns) at 1024 × 1024.
47
  - Post-tiling: **30,684 images**.
48
  - **Annotations**:
49
  - 8,948 total annotations.
50
+ - \~1.2 annotations per image on average.
51
 
52
  ### Class Distribution
53
 
54
+ | Class Name | Total Count | Training Count | Validation Count | Test Count |
55
+ | ------------- | ----------- | -------------- | ---------------- | ---------- |
56
+ | ringed\_seal | 3180 | 2190 | 674 | 316 |
57
+ | bearded\_seal | 1922 | 1392 | 359 | 171 |
58
+ | spotted\_seal | 1662 | 1142 | 344 | 176 |
59
+ | unknown\_seal | 812 | 585 | 153 | 74 |
60
+ | bearded\_pup | 420 | 300 | 77 | 43 |
61
+ | unknown\_pup | 392 | 275 | 63 | 54 |
62
+ | spotted\_pup | 238 | 174 | 46 | 18 |
63
+ | ribbon\_seal | 232 | 154 | 45 | 33 |
64
+ | ringed\_pup | 54 | 37 | 14 | 3 |
65
+ | ribbon\_pup | 36 | 28 | 5 | 3 |
66
 
67
  (Note: Model training specifically uses the 8 classes listed in **Model Details**.)
68
 
 
91
 
92
  ## Metrics (Epoch 64)
93
 
94
+ | epoch | time | train/box\_loss | train/cls\_loss | train/dfl\_loss | metrics/precision(B) | metrics/recall(B) | metrics/mAP50(B) | metrics/mAP50-95(B) | val/box\_loss | val/cls\_loss | val/dfl\_loss | lr/pg0 | lr/pg1 | lr/pg2 |
95
+ | ----- | ------- | --------------- | --------------- | --------------- | -------------------- | ----------------- | ---------------- | ------------------- | ------------- | ------------- | ------------- | ---------- | ---------- | ---------- |
96
+ | 64 | 23230.9 | 1.34616 | 1.18894 | 0.89475 | 0.76783 | 0.43806 | 0.4671 | 0.30454 | 1.37059 | 1.77372 | 0.90735 | 0.00993763 | 0.00993763 | 0.00993763 |
97
 
98
  ---
99
 
 
107
 
108
  ---
109
 
110
+
111
+
112
+ ### Example Inference Code
113
+
114
+ Below is a brief example (in Python) showing how you might run inference using the `model.predict` method from the Ultralytics YOLO interface. This snippet demonstrates usage on a still image, a video file, and a live webcam feed. Adjust paths, thresholds, and device settings as needed.
115
+
116
+ ```python
117
+ # Example: Running inference with YOLO for Ice Seal Detection
118
+
119
+ # 1. Install ultralytics if not already:
120
+ # pip install ultralytics
121
+
122
+ from ultralytics import YOLO
123
+
124
+ # 2. Load your custom-trained weights
125
+ model = YOLO("path/to/NOAA_AFSC_MML_Iceseals_31K.pt")
126
+
127
+ # 3. Inference on a still image
128
+ # Using a low confidence threshold (e.g., 0.01) is helpful when using the model as an ROI detector
129
+ # with a well-tuned IoU threshold.
130
+ results_image = model.predict(
131
+ source="path/to/your_image.jpg",
132
+ conf=0.01, # Confidence threshold
133
+ iou=0.45, # IoU threshold
134
+ device=0 # Use GPU 0 if available; set to 'cpu' if no GPU
135
+ )
136
+
137
+ # 4. Inference on a video file
138
+ # The 'show=True' flag will display the annotated frames on screen in real time.
139
+ results_video = model.predict(
140
+ source="path/to/your_video.mp4",
141
+ conf=0.01,
142
+ iou=0.45,
143
+ device=0,
144
+ show=True
145
+ )
146
+
147
+ # 5. Live video stream (e.g., webcam)
148
+ # source=0 typically refers to the default camera. If multiple cameras exist, use 1, 2, etc.
149
+ results_live = model.predict(
150
+ source=0, # Webcam
151
+ conf=0.01,
152
+ iou=0.45,
153
+ device=0,
154
+ show=True
155
+ )
156
+
157
+ # 6. Accessing the results
158
+ # Each 'results_*' object contains predictions (boxes, confidence, class IDs, etc.)
159
+ for result in results_image:
160
+ print("Detections on the image:")
161
+ # result.boxes has bounding box data
162
+
163
+ # Similarly, you can iterate over results in video/live inference if needed for further processing.
164
+ ```
165
+
166
+ **Notes**:
167
+
168
+ - **Confidence Threshold (********`conf`********)**: Lowering it (e.g., `0.01`) can help capture most bounding boxes when using the model purely as an ROI detector. You should then rely on a more precise IoU threshold or post-processing to filter out false positives.
169
+ - **IoU Threshold (********`iou`********)**: Increase or decrease depending on how tightly you want bounding boxes to match potential detections.
170
+ - **Real-Time Inference**: This demo uses `show=True` for immediate display; removing it will still run inference but won’t display frames. You can also pipe results into further post-processing, tracking, or saving.
171
+ - **Device**: Change `device=0` to `'cpu'` if you don’t have a GPU available.
172
+
173
  ## Environmental Impact
174
 
175
  - **Compute Location**: Google Cloud Platform (GCP), `northamerica-northeast1` region
176
  - Carbon efficiency: 0.03 kgCO₂eq/kWh
177
  - **Hardware**: A100 PCIe 40/80GB (TDP of 250W)
178
+ - **Compute Duration**: \~10 hours
179
+ - **Total Emissions**: \~0.07 kgCO₂eq
 
180
 
181
  Estimation based on the [MachineLearning Impact calculator](https://mlco2.github.io/impact#compute), from [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
182
 
183
 
184
+