DeiT3 Model (deit3_base_patch16_224)
This repository contains a fine-tuned DeiT3 model from the timm library, intended for binary image classification.
The model weights are available in both standard PyTorch (.bin) and SafeTensors (.safetensors) formats.
Model Details
- Architecture:
deit3_base_patch16_224
- Original Library:
timm
- Fine-tuning Task: Binary Image Classification
- Number of Classes: 2
Training Hyperparameters
The model was trained with the following settings:
| Hyperparameter |
Value |
| Optimizer |
AdamW |
| Learning Rate Schedule |
1e-4 with CosineLRScheduler |
| Batch Size |
128 |
| Total Epochs |
20 |
| Early Stopping Patience |
7 on validation loss |
| Loss Function |
CrossEntropyLoss w/ Label Smoothing (0.1) |
Training Results
Here are the key test metrics for this model:
- Test Accuracy: 0.990
- Test AUC: 0.995
- Test F1 Score: 0.990
- Best Epoch: 14.000
How to use with timm
You can load this model directly from the Hugging Face Hub using timm.create_model. The config.json in this repo provides all necessary metadata.
import torch
import timm
model = timm.create_model(
'hf-hub:parlange/deit3-autoscan',
pretrained=True
)
model.eval()
print(model.default_cfg)
dummy_input = torch.randn(1, 3, model.default_cfg['input_size'][-2], model.default_cfg['input_size'][-1])
with torch.no_grad():
output = model(dummy_input)
print(f"Output shape: {output.shape}")
print(f"Predictions: {torch.softmax(output, dim=1)}")
Original Checkpoint
The original .pth checkpoint file used for this model is also available in this repository.