SheepFormers: vision transformer-based sheep breed classification on small datasets for smart farming

Abstract Accurate sheep breed classification is critical for modern livestock management, supporting decisions on breeding, productivity, and profitability in the farming industry. Traditional methods based on visual inspection or body measurements are often subjective, time-consuming, and unsuitable for large-scale operations. To address these challenges, this study proposes SheepFormers, a Vision Transformer (ViT)-based framework for automatic sheep breed identification, specifically designed to operate effectively even with small datasets. A balanced dataset of 1,680 sheep face images representing four breeds was preprocessed and used to evaluate multiple transformer variants, including ViT-Google, ViT-MAE, ViT-VAN, BEiT, ViT-ResNet50, and DiT. Through systematic hyperparameter optimization and ablation studies covering epochs, batch size, learning rate, positional encoding, patch size, data augmentation, and 5-fold cross-validation, the ViT-Google model achieved the best performance with 98.21% validation accuracy and an Area Under the Curve (AUC) of 0.9987, outperforming both traditional CNN architectures and ensemble baselines reported in previous studies. Despite these strong results, the study is limited by the relatively small dataset size and controlled image acquisition conditions, which may affect generalization under diverse real-world farm environments. To ensure practical applicability, the trained model was deployed into a user-friendly mobile application, enabling farmers, buyers, and sellers to classify breeds in real time. These findings demonstrate that Vision Transformers can achieve state-of-the-art performance even with limited agricultural datasets, marking a significant advancement in smart farming technologies and precision livestock management.

Authors

Institutions

Publication Details

Journal
Journal of Electrical Systems and Information Technology
Published
2026-02-19
DOI
https://doi.org/10.1186/s43067-026-00326-0
Primary Topic
Food Supply Chain Traceability
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

SheepFormers: vision transformer-based sheep breed classification on small datasets for smart farming

Galib Muhammad Shahriar Himel, Mijanur Rahaman, Md. Masudul Islam
Journal of Electrical Systems and Information Technology
Food Supply Chain Traceability
article

SheepFormers: vision transformer-based sheep breed classification on small datasets for smart farming

Galib Muhammad Shahriar Himel, Mijanur Rahaman, Md. Masudul Islam
article en

Abstract

Abstract Accurate sheep breed classification is critical for modern livestock management, supporting decisions on breeding, productivity, and profitability in the farming industry. Traditional methods based on visual inspection or body measurements are often subjective, time-consuming, and unsuitable for large-scale operations. To address these challenges, this study proposes SheepFormers, a Vision Transformer (ViT)-based framework for automatic sheep breed identification, specifically designed to operate effectively even with small datasets. A balanced dataset of 1,680 sheep face images representing four breeds was preprocessed and used to evaluate multiple transformer variants, including ViT-Google, ViT-MAE, ViT-VAN, BEiT, ViT-ResNet50, and DiT. Through systematic hyperparameter optimization and ablation studies covering epochs, batch size, learning rate, positional encoding, patch size, data augmentation, and 5-fold cross-validation, the ViT-Google model achieved the best performance with 98.21% validation accuracy and an Area Under the Curve (AUC) of 0.9987, outperforming both traditional CNN architectures and ensemble baselines reported in previous studies. Despite these strong results, the study is limited by the relatively small dataset size and controlled image acquisition conditions, which may affect generalization under diverse real-world farm environments. To ensure practical applicability, the trained model was deployed into a user-friendly mobile application, enabling farmers, buyers, and sellers to classify breeds in real time. These findings demonstrate that Vision Transformers can achieve state-of-the-art performance even with limited agricultural datasets, marking a significant advancement in smart farming technologies and precision livestock management.

Journal of Electrical Systems and Information TechnologyVol. 13(1)
American International University-Bangladesh (BD), Bangladesh University of Business and Technology (BD)
Openalex Percentile: Top 50%
Food Supply Chain Traceability
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.