| --- |
| license: apache-2.0 |
| library_name: timm |
| tags: |
| - image-classification |
| - plant-disease |
| - cocoa |
| - rocm |
| - mi300x |
| - amd |
| base_model: facebook/dinov2-large |
| datasets: |
| - ohagwucollinspatrick/amini-cocoa-contamination-dataset |
| --- |
| |
| # vit_large_patch14_dinov2.lvd142m β Amini Cocoa Contamination (MI300X fine-tune) |
| |
| Fine-tuned **vit_large_patch14_dinov2.lvd142m** on the **Amini cocoa contamination** dataset |
| (3 classes: anthracnose, cssvd, healthy). |
| |
| Trained on a single **AMD Instinct MI300X** using PyTorch + ROCm, as part of the |
| AMD hackathon. This model uses on-the-fly bbox cropping with randomized context-padding |
| to improve robustness against detector imprecision. |
| |
| ## Results |
| |
| | Metric | This model (ViT-L / MI300X) | |
| |---------------------|-------------------------------:| |
| | Test accuracy (TTA) | 0.9284 | |
| | Macro F1 (TTA) | 0.9265 | |
| | Standard acc | 0.9274 | |
| |
| TTA rounds: 10. |
| |
| ## Training |
| |
| - **Backbone:** vit_large_patch14_dinov2.lvd142m |
| - **Precision:** bf16 (native MI300X) |
| - **Optimizer:** AdamW, cosine schedule |
| - **Augmentation:** RandAugment + Mixup/CutMix + Random context-pad [0.0, 0.15] |
|
|
| See `config.yaml` for the full hyperparameter set. |
|
|
| ## Usage |
|
|
| ```python |
| import timm, torch |
| |
| model = timm.create_model( |
| "vit_large_patch14_dinov2.lvd142m", |
| pretrained=False, |
| num_classes=3, |
| img_size=224, |
| ) |
| ckpt = torch.load("best.pt", map_location="cpu", weights_only=False) |
| model.load_state_dict(ckpt["state_dict"]) |
| model.eval() |
| ``` |
|
|
| ## Artifacts |
|
|
| - `best.pt` β model weights + training config |
| - `config.yaml` β hyperparameters used for this run |
| - `classification_report.txt` β per-class precision / recall / F1 |
| - `confusion_matrix.csv` β 3x3 confusion matrix |
| - `metrics.json` β standard + TTA scores |
|
|
| ## Source |
|
|
| Training code: <https://github.com/genyarko/amd-merolav/tree/main/cocoa_amini_finetuning> |
|
|