In an article recently published in the journal Scientific Reports, researchers proposed an Internet of Things (IoT) and machine learning (ML)-based approach for effective and accurate behavior analysis of ornamental fish.
Background
Ornamental fishkeeping is one of the most preferred hobbies in the world for reducing stress. The hobby also offers a significant opportunity for income generation and entrepreneurship development. However, controlling the ornamental fish farm environment is a significant challenge as it is impacted by several parameters, including disease occurrences, pH, dissolved oxygen (DO), and water temperature.
Fish farmers can use deep learning (DL) and ML techniques to analyze voluminous data collected from their farms to obtain insights on fish growth patterns, feeding behavior, environmental factors affecting fish health, and predict diseases/stress. Goldfish (Carassius auratus), a popular ornamental fish species, is currently raised in open/flow-through systems. The intense culture of goldfish can be a feasible solution to meet the rising demand for this species.
Goldfish primarily live in still, hypoxic, warm waters with muddy bottoms and lush flora. Although several studies have been performed focusing on predicting water quality parameters using ML models, only a few studies have focused on the behavioral change classification based on DO and water temperature.
The proposed approach
In this study, researchers proposed a simple approach based on IoT and ML to analyze the changes in goldfish behavior due to the alterations in environmental parameters, specifically real-time water temperature and DO concentration. Researchers performed experiments to validate the behavior changes by performing blood parameter analysis.
IoT technology was utilized to collect, gather, and summarize the data/DO and water temperature in real time. Two Bullet Network Camera of model Hikvision DS-2CD206WFWD-I 6 MP IR for behavior record and object detection during the behavior change study. The DO, pH, and water temperature ranges were 3.0–7.0 mg/L, 8.0–8.8 pH, and 28–29 °C, respectively, in this study, except for the duration when the DO and temperature were changed to determine the behavioral changes.
Researchers raised the water temperature from 28 oC to 42 oC by increasing 2 °C per 8 h interval. Decision tree (DT), Naïve Bayes (NB) classifier, linear discriminant analysis (LDA), and K-nearest neighbor (KNN) were used to analyze the behavioral change data. Ten goldfish were selected at a time and their behaviors were recorded in camera with the real-time DO and water temperature data, which were obtained and distributed using IoT sensors.
Researchers used cross-validation and confusion matrices to compare the performance of all four classifiers. Accuracy, precision, recall, and F1-score were calculated, and k-fold cross-validation was used to evaluate the effectiveness of the models.
Significance of the study
During behavior observation, the fish behaved normally from 28 °C to 36 °C and started to respond only after 36 °C. During the temperature rise from 36 to 42 °C, three major behavioral changes were observed, including erratic swimming patterns, resting at the bottom, and gasping, with resting at the bottom behavior between 36 °C and 38 °C, gasping behavior between 38 °C and 40 °C, and erratic swimming behavior between 40 °C and 42 °C.
In the resting condition, the fish was immobile, indicating stress and anxiety in the fish, while all fish were gasping at the water’s surface when the temperature was between 38 °C and 40 °C, indicating high temperatures and low DO levels. During erratic swimming behavior, fast swimming and direction changing while not being attacked were observed among the fish, which indicate higher discomfort, stress, or a pathogenic condition.
DO and water temperature were used as input/independent attributes, while the behavior change was utilized as output/dependent attribute for behavior change classification. 146 instances were recorded when most fish displayed behavior change, and the behavior change data was marked by real-time DO and water temperature. Four classifiers were employed to analyze the collected data.
The cross-validation error of LDA, NB classification, KNN, and DT was 19.86%, 28.08%, 30.14%, and 13.78%, respectively, which demonstrated that DT possessed the lowest misclassification error among the ML models evaluated in this study. KNN demonstrated the highest accuracy among all classifiers in the confusion matrix, while DT made two small errors and had accuracy very close to KNN. These results indicated that DT was the most accurate and effective classifier. Thus, DT was selected to classify the behavioral change data.
Results obtained using the DT classifier displayed that the behavior of fish was rest between temperatures 37.85 °C and 40.535 °C, gasping when the temperature was between 37.85 and 40.535 °C and the DO concentration was less than 6.58 mg/L, and erratic when the temperature was greater than or equal to 40.535 °C. The external behavioral changes of fish were successfully validated with their physiological behavioral changes during the blood parameter analysis.
Journal reference:
- Patro, K. S., Yadav, V. K., Bharti, V. S., Sharma, A., Sharma, A., Senthilkumar, T. (2023). IoT and ML approach for ornamental fish behaviour analysis. Scientific Reports, 13(1), 1-17. https://doi.org/10.1038/s41598-023-48057-w, https://www.nature.com/articles/s41598-023-48057-w
Article Revisions
- Dec 10 2023 - Corrected hyperlink in the Intro para