akridge commited on
Commit
65d9aae
1 Parent(s): a6454de
README.md CHANGED
@@ -1,5 +1,83 @@
1
- ---
2
- license: other
3
- license_name: license
4
- license_link: LICENSE
5
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Fish Detector | Grayscale
2
+
3
+ ## Model Details / Overview
4
+ This model was trained to detect fish in underwater **Grayscale Imagery** using the YOLOv8n architecture. The model leverages **unsupervised learning** techniques to learn patterns and identify fish without relying on fully labeled datasets.
5
+
6
+ - **Model Architecture**: YOLOv8n
7
+ - **Task**: Object Detection (Fish Detection)
8
+ - **Footage Type**: Grayscale(Black-and-White) Underwater Footage
9
+ - **Classes**: Fish
10
+
11
+ # Intended Use
12
+ - real time detections on Grayscale(Black-and-White) Underwater Footage
13
+ - Post-processed video/imagery on Grayscale(Black-and-White) Underwater Footage
14
+
15
+ # Factors
16
+ ### Model Performance
17
+ - Unsupervised Learning: Flexible pattern recognition without fully annotated datasets, suited for grayscale imagery.
18
+ - Grayscale Imagery: Trained specifically on black-and-white underwater footage, enhancing performance in this environment.
19
+ - Model Architecture (YOLOv8n): lightweight and optimized for real-time fish detection in underwater footage.
20
+ - Training Data: Quality and diversity of the grayscale underwater dataset, split into 80% training and 20% validation.
21
+ - Training Parameters: Configured with 50 epochs, a 0.001 learning rate, and 416x416 image size for optimal model convergence.
22
+
23
+ ## Model Weights
24
+ The model's weights can be found [here](./yolov8n_fish_trained.pt)
25
+
26
+ ## Test Results
27
+ ![GIF description](./unsupervised_ai_test.gif)
28
+
29
+ ## Metrics
30
+ Below are the key metrics from the model evaluation on the validation set:
31
+
32
+ - **Precision**: 0.863
33
+ - **Recall**: 0.869
34
+ - **mAP50**: 0.936
35
+ - **mAP50-95**: 0.856
36
+
37
+ ## Training Validation Results
38
+ ### Training and Validation Losses
39
+ ![Training and Validation Losses](./train/results.png)
40
+
41
+ ### Confusion Matrix
42
+ ![Confusion Matrix](./train/confusion_matrix.png)
43
+
44
+ ### Precision-Recall Curve
45
+ ![Precision-Recall Curve](./train/PR_curve.png)
46
+
47
+ ### F1 Score Curve
48
+ ![F1 Score Curve](./train/F1_curve.png)
49
+
50
+ ## Training Configuration
51
+ - **Model Weights File**: `yolov8n_fish_trained.pt`
52
+ - **Number of Epochs**: 50
53
+ - **Learning Rate**: 0.001
54
+ - **Batch Size**: 16
55
+ - **Image Size**: 416x416
56
+ -
57
+ ## Training and Evaluation Data
58
+ - **Dataset**: `fish_dataset.zip` consisting of Grayscale(black-and-white) underwater footage.
59
+ - **Training/Validation Split**: The dataset was split into 80% training and 20% validation.
60
+ - **Classes**: The model was trained on a single class (fish).
61
+ - **Learning Approach**: Unsupervised learning, meaning the model identified patterns in the data without needing detailed annotations for all images.
62
+
63
+ ## Deployment
64
+ ### How to Use the Model
65
+
66
+ To use the trained model, follow these steps:
67
+
68
+ 1. **Load the Model**:
69
+ ```python
70
+ from ultralytics import YOLO
71
+
72
+ # Load the model
73
+ model = YOLO("yolov8n_fish_trained.pt")
74
+
75
+ ### Limitations
76
+ The model was trained on black-and-white underwater footage, and may not generalize well to color images or videos with different lighting conditions.
77
+ The unsupervised learning nature of this model may lead to some incorrect detections, particularly in noisy environments where it may confuse other underwater objects for fish.
78
+ Images with complex backgrounds, occlusions, or poor resolution may affect the model's performance.
79
+
80
+ ### Additional Notes:
81
+ - **Grayscale Imagery**: The model may perform better on grayscale images and might not generalize well to color underwater footage or images with different lighting conditions.
82
+ - **Unsupervised Learning**: Since using an unsupervised approach, it's worth noting that this can make the model more flexible but also more prone to errors or misclassifications without annotated data.
83
+ - **Ethical Considerations** The unsupervised learning approach could lead to biases in detections, especially in new environments or types of marine life that were not represented in the training dataset. This model should not be used in critical applications without thorough validation to ensure it doesn't miss key detections or produce incorrect results in sensitive scenarios. Consider the potential environmental or societal impact when using the model for marine conservation or research, and ensure that the detections are verified.
fish_dataset.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+
2
+ train: /content/fish_dataset/images/train
3
+ val: /content/fish_dataset/images/val
4
+
5
+ # Number of classes
6
+ nc: 1
7
+
8
+ # Class names
9
+ names: ['fish']
fish_dataset.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a089a213caf4228e87b9ea814020515f16b6de6c2dd1ecea3948f0266c8b701
3
+ size 30207486
train/F1_curve.png ADDED
train/PR_curve.png ADDED
train/P_curve.png ADDED
train/R_curve.png ADDED
train/args.yaml ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ task: detect
2
+ mode: train
3
+ model: yolov8n.pt
4
+ data: /content/fish_dataset.yaml
5
+ epochs: 50
6
+ time: null
7
+ patience: 100
8
+ batch: 16
9
+ imgsz: 416
10
+ save: true
11
+ save_period: -1
12
+ cache: false
13
+ device: null
14
+ workers: 8
15
+ project: null
16
+ name: train2
17
+ exist_ok: false
18
+ pretrained: true
19
+ optimizer: auto
20
+ verbose: true
21
+ seed: 0
22
+ deterministic: true
23
+ single_cls: false
24
+ rect: false
25
+ cos_lr: false
26
+ close_mosaic: 10
27
+ resume: false
28
+ amp: true
29
+ fraction: 1.0
30
+ profile: false
31
+ freeze: null
32
+ multi_scale: false
33
+ overlap_mask: true
34
+ mask_ratio: 4
35
+ dropout: 0.0
36
+ val: true
37
+ split: val
38
+ save_json: false
39
+ save_hybrid: false
40
+ conf: null
41
+ iou: 0.7
42
+ max_det: 300
43
+ half: false
44
+ dnn: false
45
+ plots: true
46
+ source: null
47
+ vid_stride: 1
48
+ stream_buffer: false
49
+ visualize: false
50
+ augment: false
51
+ agnostic_nms: false
52
+ classes: null
53
+ retina_masks: false
54
+ embed: null
55
+ show: false
56
+ save_frames: false
57
+ save_txt: false
58
+ save_conf: false
59
+ save_crop: false
60
+ show_labels: true
61
+ show_conf: true
62
+ show_boxes: true
63
+ line_width: null
64
+ format: torchscript
65
+ keras: false
66
+ optimize: false
67
+ int8: false
68
+ dynamic: false
69
+ simplify: false
70
+ opset: null
71
+ workspace: 4
72
+ nms: false
73
+ lr0: 0.001
74
+ lrf: 0.01
75
+ momentum: 0.937
76
+ weight_decay: 0.0005
77
+ warmup_epochs: 3.0
78
+ warmup_momentum: 0.8
79
+ warmup_bias_lr: 0.1
80
+ box: 7.5
81
+ cls: 0.5
82
+ dfl: 1.5
83
+ pose: 12.0
84
+ kobj: 1.0
85
+ label_smoothing: 0.0
86
+ nbs: 64
87
+ hsv_h: 0.015
88
+ hsv_s: 0.7
89
+ hsv_v: 0.4
90
+ degrees: 0.0
91
+ translate: 0.1
92
+ scale: 0.5
93
+ shear: 0.0
94
+ perspective: 0.0
95
+ flipud: 0.0
96
+ fliplr: 0.5
97
+ bgr: 0.0
98
+ mosaic: 1.0
99
+ mixup: 0.0
100
+ copy_paste: 0.0
101
+ auto_augment: randaugment
102
+ erasing: 0.4
103
+ crop_fraction: 1.0
104
+ cfg: null
105
+ tracker: botsort.yaml
106
+ save_dir: runs/detect/train2
train/confusion_matrix.png ADDED
train/confusion_matrix_normalized.png ADDED
train/events.out.tfevents.1726274642.72e7a9bf1993.1448.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:297aeeede29b9252092f220731dcad9f5e9a3e8a63c0e2ad82a1bc0db3ca8586
3
+ size 218900
train/labels.jpg ADDED
train/labels_correlogram.jpg ADDED
train/results.csv ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ epoch, 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
2
+ 1, 1.2953, 1.9739, 1.1328, 0.82879, 0.47077, 0.64746, 0.43229, 1.1013, 2.0847, 1.0253, 0.0006595, 0.0006595, 0.0006595
3
+ 2, 1.1971, 1.3787, 1.082, 0.6819, 0.67442, 0.66603, 0.48572, 1.0144, 1.3065, 0.99343, 0.0012999, 0.0012999, 0.0012999
4
+ 3, 1.1709, 1.2388, 1.0967, 0.29933, 0.44979, 0.3353, 0.21736, 1.3953, 2.1596, 1.2417, 0.0019139, 0.0019139, 0.0019139
5
+ 4, 1.1233, 1.1333, 1.0611, 0.72779, 0.62179, 0.72703, 0.45693, 1.2051, 1.1985, 1.1091, 0.0018812, 0.0018812, 0.0018812
6
+ 5, 1.0777, 1.0436, 1.0499, 0.71925, 0.67442, 0.74237, 0.53397, 1.0629, 1.2845, 0.99855, 0.0018416, 0.0018416, 0.0018416
7
+ 6, 1.0561, 1.04, 1.0362, 0.7486, 0.76956, 0.82367, 0.61038, 0.93494, 0.98937, 0.97547, 0.001802, 0.001802, 0.001802
8
+ 7, 1.0243, 1.0118, 1.0175, 0.73714, 0.77801, 0.84144, 0.64166, 0.83591, 0.96995, 0.93913, 0.0017624, 0.0017624, 0.0017624
9
+ 8, 0.97745, 0.95048, 1.0083, 0.71633, 0.79493, 0.82553, 0.65402, 0.82488, 0.87552, 0.93392, 0.0017228, 0.0017228, 0.0017228
10
+ 9, 0.9622, 0.94085, 1.0024, 0.74915, 0.71247, 0.81018, 0.63146, 0.88711, 0.9942, 0.9475, 0.0016832, 0.0016832, 0.0016832
11
+ 10, 0.93852, 0.90972, 0.99337, 0.75284, 0.7315, 0.82466, 0.62808, 0.85862, 0.90094, 0.94149, 0.0016436, 0.0016436, 0.0016436
12
+ 11, 0.9528, 0.92294, 1.0072, 0.70873, 0.78858, 0.83149, 0.64861, 0.83998, 0.86307, 0.93111, 0.001604, 0.001604, 0.001604
13
+ 12, 0.91538, 0.87837, 0.98758, 0.79656, 0.75899, 0.82904, 0.66659, 0.76979, 0.8862, 0.92312, 0.0015644, 0.0015644, 0.0015644
14
+ 13, 0.8807, 0.84875, 0.97132, 0.77893, 0.77378, 0.83504, 0.67202, 0.73122, 0.78581, 0.90813, 0.0015248, 0.0015248, 0.0015248
15
+ 14, 0.88448, 0.83341, 0.97886, 0.74875, 0.82452, 0.8571, 0.65006, 0.91957, 0.83281, 0.93456, 0.0014852, 0.0014852, 0.0014852
16
+ 15, 0.86225, 0.82202, 0.96802, 0.7614, 0.7961, 0.84471, 0.6852, 0.76055, 0.82788, 0.91454, 0.0014456, 0.0014456, 0.0014456
17
+ 16, 0.84379, 0.81179, 0.96017, 0.80921, 0.79493, 0.88161, 0.72078, 0.69005, 0.77177, 0.89102, 0.001406, 0.001406, 0.001406
18
+ 17, 0.8235, 0.78946, 0.96698, 0.78491, 0.75687, 0.84316, 0.66822, 0.803, 0.80554, 0.91785, 0.0013664, 0.0013664, 0.0013664
19
+ 18, 0.82541, 0.79377, 0.95822, 0.7266, 0.62367, 0.73305, 0.55935, 0.9481, 1.2251, 0.9965, 0.0013268, 0.0013268, 0.0013268
20
+ 19, 0.80522, 0.77391, 0.94947, 0.874, 0.72727, 0.88161, 0.70606, 0.74283, 0.78203, 0.90896, 0.0012872, 0.0012872, 0.0012872
21
+ 20, 0.79829, 0.78174, 0.94482, 0.77287, 0.79855, 0.85782, 0.68803, 0.74466, 0.8076, 0.9113, 0.0012476, 0.0012476, 0.0012476
22
+ 21, 0.79146, 0.7395, 0.94444, 0.80175, 0.82875, 0.89074, 0.73801, 0.66867, 0.73761, 0.87698, 0.001208, 0.001208, 0.001208
23
+ 22, 0.77024, 0.75605, 0.93518, 0.84364, 0.79281, 0.89061, 0.74262, 0.70519, 0.74424, 0.88128, 0.0011684, 0.0011684, 0.0011684
24
+ 23, 0.77723, 0.72309, 0.93856, 0.78305, 0.80124, 0.87747, 0.68328, 0.82301, 0.75798, 0.90525, 0.0011288, 0.0011288, 0.0011288
25
+ 24, 0.72975, 0.70466, 0.9322, 0.84488, 0.81756, 0.90768, 0.75867, 0.67403, 0.67315, 0.87816, 0.0010892, 0.0010892, 0.0010892
26
+ 25, 0.74628, 0.71244, 0.93104, 0.86231, 0.78013, 0.89222, 0.75295, 0.63798, 0.69272, 0.87729, 0.0010496, 0.0010496, 0.0010496
27
+ 26, 0.76672, 0.71711, 0.93221, 0.75939, 0.84073, 0.8847, 0.73934, 0.67718, 0.69613, 0.87697, 0.00101, 0.00101, 0.00101
28
+ 27, 0.74209, 0.71901, 0.92462, 0.85781, 0.82452, 0.91071, 0.76783, 0.6531, 0.64242, 0.86842, 0.0009704, 0.0009704, 0.0009704
29
+ 28, 0.73707, 0.69863, 0.93009, 0.82887, 0.84778, 0.90627, 0.76514, 0.62388, 0.66896, 0.86529, 0.0009308, 0.0009308, 0.0009308
30
+ 29, 0.71853, 0.66521, 0.92183, 0.87469, 0.81167, 0.91512, 0.7722, 0.65478, 0.63013, 0.87001, 0.0008912, 0.0008912, 0.0008912
31
+ 30, 0.70862, 0.68115, 0.91457, 0.84112, 0.79493, 0.88707, 0.75592, 0.6287, 0.67981, 0.86558, 0.0008516, 0.0008516, 0.0008516
32
+ 31, 0.6985, 0.66936, 0.9158, 0.79659, 0.82875, 0.89378, 0.76772, 0.60642, 0.68223, 0.86177, 0.000812, 0.000812, 0.000812
33
+ 32, 0.69578, 0.67573, 0.91718, 0.87198, 0.84355, 0.91121, 0.77012, 0.63679, 0.62237, 0.86779, 0.0007724, 0.0007724, 0.0007724
34
+ 33, 0.68477, 0.65249, 0.91089, 0.87291, 0.81315, 0.90708, 0.78848, 0.57441, 0.63087, 0.85586, 0.0007328, 0.0007328, 0.0007328
35
+ 34, 0.67056, 0.65556, 0.8985, 0.86416, 0.80698, 0.91022, 0.78387, 0.58976, 0.65053, 0.85581, 0.0006932, 0.0006932, 0.0006932
36
+ 35, 0.657, 0.63404, 0.90184, 0.84098, 0.83932, 0.90659, 0.78517, 0.58456, 0.64155, 0.84978, 0.0006536, 0.0006536, 0.0006536
37
+ 36, 0.66322, 0.62269, 0.90412, 0.81816, 0.83932, 0.90787, 0.77735, 0.58001, 0.63254, 0.85319, 0.000614, 0.000614, 0.000614
38
+ 37, 0.65155, 0.61381, 0.89808, 0.87331, 0.83067, 0.9219, 0.80274, 0.56332, 0.58385, 0.84322, 0.0005744, 0.0005744, 0.0005744
39
+ 38, 0.65563, 0.62459, 0.89912, 0.85773, 0.80761, 0.91336, 0.7938, 0.56442, 0.61021, 0.84625, 0.0005348, 0.0005348, 0.0005348
40
+ 39, 0.64292, 0.60555, 0.89721, 0.83923, 0.86047, 0.92098, 0.79506, 0.59706, 0.57774, 0.84777, 0.0004952, 0.0004952, 0.0004952
41
+ 40, 0.6388, 0.60608, 0.89712, 0.87514, 0.80019, 0.91632, 0.80112, 0.54977, 0.607, 0.84241, 0.0004556, 0.0004556, 0.0004556
42
+ 41, 0.5722, 0.55974, 0.85795, 0.8318, 0.85732, 0.92228, 0.80937, 0.52397, 0.57227, 0.84328, 0.000416, 0.000416, 0.000416
43
+ 42, 0.53609, 0.53541, 0.84719, 0.88362, 0.81395, 0.92954, 0.82839, 0.50701, 0.56799, 0.84191, 0.0003764, 0.0003764, 0.0003764
44
+ 43, 0.53121, 0.52534, 0.85444, 0.84239, 0.86258, 0.92697, 0.82733, 0.50366, 0.56234, 0.84021, 0.0003368, 0.0003368, 0.0003368
45
+ 44, 0.50666, 0.50216, 0.84394, 0.88095, 0.82919, 0.92988, 0.83175, 0.49124, 0.54708, 0.84343, 0.0002972, 0.0002972, 0.0002972
46
+ 45, 0.50415, 0.49114, 0.84736, 0.88999, 0.83721, 0.92486, 0.8309, 0.49116, 0.5569, 0.83839, 0.0002576, 0.0002576, 0.0002576
47
+ 46, 0.50043, 0.49407, 0.8447, 0.89009, 0.83891, 0.93241, 0.84124, 0.4674, 0.52541, 0.8338, 0.000218, 0.000218, 0.000218
48
+ 47, 0.49015, 0.4799, 0.84134, 0.8769, 0.85841, 0.93473, 0.84741, 0.45828, 0.52244, 0.8325, 0.0001784, 0.0001784, 0.0001784
49
+ 48, 0.48076, 0.46889, 0.83261, 0.86776, 0.84625, 0.93492, 0.84338, 0.46896, 0.51373, 0.83197, 0.0001388, 0.0001388, 0.0001388
50
+ 49, 0.4837, 0.4597, 0.83833, 0.83459, 0.89006, 0.93554, 0.85299, 0.44789, 0.50756, 0.82868, 9.92e-05, 9.92e-05, 9.92e-05
51
+ 50, 0.46173, 0.45624, 0.83252, 0.85594, 0.87931, 0.9361, 0.85494, 0.44175, 0.49379, 0.82807, 5.96e-05, 5.96e-05, 5.96e-05
train/results.png ADDED
train/train_batch0.jpg ADDED
train/train_batch1.jpg ADDED
train/train_batch2.jpg ADDED
train/train_batch3720.jpg ADDED
train/train_batch3721.jpg ADDED
train/train_batch3722.jpg ADDED
train/val_batch0_labels.jpg ADDED
train/val_batch0_pred.jpg ADDED
train/val_batch1_labels.jpg ADDED
train/val_batch1_pred.jpg ADDED
train/val_batch2_labels.jpg ADDED
train/val_batch2_pred.jpg ADDED
train/weights/best.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ba973066ec2dae906b98abe130bfe99fa533f2c2bc5be03c04153e03ee341be
3
+ size 6213603
train/weights/last.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03e3f31dc87a36e81d61aed07ae1a78416760b64629bb26b2830a50b4e8f2771
3
+ size 6213603
yolov8n_fish_trained.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e3d70a04c5a5fc7aa1dce0d0e38d10169d32fe23c9d5314d7f0309be0eb36f3
3
+ size 6230995