🐟 Cyprus Fish Classifier (ConvNeXT Tiny)

This model is a fine-tuned version of facebook/convnext-tiny-224 on the Cyprus Fish Dataset. It is designed to classify fish species commonly found in the waters around Cyprus.

This model is part of a complete End-to-End MLOps project including CI/CD, Docker containerization, and a deployed FastAPI application.

πŸ“Š Model Details

  • Model Architecture: ConvNext Tiny (28M parameters)
  • Task: Image Classification (Multi-class)
  • Input Image Size: 224x224 pixels
  • Training Framework: PyTorch & Hugging Face Transformers
  • Finetuning Strategy: Full finetuning of the classification head, backbone frozen

πŸš€ Get Started with the Model

Make sure your transformers>=4.57.3

from transformers import ConvNextImageProcessor,AutoImageProcessor,AutoModelForImageClassification
from PIL import Image

processor = AutoImageProcessor.from_pretrained("JayRay5/convnext-tiny-224-cyprus-fish-cls")
model = AutoModelForImageClassification.from_pretrained("JayRay5/convnext-tiny-224-cyprus-fish-cls")

image = Image.open("path_to_your_image/image.png").convert("RGB")
inputs = (
        processor(images=image, return_tensors="pt").to(model.device).to(model.dtype)
    )

with torch.inference_mode():
        outputs = model(**inputs)

id2label = model.config.id2label
results = {}

for idx, prob in enumerate(probs):
    idx_int = idx
    label_name = id2label[idx_int]

    results[label_name] = float(prob)

print(results)

Training Details

Training Data

Training data can be found at Cyprus Fish Dataset.

Training Procedure

The hyperparameters have been validated using a k-fold validation strategy.
For more details about the training process, refer to the GitHub repository.

Preprocessing

  • Random Horizontal Flip (p=0.5)
  • Random Rotation (Β±15 degrees)
  • Color Jitter (Brightness & Contrast Β±20%)

Training Hyperparameters

  • k_folds: 5
  • batch_size: 32
  • grad_acc: 1
  • epochs: 50
  • lr: 3e-4
  • scheduler: "constant"
  • device: "cuda"
  • fp16: True
  • freeze_backbone: True

Evaluation

Factors

As the test set is small, the evaluation may be biased.

Metrics

Accuracy: 0.95

Out-of-Scope Use

The Cyprus Fish Dataset is a non-exhaustive dataset.

Thus, the model will not be able to classify species that are not in the dataset.

Contact

rayane.bencharef.1@ens.etsmtl.ca

Downloads last month
146
Safetensors
Model size
27.8M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for JayRay5/convnext-tiny-224-cyprus-fish-cls

Finetuned
(55)
this model

Dataset used to train JayRay5/convnext-tiny-224-cyprus-fish-cls

Space using JayRay5/convnext-tiny-224-cyprus-fish-cls 1

Collection including JayRay5/convnext-tiny-224-cyprus-fish-cls

Evaluation results