Image Classification
Transformers
TensorBoard
Safetensors
dinov2
Generated from Trainer
Eval Results (legacy)
Instructions to use LuGot16/spermatogenesis-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LuGot16/spermatogenesis-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="LuGot16/spermatogenesis-classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("LuGot16/spermatogenesis-classifier") model = AutoModelForImageClassification.from_pretrained("LuGot16/spermatogenesis-classifier") - Notebooks
- Google Colab
- Kaggle
DINOv2-base fine-tuned for seminiferous tubule staging
Browse files- README.md +109 -0
- config.json +63 -0
- eval_results.json +14 -0
- model.safetensors +3 -0
- preprocessor_config.json +27 -0
- runs/Apr24_00-33-24_r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p/events.out.tfevents.1776990804.r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p.1372.0 +3 -0
- runs/Apr24_00-35-16_r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p/events.out.tfevents.1776990916.r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p.1425.0 +3 -0
- runs/Apr24_00-35-16_r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p/events.out.tfevents.1777002526.r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p.1425.1 +3 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: facebook/dinov2-base
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
datasets:
|
| 8 |
+
- imagefolder
|
| 9 |
+
metrics:
|
| 10 |
+
- accuracy
|
| 11 |
+
- f1
|
| 12 |
+
model-index:
|
| 13 |
+
- name: spermatogenesis-classifier
|
| 14 |
+
results:
|
| 15 |
+
- task:
|
| 16 |
+
name: Image Classification
|
| 17 |
+
type: image-classification
|
| 18 |
+
dataset:
|
| 19 |
+
name: imagefolder
|
| 20 |
+
type: imagefolder
|
| 21 |
+
config: default
|
| 22 |
+
split: train
|
| 23 |
+
args: default
|
| 24 |
+
metrics:
|
| 25 |
+
- name: Accuracy
|
| 26 |
+
type: accuracy
|
| 27 |
+
value: 0.8910256410256411
|
| 28 |
+
- name: F1
|
| 29 |
+
type: f1
|
| 30 |
+
value: 0.8896300082346593
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 34 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 35 |
+
|
| 36 |
+
# spermatogenesis-classifier
|
| 37 |
+
|
| 38 |
+
This model is a fine-tuned version of [facebook/dinov2-base](https://huggingface.co/facebook/dinov2-base) on the imagefolder dataset.
|
| 39 |
+
It achieves the following results on the evaluation set:
|
| 40 |
+
- Loss: 0.3150
|
| 41 |
+
- Accuracy: 0.8910
|
| 42 |
+
- F1: 0.8896
|
| 43 |
+
- Acc I-iv: 0.8710
|
| 44 |
+
- Acc Ix-x: 0.9048
|
| 45 |
+
- Acc V-vi: 0.8511
|
| 46 |
+
- Acc Vii-vii: 0.9714
|
| 47 |
+
- Acc Xi- xii: 0.8636
|
| 48 |
+
|
| 49 |
+
## Model description
|
| 50 |
+
|
| 51 |
+
More information needed
|
| 52 |
+
|
| 53 |
+
## Intended uses & limitations
|
| 54 |
+
|
| 55 |
+
More information needed
|
| 56 |
+
|
| 57 |
+
## Training and evaluation data
|
| 58 |
+
|
| 59 |
+
More information needed
|
| 60 |
+
|
| 61 |
+
## Training procedure
|
| 62 |
+
|
| 63 |
+
### Training hyperparameters
|
| 64 |
+
|
| 65 |
+
The following hyperparameters were used during training:
|
| 66 |
+
- learning_rate: 2e-05
|
| 67 |
+
- train_batch_size: 16
|
| 68 |
+
- eval_batch_size: 16
|
| 69 |
+
- seed: 42
|
| 70 |
+
- gradient_accumulation_steps: 2
|
| 71 |
+
- total_train_batch_size: 32
|
| 72 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 73 |
+
- lr_scheduler_type: cosine
|
| 74 |
+
- lr_scheduler_warmup_steps: 50
|
| 75 |
+
- num_epochs: 30
|
| 76 |
+
- mixed_precision_training: Native AMP
|
| 77 |
+
|
| 78 |
+
### Training results
|
| 79 |
+
|
| 80 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Acc I-iv | Acc Ix-x | Acc V-vi | Acc Vii-vii | Acc Xi- xii |
|
| 81 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:--------:|:--------:|:--------:|:-----------:|:-----------:|
|
| 82 |
+
| 2.7787 | 1.0 | 20 | 1.2571 | 0.4295 | 0.3860 | 0.0 | 0.4762 | 0.5532 | 0.3143 | 0.9091 |
|
| 83 |
+
| 1.6595 | 2.0 | 40 | 1.5081 | 0.3590 | 0.3372 | 0.0323 | 0.5238 | 0.0426 | 0.5714 | 1.0 |
|
| 84 |
+
| 1.5573 | 3.0 | 60 | 0.8242 | 0.5513 | 0.5636 | 0.3871 | 0.5238 | 0.3830 | 0.6571 | 1.0 |
|
| 85 |
+
| 1.2868 | 4.0 | 80 | 0.7303 | 0.7885 | 0.7570 | 0.5484 | 0.4762 | 0.8723 | 0.9429 | 1.0 |
|
| 86 |
+
| 0.9034 | 5.0 | 100 | 0.4915 | 0.8077 | 0.8036 | 0.7097 | 0.8095 | 0.7660 | 0.8857 | 0.9091 |
|
| 87 |
+
| 1.2132 | 6.0 | 120 | 0.5243 | 0.8013 | 0.7923 | 0.6452 | 0.8095 | 0.9574 | 0.6571 | 0.9091 |
|
| 88 |
+
| 0.8576 | 7.0 | 140 | 0.7115 | 0.7692 | 0.7224 | 0.5806 | 0.2857 | 0.8298 | 1.0 | 1.0 |
|
| 89 |
+
| 0.8557 | 8.0 | 160 | 0.5277 | 0.7692 | 0.7716 | 0.8710 | 0.6667 | 0.5106 | 1.0 | 0.9091 |
|
| 90 |
+
| 0.7294 | 9.0 | 180 | 0.4170 | 0.8333 | 0.8306 | 0.6129 | 0.9048 | 0.8511 | 0.9143 | 0.9091 |
|
| 91 |
+
| 0.6713 | 10.0 | 200 | 0.4585 | 0.8141 | 0.8070 | 0.9032 | 0.9048 | 0.7234 | 0.8571 | 0.7273 |
|
| 92 |
+
| 0.7973 | 11.0 | 220 | 0.4767 | 0.8397 | 0.8241 | 0.7097 | 0.6667 | 0.8936 | 0.8857 | 1.0 |
|
| 93 |
+
| 0.6637 | 12.0 | 240 | 0.4327 | 0.8013 | 0.8057 | 0.9032 | 0.7619 | 0.6170 | 0.9143 | 0.9091 |
|
| 94 |
+
| 0.6284 | 13.0 | 260 | 0.3897 | 0.8462 | 0.8331 | 0.5484 | 0.8571 | 0.9149 | 1.0 | 0.8636 |
|
| 95 |
+
| 0.7981 | 14.0 | 280 | 0.3915 | 0.8654 | 0.8512 | 0.6774 | 0.9524 | 0.9362 | 0.9429 | 0.7727 |
|
| 96 |
+
| 0.5017 | 15.0 | 300 | 0.3150 | 0.8910 | 0.8896 | 0.8710 | 0.9048 | 0.8511 | 0.9714 | 0.8636 |
|
| 97 |
+
| 0.5893 | 16.0 | 320 | 0.3640 | 0.8526 | 0.8485 | 0.8065 | 0.9048 | 0.8298 | 0.9429 | 0.7727 |
|
| 98 |
+
| 0.6591 | 17.0 | 340 | 0.3563 | 0.8718 | 0.8684 | 0.7742 | 0.8571 | 0.8723 | 0.9429 | 0.9091 |
|
| 99 |
+
| 0.4976 | 18.0 | 360 | 0.3648 | 0.8397 | 0.8393 | 0.9355 | 0.8095 | 0.7447 | 0.8857 | 0.8636 |
|
| 100 |
+
| 0.5034 | 19.0 | 380 | 0.3839 | 0.8462 | 0.8389 | 0.6452 | 0.7619 | 0.9149 | 0.9429 | 0.9091 |
|
| 101 |
+
| 0.4612 | 20.0 | 400 | 0.3724 | 0.8654 | 0.8636 | 0.9032 | 0.8571 | 0.8723 | 0.8286 | 0.8636 |
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
### Framework versions
|
| 105 |
+
|
| 106 |
+
- Transformers 5.6.2
|
| 107 |
+
- Pytorch 2.11.0+cu130
|
| 108 |
+
- Datasets 4.8.4
|
| 109 |
+
- Tokenizers 0.22.2
|
config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"apply_layernorm": true,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Dinov2ForImageClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.0,
|
| 7 |
+
"drop_path_rate": 0.0,
|
| 8 |
+
"dtype": "float32",
|
| 9 |
+
"hidden_act": "gelu",
|
| 10 |
+
"hidden_dropout_prob": 0.0,
|
| 11 |
+
"hidden_size": 768,
|
| 12 |
+
"id2label": {
|
| 13 |
+
"0": "I-IV",
|
| 14 |
+
"1": "IX-X",
|
| 15 |
+
"2": "V-VI",
|
| 16 |
+
"3": "VII-VII",
|
| 17 |
+
"4": "XI- XII"
|
| 18 |
+
},
|
| 19 |
+
"image_size": 518,
|
| 20 |
+
"initializer_range": 0.02,
|
| 21 |
+
"label2id": {
|
| 22 |
+
"I-IV": 0,
|
| 23 |
+
"IX-X": 1,
|
| 24 |
+
"V-VI": 2,
|
| 25 |
+
"VII-VII": 3,
|
| 26 |
+
"XI- XII": 4
|
| 27 |
+
},
|
| 28 |
+
"layer_norm_eps": 1e-06,
|
| 29 |
+
"layerscale_value": 1.0,
|
| 30 |
+
"mlp_ratio": 4,
|
| 31 |
+
"model_type": "dinov2",
|
| 32 |
+
"num_attention_heads": 12,
|
| 33 |
+
"num_channels": 3,
|
| 34 |
+
"num_hidden_layers": 12,
|
| 35 |
+
"out_features": [
|
| 36 |
+
"stage12"
|
| 37 |
+
],
|
| 38 |
+
"out_indices": [
|
| 39 |
+
12
|
| 40 |
+
],
|
| 41 |
+
"patch_size": 14,
|
| 42 |
+
"qkv_bias": true,
|
| 43 |
+
"reshape_hidden_states": true,
|
| 44 |
+
"stage_names": [
|
| 45 |
+
"stem",
|
| 46 |
+
"stage1",
|
| 47 |
+
"stage2",
|
| 48 |
+
"stage3",
|
| 49 |
+
"stage4",
|
| 50 |
+
"stage5",
|
| 51 |
+
"stage6",
|
| 52 |
+
"stage7",
|
| 53 |
+
"stage8",
|
| 54 |
+
"stage9",
|
| 55 |
+
"stage10",
|
| 56 |
+
"stage11",
|
| 57 |
+
"stage12"
|
| 58 |
+
],
|
| 59 |
+
"transformers_version": "5.6.2",
|
| 60 |
+
"use_cache": false,
|
| 61 |
+
"use_mask_token": true,
|
| 62 |
+
"use_swiglu_ffn": false
|
| 63 |
+
}
|
eval_results.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eval_loss": 0.3150061070919037,
|
| 3 |
+
"eval_accuracy": 0.8910256410256411,
|
| 4 |
+
"eval_f1": 0.8896300082346593,
|
| 5 |
+
"eval_acc_I-IV": 0.8709677419354839,
|
| 6 |
+
"eval_acc_IX-X": 0.9047619047619048,
|
| 7 |
+
"eval_acc_V-VI": 0.851063829787234,
|
| 8 |
+
"eval_acc_VII-VII": 0.9714285714285714,
|
| 9 |
+
"eval_acc_XI- XII": 0.8636363636363636,
|
| 10 |
+
"eval_runtime": 47.9961,
|
| 11 |
+
"eval_samples_per_second": 3.25,
|
| 12 |
+
"eval_steps_per_second": 0.208,
|
| 13 |
+
"epoch": 20.0
|
| 14 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bea41e8e0e5cc0df97a671da10cf0d93af39ec310397f0aa5f923ebbcda5bf47
|
| 3 |
+
size 346378372
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"crop_size": {
|
| 3 |
+
"height": 224,
|
| 4 |
+
"width": 224
|
| 5 |
+
},
|
| 6 |
+
"do_center_crop": true,
|
| 7 |
+
"do_convert_rgb": true,
|
| 8 |
+
"do_normalize": true,
|
| 9 |
+
"do_rescale": true,
|
| 10 |
+
"do_resize": true,
|
| 11 |
+
"image_mean": [
|
| 12 |
+
0.485,
|
| 13 |
+
0.456,
|
| 14 |
+
0.406
|
| 15 |
+
],
|
| 16 |
+
"image_processor_type": "BitImageProcessor",
|
| 17 |
+
"image_std": [
|
| 18 |
+
0.229,
|
| 19 |
+
0.224,
|
| 20 |
+
0.225
|
| 21 |
+
],
|
| 22 |
+
"resample": 3,
|
| 23 |
+
"rescale_factor": 0.00392156862745098,
|
| 24 |
+
"size": {
|
| 25 |
+
"shortest_edge": 256
|
| 26 |
+
}
|
| 27 |
+
}
|
runs/Apr24_00-33-24_r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p/events.out.tfevents.1776990804.r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p.1372.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02c11348ccc221801a5a688b8c99d6297fca9607ee1e83f3434a5579f4282d8b
|
| 3 |
+
size 4900
|
runs/Apr24_00-35-16_r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p/events.out.tfevents.1776990916.r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p.1425.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:37c776cb6630bbe2572072eb0a53056cf64027b41d39494db569c8b7d7ced712
|
| 3 |
+
size 26481
|
runs/Apr24_00-35-16_r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p/events.out.tfevents.1777002526.r-lugot16-sandbox-4d31a98d-wsln9re9-a5c05-kj65p.1425.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2edfefd3ba8f0effa2faa9a5e409e8f6f996771fe9c30c2edecf19f288bb5498
|
| 3 |
+
size 723
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eac4de32838f02787c991dce069e7b299f4861e39990d5e0e700b4d329ecbde2
|
| 3 |
+
size 5905
|