Instructions to use JayRay5/convnext-tiny-224-cyprus-fish-cls with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JayRay5/convnext-tiny-224-cyprus-fish-cls with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="JayRay5/convnext-tiny-224-cyprus-fish-cls") 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("JayRay5/convnext-tiny-224-cyprus-fish-cls") model = AutoModelForImageClassification.from_pretrained("JayRay5/convnext-tiny-224-cyprus-fish-cls", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download README.md from JayRay5/convnext-tiny-224-cyprus-fish-cls: direct link, hf CLI and curl.
- Browser
- Download file 3.46 kB
-
https://huggingface.co/JayRay5/convnext-tiny-224-cyprus-fish-cls/resolve/main/README.md
- Command line
-
hf download hf://JayRay5/convnext-tiny-224-cyprus-fish-cls/README.md
-
curl -L -o README.md https://huggingface.co/JayRay5/convnext-tiny-224-cyprus-fish-cls/resolve/main/README.md
license: mit
datasets:
- JayRay5/cyprus-fish-dataset
model-index:
- name: ConvNeXT-Tiny for Cyprus Fish Recognition
results:
- task:
type: classification
dataset:
type: fish_classification
name: Cyprus Fish Dataset
metrics:
- name: accuracy
type: accuracy
value: 0.95
verified: true
base_model:
- facebook/convnext-tiny-224
tags:
- image-classification
- fish
- cyprus-fish
- vision
- biology
metrics:
- accuracy
library_name: transformers
π 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.
- π» GitHub Repository: cyprus-fish-classifier
- π Live Demo: Hugging Face Space
π 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.