Views
No views yet
google/vit-base-patch16-2241from transformers import AutoImageProcessor, AutoModelForImageClassification
2from PIL import Image
3import torch
4
5processor = AutoImageProcessor.from_pretrained("LaurianeMD/vit-skin-disease")
6model = AutoModelForImageClassification.from_pretrained("LaurianeMD/vit-skin-disease")
7
8image = Image.open("your_image.jpg")
9inputs = processor(images=image, return_tensors="pt")
10
11with torch.no_grad():
12 outputs = model(**inputs)
13 logits = outputs.logits
14 predicted_class_idx = logits.argmax(-1).item()
15
16print("Predicted label:", model.config.id2label[predicted_class_idx])
17
18[More Information Needed]
19
20## Training Details
21
22### Training Data
23
24
25- Dataset used:
26- Kaggle – pacificrm/skindiseasedataset
27- Classes: 22 skin conditions
28- Images were resized to 224 × 224 and normalized.
29
30
31### Training Procedure
32
33- Epochs: 5
34
35- ptimizer: AdamW
36
37- Loss: Cross-entropy
38
39- Activation: GELU
40
41- Precision: fp32
42
43- Hardware: Google Colab (single T4 GPU)
44
45#### Preprocessing [optional]
46- Resize
47
48- CenterCrop
49
50- Normalize (ViT base mean/std)
51
52Optional: RandomFlip, RandomRotation
53
54
55#### Training Hyperparameters
56
57- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
58
59#### Speeds, Sizes, Times [optional]
60
61<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
62
63[More Information Needed]
64
65## Evaluation
66
67<!-- This section describes the evaluation protocols and provides the results. -->
68
69### Testing Data, Factors & Metrics
70
71#### Testing Data
72
73<!-- This should link to a Dataset Card if possible. -->
74
75[More Information Needed]
76
77#### Factors
78
79<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
80
81[More Information Needed]
82
83#### Metrics
84
85<!-- These are the evaluation metrics being used, ideally with a description of why. -->
86| Epoch | Loss | Accuracy |
87| ----- | ------ | ---------- |
88| 1 | 1.4618 | 56.25% |
89| 2 | 0.5954 | 82.90% |
90| 3 | 0.1790 | 95.72% |
91| 4 | 0.0777 | 98.25% |
92| 5 | 0.0613 | **98.49%** |
93
94Final validation accuracy: 98.49%
95
96### Results
97
98[More Information Needed]
99
100#### Summary
101
102
103
104## Model Examination [optional]
105
106<!-- Relevant interpretability work for the model goes here -->
107
108[More Information Needed]
109
110## Environmental Impact
111
112<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
113
114Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
115
116- **Hardware Type:** [More Information Needed]
117- **Hours used:** [More Information Needed]
118- **Cloud Provider:** [More Information Needed]
119- **Compute Region:** [More Information Needed]
120- **Carbon Emitted:** [More Information Needed]
121
122## Technical Specifications [optional]
123
124### Model Architecture and Objective
125
126[More Information Needed]
127
128### Compute Infrastructure
129
130[More Information Needed]
131
132#### Hardware
133
134[More Information Needed]
135
136#### Software
137
138[More Information Needed]
139
140## Citation [optional]
141
142<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
143
144**BibTeX:**
145
146[More Information Needed]
147
148**APA:**
149
150[More Information Needed]
151
152## Glossary [optional]
153
154<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
155
156[More Information Needed]
157
158## More Information [optional]
159
160[More Information Needed]
161
162## Model Card Authors [optional]
163
164Lauriane Mbagdjé Dorenan
165
166## Model Card Contact
167
168For questions or more informations : dmbagdjelauriane@gmail.com