Instructions to use tta1301/xray-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tta1301/xray-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="tta1301/xray-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("tta1301/xray-classifier") model = AutoModelForImageClassification.from_pretrained("tta1301/xray-classifier") - Notebooks
- Google Colab
- Kaggle
tta1301/xray-vit-classifier-v3
Browse files- README.md +65 -0
- config.json +59 -0
- model.safetensors +3 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: google/vit-base-patch16-224
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
model-index:
|
| 8 |
+
- name: xray-classifier
|
| 9 |
+
results: []
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 13 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 14 |
+
|
| 15 |
+
# xray-classifier
|
| 16 |
+
|
| 17 |
+
This model is a fine-tuned version of [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) on an unknown dataset.
|
| 18 |
+
It achieves the following results on the evaluation set:
|
| 19 |
+
- Loss: 0.0066
|
| 20 |
+
- Auc Macro: nan
|
| 21 |
+
|
| 22 |
+
## Model description
|
| 23 |
+
|
| 24 |
+
More information needed
|
| 25 |
+
|
| 26 |
+
## Intended uses & limitations
|
| 27 |
+
|
| 28 |
+
More information needed
|
| 29 |
+
|
| 30 |
+
## Training and evaluation data
|
| 31 |
+
|
| 32 |
+
More information needed
|
| 33 |
+
|
| 34 |
+
## Training procedure
|
| 35 |
+
|
| 36 |
+
### Training hyperparameters
|
| 37 |
+
|
| 38 |
+
The following hyperparameters were used during training:
|
| 39 |
+
- learning_rate: 2e-05
|
| 40 |
+
- train_batch_size: 32
|
| 41 |
+
- eval_batch_size: 32
|
| 42 |
+
- seed: 42
|
| 43 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 44 |
+
- lr_scheduler_type: linear
|
| 45 |
+
- lr_scheduler_warmup_steps: 0.1
|
| 46 |
+
- num_epochs: 5
|
| 47 |
+
- mixed_precision_training: Native AMP
|
| 48 |
+
|
| 49 |
+
### Training results
|
| 50 |
+
|
| 51 |
+
| Training Loss | Epoch | Step | Validation Loss | Auc Macro |
|
| 52 |
+
|:-------------:|:-----:|:----:|:---------------:|:---------:|
|
| 53 |
+
| 0.0347 | 1.0 | 136 | 0.0178 | nan |
|
| 54 |
+
| 0.0124 | 2.0 | 272 | 0.0108 | nan |
|
| 55 |
+
| 0.0086 | 3.0 | 408 | 0.0081 | nan |
|
| 56 |
+
| 0.0074 | 4.0 | 544 | 0.0069 | nan |
|
| 57 |
+
| 0.0066 | 5.0 | 680 | 0.0065 | nan |
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
### Framework versions
|
| 61 |
+
|
| 62 |
+
- Transformers 5.0.0
|
| 63 |
+
- Pytorch 2.10.0+cu128
|
| 64 |
+
- Datasets 4.0.0
|
| 65 |
+
- Tokenizers 0.22.2
|
config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"ViTForImageClassification"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.0,
|
| 6 |
+
"dtype": "float32",
|
| 7 |
+
"encoder_stride": 16,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.0,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "Atelectasis",
|
| 13 |
+
"1": "Cardiomegaly",
|
| 14 |
+
"2": "Consolidation",
|
| 15 |
+
"3": "Edema",
|
| 16 |
+
"4": "Effusion",
|
| 17 |
+
"5": "Emphysema",
|
| 18 |
+
"6": "Fibrosis",
|
| 19 |
+
"7": "Hernia",
|
| 20 |
+
"8": "Infiltration",
|
| 21 |
+
"9": "Mass",
|
| 22 |
+
"10": "No Finding",
|
| 23 |
+
"11": "Nodule",
|
| 24 |
+
"12": "Pleural_Thickening",
|
| 25 |
+
"13": "Pneumonia",
|
| 26 |
+
"14": "Pneumothorax"
|
| 27 |
+
},
|
| 28 |
+
"image_size": 224,
|
| 29 |
+
"initializer_range": 0.02,
|
| 30 |
+
"intermediate_size": 3072,
|
| 31 |
+
"label2id": {
|
| 32 |
+
"Atelectasis": 0,
|
| 33 |
+
"Cardiomegaly": 1,
|
| 34 |
+
"Consolidation": 2,
|
| 35 |
+
"Edema": 3,
|
| 36 |
+
"Effusion": 4,
|
| 37 |
+
"Emphysema": 5,
|
| 38 |
+
"Fibrosis": 6,
|
| 39 |
+
"Hernia": 7,
|
| 40 |
+
"Infiltration": 8,
|
| 41 |
+
"Mass": 9,
|
| 42 |
+
"No Finding": 10,
|
| 43 |
+
"Nodule": 11,
|
| 44 |
+
"Pleural_Thickening": 12,
|
| 45 |
+
"Pneumonia": 13,
|
| 46 |
+
"Pneumothorax": 14
|
| 47 |
+
},
|
| 48 |
+
"layer_norm_eps": 1e-12,
|
| 49 |
+
"model_type": "vit",
|
| 50 |
+
"num_attention_heads": 12,
|
| 51 |
+
"num_channels": 3,
|
| 52 |
+
"num_hidden_layers": 12,
|
| 53 |
+
"patch_size": 16,
|
| 54 |
+
"pooler_act": "tanh",
|
| 55 |
+
"pooler_output_size": 768,
|
| 56 |
+
"qkv_bias": true,
|
| 57 |
+
"transformers_version": "5.0.0",
|
| 58 |
+
"use_cache": false
|
| 59 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f7cfa110a329aee6254b95b38eeb0b7fe5aaa85b4a9e41834f8754bcc960d5c2
|
| 3 |
+
size 343263964
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:31a3ce2f35a853d005a30bc410de965307151c16e595030918a1f55041d159c8
|
| 3 |
+
size 5201
|