Paul commited on
Commit
8eb78d4
·
verified ·
1 Parent(s): 05238cd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +39 -6
README.md CHANGED
@@ -1,10 +1,43 @@
1
  ---
 
 
 
2
  tags:
3
- - model_hub_mixin
4
- - pytorch_model_hub_mixin
 
 
5
  ---
6
 
7
- This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
8
- - Code: [More Information Needed]
9
- - Paper: [More Information Needed]
10
- - Docs: [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: mit
3
+ datasets:
4
+ - imageomics/fish-vista
5
  tags:
6
+ - swin
7
+ - swin-transformer
8
+ - fish
9
+ - fish-classification
10
  ---
11
 
12
+ # Swin Transformer for Fish Classification
13
+
14
+ This swin-tiny transformer was trained to classify fish species from the fish-visa dataset. The dataset contains massive imbalance and has varying
15
+ degrees of accuracy depending on the class frequency. I recommend to use this model weights as a baseline for building a classification or segmentation
16
+ model.
17
+
18
+ ## Usage
19
+ Load and use the model :
20
+
21
+ ```python
22
+ import torch
23
+ from PIL import Image
24
+ from transformers import AutoImageProcessor
25
+ from transformers import AutoModel
26
+
27
+ # 1. Load the model and processor from the Hub
28
+ repo_id = "Aelyos/swin-fish-classification"
29
+
30
+ # This downloads the code from the Hub and initializes the classes automatically
31
+ processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True)
32
+ model = AutoModel.from_pretrained(repo_id, trust_remote_code=True, id2label=id2label, label2id=label2id)
33
+ ```
34
+
35
+ ## Training
36
+ The model was trained on 80 epochs on a A10 GPU, first by training the classifier head only for 30 epochs and then by training the entire model for 50 more epochs.
37
+
38
+ ![loss_curve](https://cdn-uploads.huggingface.co/production/uploads/6661f6eeb8e23e099edebafb/N3vKSOhykFIy2cMr6oD-F.png)
39
+
40
+ ## Results
41
+ Following the original fish-vista paper, I computed the accuracy accross bins (ultra rare 2-10, minority 10-100, neutral 100-500, majority 500+).
42
+
43
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/6661f6eeb8e23e099edebafb/ItwMxmZz2J6HhKr7cNLt8.png)