The BovisTechNet pipeline (Fig 1) combines wearable-sensor data and multi-region images into a single multimodal feature vector, classifies the fused representation using an ensemble model, validates performance through animal-grouped splitting and deploys the system as a web service with automated alerts.
Animals and sensor-based data collection
Sensor data were collected from 200 Jersey cows on a cattle farm in Karjat, Maharashtra, India using wearable neckbands (Fig 2). The neckbands non-invasively record body temperature (DS18B20), heart rate and blood oxygen saturation (SpO2) (MAX30102) and three-axis acceleration (ADXL345). An ESP32 DevKit V1 microcontroller transmits readings to a cloud platform every 15 s, linked to the cow identity so that every record can be assigned to a single data partition, where the data are stored for processing and analysis. The DS18B20 monitored fever-related change, the MAX30102 provided heart rate and oxygen saturation and the ADXL345 captured activity patterns. The device was powered by a 400-mAh rechargeable battery and is housed in a lightweight PLA enclosure secured by a rubber strap.
Image data collection
Images of five anatomical regions (eye, mouth, hoof, udder and skin) (Fig 3), each showing disease-specific signs for at least one target class, were obtained from two sources, images captured on the study farm and at the Karjat veterinary polyclinic and images from open datasets (
Agarwal, 2022;
Faraz, 2022;
Deenadayalan, 2025; Ganesh73005, 2024) for conditions not present in the herd during data collection. All images were manually reviewed and labelled by disease class. The images were captured from the same animals at the time of the sensor recordings; sensor records and images were therefore linked by timestamps. For each record, one image per anatomical region taken; the training source images were further divided among the four cross-validation folds in. Within each partition, every record slot received a unique image instance, so that no image is used in more than one record. The resulting multimodal dataset comprises 35,206 records from 200 animals with 176,030 unique image instances; images from all sources were used in both the training and the test partition, but no source image was shared between them (Table 1).
Data pre-processing
Sensor readings were pre-processed to remove noise, handle missing values and normalize feature ranges. Implausible values caused by sensor noise or neckband detachment were clipped to valid ranges, missing values were mean-imputed after numeric coercion and all six parameters (temperature, heart rate, SpO
2 and three acceleration axes) were standardized to zero mean and unit variance (Eq. (1)). A scikit-learn Pipeline (Imputer ® standard scaler® classifier) was fitted exclusively on training data within each split and cross-validation fold, with learned imputation and scaling parameters applied unchanged to validation and test data. No categorical encoding was required. The feature order was fixed as [temperature, heart rate, SpO
2, accel-X, accel-Y, accel-Z], followed by 3,840 DINOv2 dimensions.

Here,
x= The original feature value.
μ= The mean of the feature calculated from the training data.
σ= Its standard deviation.
Eq. (1) therefore converts each feature to a standardized scale with zero mean and unit variance, allowing variables with different measurement ranges to be processed consistently by the machine-learning models.
Image feature extraction using DINOv2
Each of the five body-region images was processed using a pretrained DINOv2 ViT-B/14 model on two GPUs. Contrast-limited adaptive histogram equalisation (CLAHE) was applied to eye, mouth, leg, udder and skin images, followed by aspect-ratio-preserving resizing to 518 x 518 pixels and ImageNet normalization. Feature extraction was performed using mixed (fp16) precision, producing a 768-dimensional embedding for each region. The five embeddings were concatenated to form a 3,840-dimensional visual feature vector (Eq. 2) for multimodal fusion and classification, replacing the earlier fixed-resolution feature extractor.
ximg = [feye || fmouth || fhoof || fudder || fskin ] ∈ R5x768 = R3840
Where,
fr∈ R768= The 768-dimensional DINOv2 ViT-B/14 embedding of anatomical region r ∈ {eye, mouth, hoof, udder, skin}.
= Vector concatenation.
ximg= The resulting 3,840-dimensional visual feature vector.
Multimodal feature fusion
The six standardized tabular sensor features and the 3,840-dimensional image feature vector were concatenated into a single fused representation for each animal-observation given by Eq. (3).
x = [xtab || ximg] ∈ R6+3840 = R3846
Where,
x
tab ∈ R
6= The vector of the six standardized sensor features [temperature, heart rate, SpO
2, accel-X, accel-Y, accel-Z] obtained with Eq. (1).
x
img= The visual feature vector from Eq. (2).
x∈R
3846= The fused input vector passed to the ensemble classifier.
Leakage prevention and class balancing
The dataset was partitioned at animal level using GroupShuffleSplit based on cow identity: 140 animals (24,677 records) for training and 60 animals (10,529 records) to independent testing, with zero animal overlap verified. Splitting by animal, rather than by individual record, is important because repeated observations from the same cow are highly correlated; a record-level split would place near-duplicate observations in both training and test sets and inflate performance. Five label-derived indicator columns were removed and a test-set sizing error caused by a redundant validation split was corrected, consequently all reported results use the full 10,529-record test set.
The training set was mildly imbalanced (2,495-2,846 records per class; maximum/minimum ratio 1.14). A custom implementation of the Synthetic Minority Over-sampling Technique (SMOTE; k = 5) was applied to the training partition only, increasing every class to 2,846 records (25,614 in total) without altering the class distribution of the test set, where class counts ranged from 1,066 to 1,282 records. A four-fold cross-validation was performed on the training pool with predefined folds: the 140 training animals were assigned to four folds of 35 animals, each paired only with its own set of source images, so that neither animals nor source images are shared between the training and validation data of any fold; SMOTE was reapplied within each fold.
Ensemble classifier and baselines
BovisTechNet is a seven-member soft-voting ensemble comprising three gradient-boosting learners (XGBoost, LightGBM, CatBoost), two bagging-based tree ensembles (Random Forest, Extra Trees), K-Nearest Neighbours (KNN) and a general Bagging meta-estimator. The ensemble members used the following settings: XGBoost (200 trees, maximum depth 6, learning rate 0.1, row and column subsampling 0.8 and 0.5, L2 penalty 1, GPU-accelerated); LightGBM (200 trees, 31 leaves, learning rate 0.1, minimum 20 samples per leaf, row and column subsampling 0.8 and 0.5, L2 penalty 1); CatBoost (300 iterations, depth 6, learning rate 0.1, L2 leaf regularisation 3, Bernoulli subsampling 0.8, GPU-accelerated); Random Forest (200 trees, maximum depth 16, square-root feature sampling, GPU-accelerated); Extra Trees (200 fully grown trees, square-root feature sampling); KNN (k = 7, GPU-accelerated); and Bagging (10 decision-tree estimators, bootstrap sampling, 70% of features). Each learner produced a probability vector over the nine classes, allowing diverse learning strategies contribute to the final decision while ensuring that no learner received greater influence than another. The prediction is the class with the highest mean probability under equal weights (1/7, about 14.29% each) (Eq. 4). Equal weights were selected to maintain balanced contributions from all seven classifiers and avoid over-reliance on any individual learner. This approach also avoids introducing additional parameters through weight optimisation, which could increase the risk of overfitting, particularly given the limited number of independent animals.
Each base learner was also trained alone on the same SMOTE-balanced data as a baseline (Table 2), using compact, strongly regularised configurations: XGBoost (8 trees, depth 2, L1 and L2 penalties of 80, subsample 0.3); LightGBM (8 trees, depth 2, 3 leaves, penalties of 60); CatBoost (10 trees, depth 3, L2 leaf regularisation 50, GPU-accelerated); Random Forest (20 trees, depth 4, GPU-accelerated); Extra Trees (20 trees, depth 4, minimum leaf size 5); KNN (k = 15, GPU-accelerated) and Bagging (2 estimators, bootstrap sampling, 70% of features). The baselines therefore differ from the ensemble members in model capacity as well as in voting.
ŷ = arg max i ΣM = 1 WmFm (Classi | x) m = 1,…,7
Modality ablation study
Tabular-only features reached 68.93% test accuracy, image-only features reached 92.50% and the fused representation reached 97.25%, confirming image features were the dominant modality while fusion still provided a substantial additional improvement. Sensor data alone performed relatively well for the Healthy class (recall = 0.858) but poorly for lumpy skin disease (0.427) and mastitis (0.568). Image features recover most of this performance gap (0.868 and 0.973, respectively) and fusion increased both above 0.97. Fusion also produced marked gain for the healthy class (0.955 vs 0.717) and bovine keratoconjunctivitis (0.970 vs 0.882) relative to image-only features, whereas recall for BSE, Ringworm and Johne’s disease was similar with and without sensor features (0.963 vs 0.963, 0.956 vs 0.956 and 0.945 vs 0.956) (Fig 4).
Region localisation and deployment
A YOLOv8l-OBB (oriented bounding box) detector was fine-tuned to localise the eye, mouth, hoof, udder and skin regions, which were subsequently cropped and passed to the DINOv2 extractor. Training used 7,600 annotated images, with 558 images reserved for validation (8,158 in total), 640 × 640 inputs, a batch size 16 and up to 50 epochs. Early stopping terminated training at epoch 32 and the epoch-27 checkpoint was retained. The validated ensemble was deployed as a Flask web service with a companion vision service (YOLOv8l-OBB and DINOv2) and a threshold-based alert system notifies farm staff of abnormal sensor readings. Performance was assessed on the held-out test set using accuracy, support-weighted precision, recall and F1-score, ROC-AUC and macro-averaged one-vs-rest specificity and false-positive rate (FPR). Support-weighted recall equals accuracy by construction and the per-class report additionally gives macro averages. Uncertainty in test-set performance was quantified with an animal-level bootstrap (1,000 resamples of the test animals, percentile 95% CIs) and paired differences between feature settings were tested with McNemar’s test on the same test records.