The model’s performance was evaluated over 100 epochs by examining accuracy and loss metrics (Fig 4). Training accuracy began at around 24.1% in the first epoch and increased to about 96.5% by the end. This shows effective learning. Validation accuracy started at approximately 21.7% and peaked at 99.3%, with some fluctuations in later epochs. This indicates that the model learned well but occasionally struggled to generalize.
Training loss decreased consistently from about 1.52 in the first epoch to around 0.16 by the end. This indicates good fitting to the training data. In contrast, validation loss began at approximately 1.96, decreased initially, but became unstable later, peaking around 0.97. Monitoring both training and validation metrics is important. It ensures that the model performs effectively on unseen data and retains the training data.
The model’s classification performance for seven fish disease classes is revealed by the confusion matrix (Fig 5). The projected class is displayed in each column, while the actual class is represented in each row. Proper predictions are indicated by the diagonal elements. For example, Red disease has 10 correct predictions, but 2 were misclassified as Healthy. For Aeromoniasis, there were 12 correct predictions and 2 misclassifications as Gill disease. Gill disease shows 15 correct predictions, with 3 misclassified as Aeromoniasis and 1 as Healthy. The Healthy class had 25 correct predictions and no misclassifications, indicating strong performance in identifying healthy fish. However, Saprolegniasis had 5 misclassifications, suggesting challenges in accurate identification. Parasitic diseases had 11 correct predictions, with 2 misclassified as Healthy. Lastly, White spot disease showed 13 correct predictions, with 5 misclassifications as Healthy and 1 as Aeromoniasis.
The classification metrics offer key insights into the model’s performance for different fish diseases (Table 2). Precision indicates the accuracy of positive predictions. Red Disease and Parasitic Disease achieved perfect precision at 1.0000. In contrast, Healthy had a precision of 0.6250, showing more false positives. Recall measures the ability to identify all relevant instances. Healthy had a perfect recall of 1.0000, correctly identifying all healthy cases. However, Saprolegniasis had a lower recall of 0.7059, indicating some misclassifications. F1 Score balances precision and recall. Red Disease excelled with an F1 score of 0.9091. Healthy scored 0.7692, reflecting challenges in precision despite the high recall. The overall accuracy of the model was 0.8235, showing solid performance. The macro average score was 0.8383, treating all classes equally. The weighted average, considering instance numbers, was slightly lower at 0.8285.
The model’s predictions show strong confidence in its classifications (Fig 6). For healthy fish, it reported a confidence score of 91.12%. This indicates high certainty in identifying healthy specimens. For cases of Aeromoniasis, the model achieved an impressive confidence score of 99.95%. This near-perfect score reflects its ability to accurately identify this disease.
These confidence scores highlight the ability of the model in distinguishing between healthy fish and those affected by Aeromoniasis, suggesting its practical utility. ROC curve and AUC value provide key insights into the model’s performance for each disease category (Fig 7). For Red disease, the AUC is 0.9821, indicating excellent discrimination. Aeromoniasis has an AUC of 0.9833, also showing strong performance. Gill disease achieves a perfect AUC of 1, meaning the model perfectly distinguishes between positive and negative cases. Saprolegniasis scores 0.9833, reflecting strong predictive capability. Healthy fish have an AUC of 0.9875, confirming the model’s effectiveness in identifying healthy specimens. Parasitic disease has a slightly lower AUC of 0.9423, indicating good performance. White spot disease scores 0.9911, showing excellent classification ability. Overall, these AUC values demonstrate the model’s strong capacity to differentiate between various fish conditions. Most categories achieve scores above 0.9.
In contrast, current research on fish disease detection shows a variety of methods and results (Table 3). An automatic fish categorization method utilizing a customized deep residual neural network (DRNN) for small-scale underwater photos was presented by
Sudhakara et al. (2022). Six iterations of the RESNET model were assessed. Layers, iterations, batch size and dropout layers were the main topics of the analysis. Using an untrained benchmark fish dataset, the smaller RESNET model obtained a testing accuracy of 90.26% with a validation loss of 0.0916.
Tamou et al., (2018) presented a technique that uses the CNN- AlexNet with transfer learning to automatically classify fish species. They used the pretrained AlexNet, both with and without fine-tuning, to extract features from foreground fish photos in an underwater dataset. A linear SVM classifier was used for classification. Their strategy worked, as evidenced by the 99.45% accuracy they obtained on the fish recognition ground-truth dataset. A study on fish disease identification in aquaculture using image-based ML algorithms was carried out by
Ahmed et al., (2021). There were two sections to the work. Pre-processing and picture segmentation were used in the initial step to improve and lower noise in the photos. The second section concentrated on employing a Support Vector Machine (SVM) algorithm with a kernel function to extract features for disease classification. A dataset of salmon fish, comprising both augmented and non-augmented photos, was used to test the processed images. With accuracies of 91.42% with image augmentation and 94.12% without augmentation, the findings demonstrated the SVM’s strong performance.
Mia et al., (2022) aimed to improve fish disease recognition to support remote farmers in effective fish farming. Early identification of diseased fish can help prevent the spread of diseases. The study involved an in-depth analysis of expert systems that use smartphone-captured images for disease identification. The authors selected two sets of features and employed a segmentation algorithm to differentiate between diseased and healthy areas. They implemented eight classification algorithms to evaluate performance, achieving a notable accuracy of 88.87% with the Random Forest algorithm.
Rachman et al., (2023) focused on detecting Epizootic Ulcerative Syndrome (EUS), a disease caused by the pathogenic fungus Aphanomyces invadans. The study employed Object Segmentation Inference with MobileNetV2 and image processing techniques. Using HSV thresholding, the researchers identified infected areas on the fish. The object segmentation process distinguished the disease-affected regions from the healthy parts of the fish. The system’s performance was evaluated using the F1 score, achieving an average accuracy of 84% from 80 augmented images. Recent studies highlight diverse approaches in fish disease detection. They showcase different models and methodologies with varying outcomes. This work adds to the field by demonstrating the effectiveness of the ResNet-20 architecture. It achieves competitive accuracy and provides insights into its strengths in identifying various fish diseases.
Application of ResNet-20 model for Co-infection detection
To detect co-infection using the ResNet-20 model, several modifications in dataset preparation, training strategy and classification methods are necessary. Since co-infection involves multiple diseases present in the same fish, a multi-label classification approach must be adopted instead of a traditional single-label classification. This requires modifying the dataset by labeling images with multiple diseases, using sigmoid activation in the output layer instead of softmax and employing binary cross-entropy (BCE) loss to handle multi-label outputs effectively. The BCE loss is given by:
Where,
z
d = Raw output (logit) from the model before applying the sigmoid activation function.
Training should be conducted using labeled co-infection data, with performance evaluation metrics to measure the model’s effectiveness. Post-processing techniques, including probability thresholding and visualization methods like Grad-CAM or SHAP, can help interpret how the model identifies different infection regions in the image. Further enhancements, such as integrating ensemble learning with other CNN models, applying attention mechanisms for improved feature focus and incorporating additional data sources like clinical symptoms and water quality parameters, can improve the accuracy of co-infection detection.
Study limitations
Despite its promising performance, this study has several limitations. The dataset size and diversity may not cover all fish disease variations across species and environments. Expanding the dataset could improve model robustness. The co-infection detection is also limited. The model was trained for single-disease classification and may not detect multiple infections accurately. A multi-label classification approach is needed in future work.
Both aeromoniasis (caused by Aeromonas hydrophila) and epizootic ulcerative syndrome (EUS) (caused by Aphanomyces invadans) exhibit similar external clinical signs. Our model relies on image-based feature extraction, which may not fully distinguish between them. While it shows promise in classification, incorporating histopathological characteristics and causative agent analysis could enhance differentiation. Gill infections often require microscopic examination or histopathological analysis for accurate diagnosis. Since our method is image-based, its ability to detect gill diseases is limited.
The real-world applicability of the model is another challenge. It relies only on image-based classification, but integrating clinical symptoms and environmental factors could improve accuracy. Computational requirements remain a concern. Although ResNet-20 is lightweight, deep learning models still demand significant resources. Optimizing for real-time use is necessary.
Further, generalization to different conditions is an issue. Variations in lighting, image quality and fish positioning can reduce accuracy. A more diverse and real-world dataset is required. Future studies will focus on dataset expansion and advanced architectures like Efficient Net (
Tan and Le, 2019) and Vision Transformers
(Dosovitskiy et al., 2021) to improve performance.