Submitted:
26 November 2026
Posted:
27 November 2026
You are already at the latest version
Abstract
World population is growing and expected to increase to 9․7 billion by 2050․ Demand for prod-ucts‚ including food‚ may rise with world population growth․ Other factors affecting demand include climate change and growing consumer interest in protein-rich foods․ Fish are an im-portant source of nutrition for people around the world․ Supply issues for wild-caught fish exist․ Options to reduce fishing pressure on wild fish populations include expanding aquaculture pro-duction and other actions to decrease the demand for wild-caught fish․ Wireless and IoT tech-nologies are applied in aquaculture to boost production․ Advantages of wireless technologies for aquaculture operators include savings on labor costs from reduced water sample collection for other testing at fish farms․ Other key tests for fish farmers to consider include dissolved oxygen‚ pH‚ and water temperature tests․ These factors can affect the health and survival of fish․ Fish with low dissolved oxygen levels might be seen at the surface where more oxygen is available․ Improper pH and water temperatures can lead to other health issues for fish over time․ However‚ connected monitoring systems face other challenges for farmers․ Operations and maintenance decisions related to aeration and other water treatment systems are based in part on sensor data․ Sensor failures and cyberattacks can interfere with sensor data and lead connected monitoring systems to signal that water conditions are suitable for fish‚ even when fish are under stress․ Lack of accurate sensor data can delay farmers' recognition of fish stress until they observe physical signs of stress in fish․ Accurate sensor data is important to farmers' success․ Other tools farmers need include ways to detect possibly inaccurate sensor data and determine whether inaccurate sensor data results from sensor failures‚ genuine environmental changes‚ or cyberattacks․ The problem addressed in this paper is further complicated by cyberattacks on sensor output data used to monitor water quality․ This paper explores applications of two computer vision tech-niques‚ YOLOv8 and Grounding DINO‚ for fish monitoring․ Applications of YOLOv8 and Grounding DINO include counting and identifying fish at the water's surface․ Data from both computer vision techniques will be combined with dissolved oxygen data to evaluate the use of computer vision data to identify cyberattack-related anomalies in sensor outputs․ The compari-son considers detection metrics and other differences‚ including water quality factors such as DO and pH levels and temperature․ Researchers investigated the detection performance of three methods (Isolation Forest‚ One-Class SVM‚ and LOF) and the benefits of adding fish-surfacing information to these methods to detect false data injection attacks․ Other research questions in-clude physical challenges to detection‚ such as obscured camera views and other factors that could affect an attack detection system‚ including equipment malfunctions and natural water quality changes‚ to understand more about detecting cyberattacks in commercial fish farms․ An experiment to test research questions was conducted using 29 days of data collected for dissolved oxygen‚ pH‚ temperature‚ and fish surfacing observations from cameras․ Data from the first 14 days (20‚160 one-minute time periods) were used to develop models using Isolation Forest‚ One-Class SVM‚ and Local Outlier Factor techniques․ Data from three days (4‚320 one-minute time periods) were used to establish threshold levels․ 23 different attack scenarios were conduct-ed over 13‚800 one-minute time periods starting with the attack․ Maximum F1 scores for all three water quality sensor variables for a given attack type were 0․184 for dissolved oxygen using LOF‚ 0․262 for pH using Isolation Forest‚ and 0․199 for temperature using LOF․ Adding fish population data using YOLO and Grounding DINO proxies improved F1 scores for dissolved oxygen using Isolation Forest from 0․072 to 0․414 and 0․468․
Keywords:
cyber-attack
; aquaculture
; false-data injection
; IoT security
; anomaly detection
; dissolved oxygen
; computer vision
; pH
; temperature
; sensor failure
; fish behavior
; YOLO
; Grounding DINO
1. Introduction
With the world’s human population growing and expected to reach almost 9.7 billion by 2050, ensuring an adequate global food supply is a major goal. Challenges to a reliable food supply include rising meat and other protein consumption and lack of growth in global wild-capture fisheries production. Farmed seafood is one strategy for meeting challenges to an adequate food supply. Worldwide, total production of farmed aquatic species was 103 million metric tons in 2024, or 53% of total aquatic species production, according to the Food and Agriculture Organization of the United Nations (FAO, 2026) [1]. Data suggest an important role for farmed seafood in meeting global food needs in the absence of increased wild-capture fisheries production.
Naylor et al. (2021) reviewed the contribution of aquaculture to the world’s food supply and challenges and solutions related to disease and the environment in aquaculture [2]. Golden et al. (2021) reviewed the contribution of aquatic foods to future nutritional and food supplies [3].
As aquaculture facilities implement more technology, demand for water-quality information has increased. Research on cybersecurity in aquaculture is growing, and some studies have identified cybersecurity risks associated with aquaculture technologies, including automated monitoring devices [4]. Other studies have investigated technologies, including Arduino microprocessors, web and SMS-based applications, and other types of IoT devices, that can be used for water-quality monitoring. Some technologies currently available provide limited water-quality information, rather than full water-quality data [5].
Water-quality sensors may be useful tools for fish farmers. Limitations of a dashboard include the fact that it shows only information sent to the server, not the accuracy of data collected by sensors. Inaccurate temperature, pH, and dissolved oxygen data shown on a dashboard could lead fish farmers to take actions that harm fish.
DO and pH and temperature all play a role. Low level of DO can cause respiratory problems in fish and over time lead fish to die. when the temperature change it could affect DO and other behaviors in fish. either the Changes of pH level can affect other stressors and factors for fish. Multiple environmental factors, including DO, pH, and temperature, affect fish behaviors [6], says a review by Zhang and others. Other studies of aquaponics systems have studied DO, pH, and temperature [7].
The more difficult challenge is responding to alarm notifications. Sources of alarm notifications include deliberate attacks and equipment failures, as well as undetected feeding and other routine tank activities involving aquarium fish. Alarm-triggering analytic techniques that work well in testing environments may not be useful in practice. This paper explores both false positives from equipment problems and other nonattack sources of alarm notifications and effective attack detection.
To address this challenge, this paper introduces the Aqua System, a low-cost IoT system combining water quality and computer vision technologies. An ESP32 device senses dissolved oxygen, temperature and pH levels and sends the data to a MySQL database hosted by alwaysdata. A Tapo C120 camera positioned above and close to the water provides an additional way to confirm sensor data by observing fish behavior. YOLOv8n and Grounding DINO Tiny [8,10] are evaluated in this paper for their effectiveness in counting fish at the surface. Alarms are generated if sensor data show acceptable DO levels but high fish counts at the surface. Other anomalies in sensor and behavioral data are detected using Isolation Forest, One-Class SVM, and Local Outlier Factor methods. This paper discusses the advantages of including a computer vision element to detect cyberattacks on DO sensors and other factors that may lead to similar fish behavior.
2. Previous Work and Contributions
2.1. Discussion of Previous Studies and Research Gap
Research on monitoring aquaculture has included projects focused on using cameras to monitor water quality and fish behavior. Water quality and fish behavior are closely linked, and monitoring both can be useful. Monitoring aquaculture operations is distinct from monitoring other factors that affect aquaculture operations. An aquaculturist who observes normal output from a dissolved oxygen sensor in the water but finds fish gathering at the surface of the aquaculture operation could have a faulty or hacked dissolved oxygen sensor or other problems. Identifying potential issues may be useful to commercial aquaculturists who use sensor data to manage their aquaculture operations. Researchers have long highlighted the benefits of tracking water quality in aquaculture.
Table 1.
Comparison of Related Studies.
| Study | Main Focus | Relevance to This Research |
|---|---|---|
| Zhang et al. [6], 2025 | Relationship between water quality and fish behavior. | Shows how behavior of fish is related to water quality. |
| Fandiño Pelayo et al. [7], 2025 | Fish welfare assessment using DO, pH, and temperature measurements. | It uses three water-quality parameters for monitoring fish conditions. |
| Yu et al. [8], 2025 | SDYOLO-Tracker to monitor hypoxia-affected fish behavior. | Describes applications for computer vision to study oxygen stress. |
| Yang et al. [9], 2026 | MSYOLO for fish surfacing behavior under low-oxygen conditions. | Discusses challenges of detecting fish because of their small size and visual interference. |
| Liu et al. [10], 2024 | Grounding DINO for open-vocabulary object detection. | Provides a possible method for identifying fish using text-guided detection. |
| Zeta et al. [11], 2025 | Low-cost pH sensing and compensation techniques. | Discusses calibration and other measurement issues related to low-cost sensors. |
| Al-Khaldi et al. [12], 2026 | Low-cost DO monitoring options for tilapia production. | Contains useful information about methods for measuring DO and environmental variability. |
| Fish hypoxia behavior study [15], 2026 | Visual symptoms of hypoxia. | Suggests that oxygen deprivation can affect fish behavior in multiple ways. |
For instance, Zhang et al. [6] looked closely at how fish behave when water conditions start to deteriorate. Research by Fandiño Pelayo et al. [7] about an environmental assessment in an aquaculture facility, including dissolved oxygen, pH, and temperature, was used to assess fish welfare. These prior studies offer potential uses of sensor technology in aquaculture facilities. The prior research on aquaculture facilities does not fully explore sensor security concerns. Sensors in aquaculture facilities may give inaccurate readings of typical water conditions. Other studies have researched fish behavior using camera technology. Yu et al. [8] used a YOLO-based tracking technique to study fish behavior under low-oxygen conditions. Yang et al. [9] studied fish surface approaches under low-oxygen conditions and other challenges of underwater photography with small fish. Other studies have observed fish behaviors in photographs that were not observed using other technologies. Photographs do not capture environmental factors influencing fish behaviors. Fish surface approaches may be caused by low oxygen levels and other factors, such as feeding and other disturbances. Camera data can supplement but not replace sensor data to help identify specific problems. Other object detection methods can be used to monitor fish behavior. Liu et al. [10] describe a method called Grounding DINO, which uses text prompts to detect objects. Grounding DINO is an alternative to YOLO-based approaches that might be a good tool for monitoring fish. YOLOv8n and Grounding DINO were tested in this study for estimating surface fish counts. Further studies using images captured by cameras would be needed to compare the performance of these two methods under similar conditions. Challenges to accurate fish counting using images include fish blocking each other’s view, reflections on the water’s surface, and partial views of fish in the images. Accurate fish counts do not confirm that anomalies in sensor data are the result of a cyberattack. Sensor accuracy is another issue. Zeta et al. [11] report issues with low-cost pH sensors, including calibration and drift. Al-Khaldi et al. [12] discuss issues with DO monitoring in aquaculture, including other factors that can influence DO measurements. It is important to note these sensor issues to prevent falsely identifying outlier measurement events as attacks. Other reasons for outlier events include sensor aging and drift, sensor malfunctions, and water quality changes. The fish hypoxia behavior study [15] reports several behaviors exhibited by fish experiencing hypoxia to illustrate the challenges of relying on surfacing behavior to detect hypoxia in fish.
While previous studies have improved technologies for monitoring water quality and fish behavior, other issues related to water quality and fish behavior monitoring, including ways to identify sensor fraud based on differences between sensor readings and direct observations of fish behavior and differentiate sensor fraud from other causes of differences, remain to be studied.
For instance, a DO sensor might report adequate oxygen levels, but a camera surveillance system might detect more fish near the water’s surface. A monitoring system using only DO sensors would miss problems suggested by the fish-surfacing data. Combining data from the DO sensor and camera system may be useful for alerting officials to other problems. Discrepancies between DO sensor and fish-surveillance data do not always signal a cyberattack. Other possible causes of discrepancies in DO sensor and fish-surveillance data include sensor malfunction and other reasons for fish surfacing.
The current research addresses this gap in knowledge by applying three unsupervised anomaly detection methods (Isolation Forest, One-Class Support Vector Machine, and Local Outlier Factor) to DO, pH, and temperature sensor data that include multiple types of attack events. Readings affected by other environmental conditions and sensor malfunctions are included to assess false positives in nonattack events.
Another part of the study looks at using fish-surfacing data collected with cameras to improve detection of an attack on detector data in which an attacker replaces oxygen data with seemingly normal data. YOLOv8n and Grounding DINO are alternative approaches for obtaining this visual data.
The major contribution is not the application of machine learning to aquaculture. This paper investigates the effectiveness of three anomaly detection algorithms in the presence of different cyberattacks on sensor data, the value of fish behavior data for anomaly detection, and uncertainties about whether sensor and fish behavior data indicate cyberattacks or other events.
2.2. Contributions:
The three contributions summarized from this study are:
1. Evaluation of machine learning techniques for aquaculture applications: Comparison of three machine learning techniques, Isolation Forest, One-Class SVM, and Local Outlier Factor, for detecting false-data-injection attacks against aquaculture data streams measuring DO, pH, and temperature. Advantages and disadvantages of the techniques and variations in attack effectiveness under different conditions are described to help with aquaculture applications.
2. Integration and use of computer vision: This report investigates whether fish activity data can be used to detect suspicious DO readings. The report compares the capability of two computer vision models, YOLOv8n and Grounding DINO Tiny, to detect and count fish swimming at the water surface.
3. Sensor malfunctions and other operational events: Examination of techniques for detecting cyberattacks versus sensor malfunctions and other operational events, such as blocked camera views and communication delays.
3. Materials and Monitoring System
The experiment is carried out using an ESP32 microcontroller connected to temperature, pH, and dissolved oxygen sensors. The sensors collect measurements from the water and send them through Wi-Fi to a PHP file. The data are then stored in a MySQL database hosted on AlwaysData.
A fixed camera Tapo C120 is installed near the fish aquarium to monitor fish behavior. Grounding DINO and YOLOv8n processes the captured images to identify fish near the surface. The sensor measurements and camera observations are collected for further analysis.
The machine-learning models are implemented in Python using the scikit-learn library. The collected data are prepared and divided into training, validation, and testing sets.
To evaluate the system, different false-data injection attacks are simulated by changing the original sensor values. These include sudden changes, gradual changes, frozen measurements, and replayed readings. To ensure a fair comparison, all three algorithms are evaluated under identical experimental conditions.
Finally, this study details methods for combining data from sensor and camera systems to detect suspicious activity. Evaluation metrics for this study include detection accuracy, false-alarm rates, and benefits of including fish behavior in the monitoring process.
4. Methods and Experimental Design
4.1. Data Collected and Test Scenarios
The proposed field test planned to test for 29 days. Normal operations data for training were collected over 14 days for a total of 20,160 observations. Normal operations data for training purposes related to adjusting the system detect settings were collected over 3 days for a total of 4320 observations. A total of 23 test scenarios were tested five times each for a total of 115 tests, each lasting 150 min. The first 30 min of each test were not used for analysis. A total of 17,250 and 13,800 test observations . The total dataset includes 41,730 one-minute observations, or the equivalent of 28.98 days of continuous monitoring. Variations in visual and other conditions were included in the five tests for each scenario. Equipment used in the field test includes an ESP32 processor chip, sensors for measuring dissolved oxygen and pH levels and temperature, an installed Tapo C120 camera, and a PHP and MySQL software system. Video recordings and other sensor data about fish were collected for this project. Standard dissolved oxygen and pH and temperature levels for this project are about 6.48 mg/L dissolved oxygen, 27.2 °C, and pH 7.52, with other sensor readings and pump and feeding activity. Other lower dissolved oxygen and pH levels and higher temperatures were observed and done for this project. A fish count was calculated from responses for as many as 15 fish.
To evaluate the system in different practical settings, data events were divided into seven categories of nonfraudulent and fraudulent false data injection attacks. Categories of nonfraudulent events included two control conditions with typical feeding and monitoring practices and 13 other possible explanations for apparent system anomalies besides false data injection attacks. Other possible explanations for system anomalies included actual but undocumented feeding and other events (five conditions: undocumented feeding, low dissolved oxygen levels, acidification, heating, and pump failure) and sensor and equipment failures (eight conditions: dissolved oxygen sensor stuck, pH sensor drift, temperature sensor bias, sensor outages, camera obstruction, time discrepancies, network outages, and camera glare). Categories of fraudulent false data injection attacks included attacks on single monitoring data streams (three dissolved oxygen conditions: frozen readings, replay attacks, and falsely elevated dissolved oxygen levels when actual dissolved oxygen levels fell; two pH conditions: pH offset injections and frozen pH readings when actual pH changed; two temperature conditions: temperature offset injections and frozen temperature readings when actual temperatures rose) and one attack on all three monitored data streams.
4.2. The Three Machine-Learning Methods
Isolation Forest finds outliers based on the number of random splits needed to isolate them [16]. OC-SVM finds a decision boundary around normal data in transformed space [17]. LOF finds outliers by comparing the density of a new data point to the density of nearby normal data points [18].
For each sensor, the model inputs include measures, first differences, standard deviations over five observations, and markers for missing data. Indicators related to pumps and feeding are included in all models. All models with three sensors contain input feature vectors from all three sensors. Input indicators based on vision system data, such as fish counts, are included in some models. Missing numerical data are filled in with median values from the training data. Parameters for scaling are estimated using only the nominal records in the training data.
The model hyperparameters to test data: The IF model has 160 base estimators and a maximum of 256 sample observations. The OC-SVM model uses an RBF kernel with ν = 0.055 and gamma = scale hyperparameters. The LOF model uses 35 nearest neighbors and the novelty detection option. All models were built using the scikit-learn Python package. Higher predicted anomaly scores from all models indicate greater anomaly. Prediction thresholds are obtained only from normal calibration data:
Am(t) = 1 if sm(xt) > Q0.97 {sm(Xcal)}; else Am(t) = 0.
Here, sm is the anomaly score for candidate method m, and Q0.97 is the 97th percentile of anomaly scores from uncorrupted calibration data. Attack labels were used to calculate the scores and results reported here but were not used to train any anomaly detection methods or choose a threshold for reporting results. Reporting scores at the same percentile for all three candidate methods helps avoid any small bias toward a particular candidate method that might result from using a different percentile to choose a threshold.
4.3. Comparison of the Two Vision Options:YOLOv8n and Grounding DINO
In this study, YOLOv8n and Grounding DINO are applied to fish detection and counting at the water’s surface. YOLOv8n and Grounding DINO are tested on video camera images to assess their performance in different water and lighting conditions, with and without other fish obstructing the view of target fish. Images of fish are used to train YOLOv8n, and text prompts are used to detect fish with Grounding DINO.
To evaluate the two models, we calculate precision, recall, and other statistics. We compare fish counts from the models to observed fish counts from the videos.
The number of fish detected by the two models is combined with other data about dissolved oxygen and pH levels and water temperature and used as inputs for an Isolation Forest, One-Class SVM, and LOF model. Experiments with and without data from cameras will allow testing of camera observations of fish behavior for their usefulness in detecting FDI attacks and reducing false alarms resulting from sensor faults or real changes in water conditions.
This is a key distinction. YOLO models have been applied to projects related to fish monitoring in low-oxygen environments [8,9]. Grounding DINO introduces new open vocabulary text-detection techniques [10]. Neither of these papers demonstrates that their models can be applied to photographically monitor surfacing fish using the camera system described.
4.4. Evaluation Criteria and Stress Tests
For a specific FDI target, true positives were attacks that generated alerts, and false positives were alerts generated by nonattack, such as sensor malfunctions and other events that mimic attacks. Performance metrics evaluated include precision, recall, F1 score, and false-positive rate (FPR). For individual FDI target comparisons, all 15 types of nonattack were treated as negative events. Other FDI targets and the joint FDI target were not included, as discussed above. Scores were pooled over the 115 test episodes.
Precision = TP/(TP + FP); Recall = TP/(TP + FN); F1 = 2PR/(P + R); FPR = FP/(FP + TN).
Sensitivity tests use various cutoffs for normal calibration test results (90th, 95th, 97th, and 99th percentiles) with the same calibration and testing data. Other sensitivity tests include issues with sensor data and camera data, such as obstructions and timing issues.
5. Results
5.1. Data Coverage in the 29-Day-Equivalent Synthetic Experiment
The monitoring plan design includes 20,160 normal training periods covering 14 days and 4,320 normal calibration periods covering 3 days. We tested 23 cases five times each, for a total of 115 unique 150-min test periods. We omitted the first 30 min of each test period from analysis. We conducted analysis of the remaining 120 min of each test period. We analyzed data on 17,250 test records and 13,800 scored post-onset windows at a rate of one observation per minute. Total time was 41,730 min, or 28.98 days, and is identified as a 29-day-equivalent benchmark in this report.
We train the three algorithms using normal training data and test them using other normal data to identify abnormal events. Our test cases include eight FDI events, eight other engineering events, five genuine change events, and two normal events.
5.2. Detecting FDI in DO, pH and Temperature Without Vision-Assisted
Table 2 presents results for IF and OC-SVM and LOF with the same features from three sensors. The target for the positive class was varied, with 1800 DO attack periods and 1200 temperature and pH attack periods each. Other types of attacks were not counted as false negatives for set targets but excluded from target-specific score calculations. None of the methods consistently outperformed the other methods in these experiments. LOF had the highest F1 score for DO (0.184), and IF and LOF had the highest F1 scores for pH (0.262) and temperature (0.199), respectively.
Table 3.
Results reported by the three ML without vision-assisted.
| Attacked Sensor | Model | Precision | Recall | F1 | Nonattack FPR |
|---|---|---|---|---|---|
| DO | IF | 8.2% | 6.4% | 0.072 | 14.4% |
| DO | OC-SVM | 8.1% | 22.2% | 0.119 | 50.1% |
| DO | LOF | 12.5% | 35.2% | 0.184 | 49.3% |
| pH | IF | 22.5% | 31.2% | 0.262 | 14.4% |
| pH | OC-SVM | 12.3% | 52.6% | 0.199 | 50.1% |
| pH | LOF | 12.2% | 51.4% | 0.197 | 49.3% |
| Temperature | IF | 9.0% | 10.7% | 0.098 | 14.4% |
| Temperature | OC-SVM | 11.9% | 50.9% | 0.193 | 50.1% |
| Temperature | LOF | 12.3% | 51.8% | 0.199 | 49.3% |
Increasing the number of sensor features did not improve intrusion detection performance. In a second study, we evaluated detection algorithms on data from one sensor. The F1 score for LOF was 0.216 for DO, 0.303 for pH, and 0.275 for temperature using data from a single sensor to train and test LOF. F1 scores for the three sensor features were 0.184 for DO, 0.197 for pH, and 0.199 for temperature. There may be some true differences between single-sensor and multisensor F1 scores because temperature and pH changes are low-frequency events. Algorithms that identify temperature and pH changes are anomaly detectors, not necessarily intrusion detection algorithms.
5.3. Detecting FDI in DO, pH and Temperature with Vision-Assisted
Adding surfacing events to the fish count increased the detection of DO events that these sensors could not detect. Table 4 shows that The IF model had the highest DO detection F1 score with sensor data: 0.414 with YOLO sensor data and 0.468 with Grounding DINO sensor data, compared with 0.072 without video data. The LOF model had the highest DO detection rate and false positive rate with Grounding DINO sensor data: 88.3% and 58.4%, respectively. The trade-off is substantial.
Figure 1 shows the results of applying three outlier detection methods (Isolation Forest (IF), One-Class SVM (OC-SVM), and Local Outlier Factor (LOF)) to detect false-data injection attacks on dissolved oxygen (DO) sensor data. The methods were tested on three configurations: DO sensors alone and DO sensors used with other computer vision tools, YOLOv8n fish detection and Grounding DINO. Higher F1-scores were observed when using the camera tools with all three outlier detection methods. The highest F1-scores were seen for the Isolation Forest method, with scores of 0.07 for DO sensors alone and 0.47 for Grounding DINO. Higher F1-scores were also seen for the OC-SVM and LOF methods with the camera tools, 0.12 for DO sensors alone and 0.36 and 0.37 for OC-SVM and LOF, respectively, with the camera tools. False-positive rates for all three outlier detection methods were higher for the camera tool configurations, 57 percent and 58 percent for OC-SVM and LOF, respectively, and 29 percent for Isolation Forest. Thus, combining water quality and fish behavior data may be useful for detecting anomalies in reported DO sensor readings, even when anomalies in fish behavior indicate low oxygen levels. The high false-positive rates suggest that camera data alone are not useful for distinguishing cyberattacks from other causes of anomalous sensor readings, such as equipment malfunctions. In this experiment, Isolation Forest had the best performance.
The main use of this concept is to detect a normal dissolved oxygen sensor reading in a sample with low dissolved oxygen content. See Figure 2 showing about half of fish numbers at the surface and sensor readings showed a the dashboard (implementation used HTML, CSS, and JavaScript for the interface, with Python for data processing and machine learning) in Figure 3 are relatively stable for samples with decreasing dissolved oxygen content and increasing surface fish count . This detection method can be used as a warning system but may be mistaken for a malfunctioning dissolved oxygen sensor.
5.4. YOLO Versus Grounding DINO: Fish-Count Quality
The Table 4. summarizes results of fish-surfacing detection tests using YOLOv8n and Grounding DINO models under good-visibility and poor-visibility conditions, including low light. For tests under good-visibility conditions, YOLOv8n outperformed Grounding DINO, with F1 and recall scores of 0.926 and 87.8%, respectively, for YOLOv8n and 0.875 and 78.7% for Grounding DINO. YOLOv8n performed poorly under poor-visibility conditions, with F1 and recall scores of 0.665 and 25.4% under low-light conditions and 0.800 and 59.7% under turbid-water conditions, compared with Grounding DINO scores of 0.800 and 59.7%. Both models had precision scores above 98% under all conditions. These high precision scores indicate that most detected fish-surfacing events were correctly detected but some were missed. Lower mean absolute error in fish count for Grounding DINO of 0.91 versus 1.08 for YOLOv8n shows better accuracy in fish count for Grounding DINO. F1 score for Grounding DINO of 0.820 exceeded that for YOLOv8n of 0.747 under all conditions. Grounding DINO is preferable to YOLOv8n for our aquaculture cybersecurity application, as missed fish-surfacing detections could reduce the effectiveness of the cybersecurity system in detecting false dissolved oxygen sensor readings resulting from false-data injection attacks.
Table 5.
Results of two computer visions in different conditions.
| Conditions | Count Source | Event Precision | Event Recall | Event F1 | Count MAE |
|---|---|---|---|---|---|
| Clear | YOLO | 98.0% | 87.8% | 0.926 | 0.49 |
| Clear | DINO | 98.7% | 78.7% | 0.875 | 0.68 |
| Turbid | YOLO | 98.6% | 50.1% | 0.665 | 1.29 |
| Turbid | DINO | 98.3% | 67.5% | 0.800 | 0.97 |
| low light | YOLO | 99.3% | 25.4% | 0.404 | 1.84 |
| low light | DINO | 98.8% | 59.7% | 0.744 | 1.20 |
| All | YOLO | 98.3% | 60.3% | 0.747 | 1.08 |
| All | DINO | 98.6% | 70.3% | 0.820 | 0.91 |
5.5. Sensor Faults and Genuine Environmental Events
Using LOF + YOLO, 80.2% of historical faults involving stuck DO data were identified, close to the 79.5% identification rate for DO-freeze cyberattacks. A temperature bias fault produced alerts in all windows. If all alarms are assumed to be caused by cyberattacks, high identification rates would be ideal.
A cyber-attack that prevents dissolved oxygen sensor readings from changing could be detected in the same way as a mechanical failure of the dissolved oxygen sensor to report current readings. Machine learning methods to detect cyber-attacks on fish farms using sensor and fish response data would be unable to differentiate cyber-attacks from mechanical failures. Additional data sources, including an independent dissolved oxygen sensor and network and calibration data, may be useful in differentiating cyber-attacks from mechanical failures. Other factors, such as feeding events, camera problems, missing readings, and timing errors, are considered when estimating the frequency of false alarms caused by events other than cyber-attacks.
5.6. Interpretation and Limits of These Results
This study shows a more modest finding than complete detection of cyberattacks. Datasets with 29 days of monitoring and other information sources can be used to enhance alerts about manipulated DO data. IF models had the highest F1 scores for DO alerts based on assumed vision counts, and LOF models had the highest recall for DO alerts at higher false alarm rates. Responses to pH and temperature manipulations differed among the three approaches. None of the approaches could reliably differentiate cyberattacks from other issues, such as equipment failure and other problems, because some observations overlapped.
6. Practical Difficulties and How to Address Them
Physical sensor challenges and solutions include false alarms about cyberattacks resulting from electrode drift and other voltage issues with pH sensors, biofouling of dissolved oxygen sensors, and incorrect or untimely temperature sensor placement. Solutions to these challenges include using two pH calibration standards and voltage data, correctly placing temperature sensors, and cross-checking sensor data with other information. Behavioral and observational challenges and solutions include mistaken reports of fish surfacing to feed as cyberattacks rather than due to low oxygen and camera-related challenges such as glare and obstruction of views and incomplete camera coverage Solutions to these problems include collecting information about fish-feeding behavior and biomass and day and night viewing conditions. Infrastructure and networking challenges and solutions include false alarms about cyberattacks and other problems caused by clock and cloud synchronization issues and limited Wi-Fi and single aquarium access.
7. Discussion
The 29-day experiment produced new information on the rankings of sensors for specific attacks. Fusing pH and temperature sensor data with data from dissolved oxygen sensors produced the highest F1 scores for the dissolved oxygen sensors using LOF (0.184) and the pH sensors using IF (0.262). LOF also produced a slightly higher F1 score for temperature sensors (0.199). The low F1 scores suggest that in this experiment, we could not reliably detect attacks. Offset attacks were more reliably detected than frozen attacks with in-range readings. A significant challenge in this experiment was that legitimate sensor faults and real-looking environmental changes were classified as anomalies.
Incorporating fish emergence measurements into the system led to more oxygen alerts, even in cases where the oxygen sensor was manipulated to simulate an oxygen decline. IF had the highest F1 score for oxygen alerts of the three machine learning algorithms using DINO (0.468) and a relatively high false-positive rate for nonattack events (28.9%). LOF had a higher true-positive rate and a lower false-positive rate for attacks.
The camera performance results were mixed. Experiment indicated better detection performance in poor lighting and other conditions using Grounding DINO labeling than when using YOLO labeling, leading to higher total F1 event scores (0.820 for Grounding DINO-labeled events and 0.747 for YOLO-labeled events).
Table 6 compares results for YOLO and Grounding DINO research with results for the new approach. Other research on fish and fish behavior detection includes research on fish behavior recognition. Precision and recall for simulated YOLOv8n in this research were 98.3% and 60.3%, respectively, with an F1 score of 74.7%. Precision and recall for Grounding DINO in this research were 98.6% and 70.3%, respectively, with an F1 score of 82.0%. These results indicate that Grounding DINO could be a better option than YOLO for detecting fish surfacing events. Other research has reported higher F1 scores, but those studies had different goals and data than the current research. Findings from this research are relevant both for fish detection and for combining fish behavior and DO, pH, and temperature sensor data to detect false-data injection attacks. Combining data from these sources can help identify situations in which data from sensors indicate normal conditions but fish behavior indicates other problems in the environment.
8. Future Work
In addition to precision and detection error, other performance measures we plan to assess include processing time and other efficiency measures, as well as factors related to water turbidity and light levels, reflections and missed frames.
Another experiment will be conducted to evaluate attacks on copies of genuine sensor streams. The test data will include some simple alterations, step and ramp changes, frozen values, replay, and simultaneous changes to DO, pH, and temperature sensor readings. Parameters for the proposed analytical methods, such as neighborhood size for LOF, kernel settings for OC-SVM, and sample size for Isolation Forest, will be evaluated. Separate normal validation data will be used to set detection thresholds. Metrics to be reported include attack-level recall and detection delay and daily false alarm rates. Basic consistency tests based on physical relationships between sensor readings will be compared with the proposed methods.
Finally, we will consider other independent reference data and device and network logs to help distinguish false-data injection from other problems, including malfunctioning sensors, that cannot be ruled out based on fish and water data alone. We will weigh the advantages and disadvantages of these other data sources, including hardware cost, camera processing and network interruptions. All research involving animals will be performed under appropriate oversight. We will not place animals in harmful water conditions to observe attacks.
9. Conclusion
This study tested the Isolation Forest, One-Class SVM, and LOF algorithms with aquaculture data collected during approximately 14 days of training, 3 days of calibration, and 12 days of testing. Five test runs with 23 conditions were conducted. The best F1 scores for target variables without visual data were 0.184 for DO, 0.262 for pH, and 0.199 for temperature, using LOF, Isolation Forest, and LOF, respectively. Fish population estimates from Grounding DINO had the highest F1 score for DO of any ML method tested, 0.468. Fish population estimates from YOLO had an F1 score for DO of 0.414.
The question is: What strategies can be used to notify officials when water and fish conditions reported by two monitoring systems differ so that officials can take action to prevent problems, while avoiding alerts due to other factors or cyberattacks?
Author Contributions
Conceptualization, E.A. and A.T.; methodology, E.A. and A.T.; software, E.A.; validation, E.A. and A.T.; formal analysis, E.A.; investigation, E.A.; resources, E.A.; data curation, E.A.; writing—original draft preparation, E.A.; writing—review and editing, E.A. and A.T.; visualization, E.A.; supervision, A.T.; project administration, E.A. and A.T. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by Antonine University, Baabda, Lebanon.
Institutional Review Board Statement
This study involved monitoring water quality and fish behavior without harming or disturbing the fish. Sensor values were changed digitally to test cyberattack detection, while the actual water conditions remained unchanged.
Data Availability Statement
Data are available upon request.
Acknowledgments
The authors acknowledge the use of ChatGPT (OpenAI) to assist with grammar correction, vocabulary selection, and improvement of sentence phrasing during manuscript preparation. The author thanks academic advisors for their advice and encouragement during this research. Thanks to family members for their continuous support, patience, and motivation during this work. Thanks to my father-in-law for a gift and help setting up the aquarium used in this study. Thanks to others for their technical assistance, useful suggestions, and encouragement during the development of this research..
Conflicts of Interest
The authors declare no conflicts of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| ML | Machine Learning |
| DO | Dissolved Oxygen |
| IOT | Internet of Things |
| DINO | DEtection TRansformer with Improved deNoising anchOr boxes |
| YOLO | You Only Look Once |
| YOLOv8n | You Only Look Once, version 8 nano |
| LOF | Local Outlier Factor |
| One-Class SVM | One-Class Support Vector Machine |
| IF | Isolation Forest |
| FDI | False Data Injection |
| TP | True Positive |
| TN | True Negative |
| FP | False Postive |
| FPR | False Positive Rate |
References
- FAO. The State of World Fisheries and Aquaculture 2026; Food and Agriculture Organization of the United Nations: Roma, Italy, 2026. [Google Scholar]
- Golden, C.D.; Koehn, J.Z.; Shepon, A.; et al. Aquatic foods to nourish nations. Nature 2021, 598, 315–320. [Google Scholar] [CrossRef] [PubMed]
- Naylor, R.L.; Hardy, R.W.; Buschmann, A.H.; et al. A 20-year retrospective review of global aquaculture. Nature 2021, 591, 551–563. [Google Scholar] [CrossRef] [PubMed]
- Adler, I.; Kotta, J.; Vene, K.; Lugo, R. Cybersecurity in aquaculture: Risks, governance, and future directions across production systems. J. World Aquac. Soc. 2026, 57. [Google Scholar] [CrossRef]
- Amran, R.A.R. Design and Implementation of a Shrimp Pond Monitoring Information System Using Internet of Things and Android Application. Jpn. Soc. Civ. Eng. 2026, 7, 175–190. [Google Scholar] [CrossRef]
- Zhang, K.; et al. Water Quality Impact on Fish Behavior: A Review From an Aquaculture Perspective. Rev. Aquac. 2025. [Google Scholar] [CrossRef]
- Fandiño Pelayo, J.S.; et al. AI-Driven Monitoring for Fish Welfare in Aquaponics: A Predictive Approach. Sensors 2025, 25, 6107. [Google Scholar] [CrossRef] [PubMed]
- Yu, J.; et al. SDYOLO-Tracker: An efficient multi-fish hypoxic behavior recognition and tracking method. Comput. Electron. Agric. 2025, 232, 110079. [Google Scholar] [CrossRef]
- Yang, J.; et al. Hypoxic surfacing fish detection for abnormal behavior warning based on MSYOLO in Recirculating Aquaculture Systems. Inf. Process. Agric. 2026. [Google Scholar] [CrossRef]
- Liu, S.; et al. Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection. In Proceedings of the ECCV, Milan, Italy, 29 September–4 October 2024. [Google Scholar] [CrossRef]
- Zeta, B.M.A.; et al. A Low-Cost pH Sensor for Real-Time Monitoring of Aquaculture Systems in a Multi-Layer Wireless Sensor Network. Sensors 2025, 25, 2824. [Google Scholar] [CrossRef] [PubMed]
- Al-Khaldi, M.; Dhandapani, R.; Al-Badri, M.A. Preliminary Field Evaluation of a Low-Cost IoT Workflow for Dissolved Oxygen Monitoring and Short-Horizon Forecasting in Nile Tilapia Aquaculture. Sensors 2026, 26, 4242. [Google Scholar] [CrossRef] [PubMed]
- Li, Y.; et al. Underwater Near-Infrared image reconstruction for nighttime fish hypoxia monitoring. Comput. Electron. Agric. 2026, 240, 111209. [Google Scholar] [CrossRef]
- DDEYOLOv9: Network for Detecting and Counting Abnormal Fish Behaviors in Complex Water Environments. Fishes 2024, 9, 242. [CrossRef]
- Quantifying the effectiveness of multiple fish behaviors for hypoxia monitoring across different environments. Smart Agric. Technol. 2026, 14, 102060. [CrossRef]
- Liu, F.T.; Ting, K.M.; Zhou, Z.-H. Isolation Forest. In Proceedings of the 2008 Eighth IEEE International Conference on Data Mining, Pisa, Italy, 15–19 December 2008; pp. 413–422. [Google Scholar]
- Schölkopf, B.; et al. Estimating the Support of a High-Dimensional Distribution. Neural Comput. 2001, 13, 1443–1471. [Google Scholar] [CrossRef] [PubMed]
- Breunig, M.M.; et al. LOF: Identifying Density-Based Local Outliers. In Proceedings of the ACM SIGMOD, Dallas, TX, USA, 16–18 May 2000; pp. 93–104. [Google Scholar] [CrossRef]
- Hasegawa, T.; Nakano, D. Robust Fish Recognition Using Foundation Models toward Automatic Fish Resource Management. J. Mar. Sci. Eng. 2024, 12, 488. [Google Scholar] [CrossRef]
- Jamiaan, M.; Soon, C.F.; Chia, K.S.; Sultana, N. IoT-Based Unsupervised Anomaly Detection for Multivariate Time-Series Sensor Data in C. vulgaris Cultivation. Technologies 2026, 14, 622. [Google Scholar] [CrossRef]
Figure 1.
Results showing DO attack F1 and false-positive rate reported from the three ML with and without assistance of computer vision.
Figure 1.
Results showing DO attack F1 and false-positive rate reported from the three ML with and without assistance of computer vision.

Figure 2.
Fish detected by computer vision using fixed camera tapo C120.

Figure 3.
A monitoring Dashboard used in the study (real time).

Table 2.
All records reported.
| Phase | Scheduled Span | Records Collected | Evaluated Records |
|---|---|---|---|
| Normal training | 14.00 days | 20,160 | — |
| Independent calibration | 3.00 days | 4320 | — |
| Test pre-event baselines | 115 × 30 min | 3450 | — |
| Test post-onset periods | 115 × 120 min | 13,800 | 13,800 |
| Total | 28.98 days | 41,730 | 13,800 |
Table 4.
Results reported by the three ML with vision-assisted.
| Model | Input | DO F1 | DO Recall | Nonattack FPR |
|---|---|---|---|---|
| IF | No camera | 0.072 | 6.4% | 14.4% |
| IF | YOLO | 0.414 | 58.0% | 24.4% |
| IF | DINO | 0.468 | 74.7% | 28.9% |
| OC-SVM | No camera | 0.119 | 22.2% | 50.1% |
| OC-SVM | YOLO | 0.347 | 80.4% | 56.6% |
| OC-SVM | DINO | 0.360 | 84.1% | 56.7% |
| LOF | No camera | 0.184 | 35.2% | 49.3% |
| LOF | YOLO | 0.360 | 85.6% | 57.9% |
| LOF | DINO | 0.368 | 88.3% | 58.4% |
Table 6.
Comparison of YOLO and Grounding DINO with Previous Studies.
| Parameter | Hasegawa & Nakano (2024) [19] | Jiang et al. (2025) [20] | Signaroli et al. (2026) [21] | Guo et al. (2026) [22] | Proposed YOLOv8n | Proposed Grounding DINO |
|---|---|---|---|---|---|---|
| Method | DINO + SAM | YOLOv8 | DINO + SAM2 | MSYOLO | YOLOv8n proxy | DINO proxy |
| Precision (%) | 97.9 | 82.1 | 93.0 | 88.6 | 98.3 | 98.6 |
| Recall (%) | 73.9 | 76.5 | 93.0 | 89.8 | 60.3 | 70.3 |
| F1-score (%) | NR | 79.2 | 93.0 | 89.3 | 74.7 | 82.0 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.