Method Article

Real-Time Pond Water Assessment via Embedded Deep Learning and Visual Data Acquisition: A Practical Monitoring Approach for Aquaculture

DOI:

10.3791/69744

February 24th, 2026

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

We describe a protocol for real-time water quality classification using underwater image acquisition, a Raspberry Pi-based controller network, and an Artificial Neural Network (ANN). The method details system setup, data collection, preprocessing, model training, and deployment. This water-quality assessment system is particularly suitable for Koi breeders, helping ensure optimal conditions for healthy fish.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Maintaining optimal water quality is essential in aquaculture, particularly for ornamental species such as Kois, where color clarity and environmental balance are directly linked to health and aesthetics. This article presents a complete protocol for designing, deploying, and operating a real-time water quality monitoring system based on underwater image classification using embedded deep learning. The proposed system integrates a low-cost underwater camera with a Raspberry Pi-based controller network in an autonomous water surface robot, enabling the capture, transmission, and classification of aquatic images through a lightweight neural network model. Five water condition categories -- ranging from clear to turbid -- are visually distinguished, with classification accuracy exceeding 99% on a custom dataset. The system is configured to run autonomously, offering continuous assessment and visual alerts for deteriorating conditions. This visual protocol covers device assembly, system calibration, model deployment, and real-time monitoring demonstrations. The method supports sustainable aquaculture practices by enabling non-invasive, continuous evaluation of aquatic environments using affordable, scalable technologies. The approach can be adapted to other aquaculture or environmental monitoring contexts with minimal modification.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Koi fish (Cyprinus carpio var. koi) are ornamental varieties of the common carp, prized for their vibrant colors, distinctive patterns, elegant body shape, and graceful swimming. Their beauty and fluid movements make them a favorite choice for garden ponds and decorative water features worldwide.

Maintaining good water quality in ponds not only supports aquatic life but also contributes to reducing carbon emissions, thereby benefiting the environment1,2. Maintaining water quality by following established standards for parameters such as pH, temperature, dissolved oxygen, salinity, ammonia (NH3), nitrate (NO3), nitrogen dioxide (NO2), iron (Fe), and phosphate (PO43-) has been shown to create an ideal environment for Koi fish3. Water quality can indeed be assessed through images. Visual indicators such as water clarity, presence of debris or algae, color, and surface texture4 can provide useful information about the condition of the water. Bhatnagar et al. and Andrian et al. 5,6 provide guidelines for pond fish culture, stating that pale to light green water is within the acceptable range for fish growth. Light green to light brown clear water is considered the desirable range, while dark green and brown water falls into the unsuitable range for healthy pond conditions

In Koi pond ecosystems, comprehensive water quality assessment encompasses a range of physical, chemical, and biological parameters. Commonly measured indicators include temperature, pH, water brightness (Secchi depth, cm), dissolved oxygen (DO), total organic matter (TOM), carbon dioxide (CO₂), orthophosphate, ammonia, nitrate, biological oxygen demand (BOD), total suspended solids (TSS), and chemical oxygen demand (COD). These parameters collectively provide a multidimensional profile of aquatic health, supporting both ecological evaluation and management decision-making7. To assess water quality, sensors for those parameters will be employed in ponds as demonstrated by Hemal, Md Moniruzzaman, et al8. PH sensor, Turbidity sensor and temperature sensors to classify water quality. Parasar et al.9 presented waste detection and water quality assessment in aquatic environments. The dataset under consideration encompasses an extensive collection of fresh water sample records, totaling approximately 60 million entries. These records comprise diverse attributes and quality measurements. The attributes include pH levels, concentrations of Iron, Nitrate, Chloride, Lead, Zinc, Turbidity, Fluoride, Copper, Sulfate, Chlorine, Manganese, Total Dissolved Solids, and the Potability label, which serves as the target variable indicating water potability.

Image-based methods for water quality classification offer a rapid, cost-effective, and scalable alternative to traditional laboratory-based approaches. These methods rely on visual cues that can be correlated with physical, chemical, or biological indicators of water quality. Broadly, image-based water quality monitoring can be classified into two categories: images of the water surface10,11,12,13,14,15,16 and underwater images17.

Surface imagery captures the visible portion of water bodies and can be obtained from ground-based cameras, drones (UAVs), aircraft, or satellites. A major advantage is frequent acquisition, suitable for trend analysis. A significant limitation is the limitation to surface-visible parameters; subsurface conditions must be inferred indirectly. Underwater imagery is collected using submerged cameras, remotely operated vehicles (ROVs), or diver-operated systems. Advantages are direct visualization of subsurface conditions, better detection of suspended matter and underwater organisms. Limitations are limited spatial coverage, dependence on artificial lighting in turbid or deep waters, and higher equipment costs.

The classification of quality underwater images in rivers was proposed by Zhou, Han, et al17. The classification uses histograms of image colors and employs two machine learning algorithms: K-Nearest Neighbor (KNN) and Random Forest (RF). These algorithms are used to classify water as either acceptable or dangerous. The accuracy for acceptable water is 98.93%, and for dangerous water, it is 95.25%. Water quality monitoring has been widely investigated using Internet of Things (IoT)-based architectures that enable continuous sensing, data transmission18,19,20,21,22, and remote analysis of aquatic environments. Related studies have also demonstrated that sensor-driven monitoring and environmental interventions can contribute to mitigating urban heat island effects and enhancing indoor thermal comfort7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24. This proposed protocol describes a real-time system for monitoring koi pond water quality by acquiring underwater images using an action camera with an embedded network and classifying water conditions using an artificial neural network (ANN). The ANN is employed because it requires low computational resources, making it suitable for real-time implementation.

Water quality classification process flowchart using deep learning; five water sample types shown.
Figure 1: Block diagram of the proposed real-time pond water assessment methodology: This diagram outlines the stepwise process, from data capture to analysis, showing the overall framework for monitoring water quality in real time. Five types of water quality conditions, labeled T1, T2, T3, T4, and T5, were collected. T1: Images of fresh water recently supplied by a local freshwater provider for the 4-cubic-meter Koi pond housing 17 small Koi fish. T2: Images from the 15-cubic-meter Koi pond containing 12 large Koi fish, each approximately 60-80 cm in length. Water in this pond is quite clear but there are some floating algae. T3: Images from the 35-cubic-meter Koi pond with 18 large Koi fish, each approximately 60-70 cm in length. The pond water is clean, with a light green coloration that lies within the optimal range for fish growth5,6. T4: Images of brown-colored water taken from a wastewater treatment pond. T5: Images of brown-colored water collected from the filter system of the 35-cubic-meter pond, containing waste produced by Kois. Please click here to view a larger version of this figure.

Building on these advances, this article presents a complete protocol for designing, configuring, deploying, and operating a real-time water quality monitoring system based on underwater image classification using embedded deep learning. A block diagram of the proposed protocol is shown in Figure 1, illustrating the system design, configuration, deployment, and classification of water quality into five distinct categories. The protocol enables growers and pond managers to assess water quality by analyzing underwater color characteristics captured in situ.

The proposed system integrates a low-cost underwater action camera with a Raspberry Pi-based controller network deployed on an autonomous surface water robot, as illustrated in Figure 2. This configuration enables image acquisition, wireless transmission, and real-time classification using a lightweight artificial neural network (ANN). Action cameras were selected due to their water resistance at depths of up to 10 m, high-resolution still image capture, and onboard wireless interfaces. Bluetooth connectivity is used for camera initialization and basic control, while Wi-Fi supports high-speed data transfer. However, direct underwater wireless communication using radio-frequency electromagnetic waves is impractical due to severe signal attenuation in water25.

To address this limitation, the system employs a hybrid network topology consisting of two Raspberry Pi Zero 2W units, a wireless router, and a server, as shown in Figure 2. One Raspberry Pi unit is mounted on a battery-powered surface robot that navigates the pond to designated sampling locations, while the second unit interfaces directly with the underwater camera. Alternatively, the system may be deployed in a stationary configuration by manually placing camera units at fixed pond locations, eliminating the need for robotic navigation. Prototypes of the autonomous surface robot and the underwater camera-controller network are shown in Figure 3, and the overall workflow of the water quality classification method is illustrated in Figure 4.

Underwater cleaning robot system diagram; Raspberry Pi, server, router, remote connection setup.
Figure 2: Network topology of the IoT-based water assessment system: The schematic illustrates how devices are interconnected, highlighting communication between cameras, Raspberry Pi units, and the central server. Please click here to view a larger version of this figure.

Aquatic pollution filtration setup; water sampling equipment; environmental research experiment.
Figure 3: Prototype robot integrated with a Raspberry Pi camera network: The figure shows the physical assembly of the robot equipped with onboard sensing and imaging units for field deployment. Please click here to view a larger version of this figure.

Deep learning workflow diagram: data collection, preprocessing, training, real-time application.
Figure 4: Flow Diagram of the proposed method: Shows the flow diagram of the proposed method, which consists of data collection, preprocessing, training, and real-time classification. Please click here to view a larger version of this figure.

An artificial neural network is employed for image classification due to its low computational complexity and suitability for real-time embedded deployment. Together, the proposed protocol provides a practical and scalable framework for real-time koi pond water quality monitoring using embedded deep learning and visual data acquisition.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

NOTE: The source codes used in this study are available at the following GitHub repository: https://github.com/prawit-chu/Real-Time-Pond-Water-Assessment-via-Embedded-Deep-Learning-and-Visual-Data-Acquisition

1. Equipment Setup

  1. Set up the Raspberry Pi-based controller network (the robot and the action camera).
  2. Set up a server running the Ubuntu v24.04 LTS operating system.

2. Action Camera Setup

  1. Set up the default IP address (10.5.5.9) and network mask (255.0.0.0).
    NOTE: Table 1 shows the assigned IP addresses for connected devices in the IoT network.
  2. Configure Wi-Fi SSID and pre-shared key (PSK) to set up the action camera as a Wi-Fi access point.
    1. To find Wi-Fi SSID(name) and PSK (password), swipe down on the action screen, then navigate to Preferences → Wireless Connections→ CAMERA INFO.
    2. To Change Band, in the Wireless Connections menu, select Wi-Fi Band and choose 2.4 GHz for connecting to a Raspberry Pi Zero 2W.
    3. Verify connectivity via the action camera's Wi-Fi interface by using a camera application to connect to the action camera. An example of such an application is the GoPro Quik app.

3. Wireless Router Setup

  1. Add routes 192.168.2.0/24 and 10.0.0.0/8. The forwarding router address for both routes is 192.168.1.99.
  2. Configure port forwarding if internet-based access to the action camera is required. Refer to the router's manual for configuration details. The port forwarding should be set to 8080, which is the web server port used by the action camera.

4. Raspberry Pi Zero 2W (2) in Waterproof Enclosure

  1. Install the Raspberry Pi v6.12 OS.
  2. Configure Wi-Fi SSID and PSK to connect with the action camera using the "nmtui" command.
  3. Configure IP address and netmask of Wi-Fi interface followed by ethernet interface as shown in Table 1 using the "nmtui" command.
  4. Configure Network Address Translation (NAT) and set a default route using 192.168.1.2 as the forwarding router to enable communication across networks.

5. Raspberry Pi Zero 2W (1) in Robot Unit

  1. Install the Raspberry Pi v6.12 OS.
  2. Configure Wi-Fi SSID and PSK to connect with the home or office router using the "nmtui" command.
  3. Add route 10.0.0.0/8 via 192.168.2.2. The forwarding router address is 192.168.2.2.
  4. Set a default route using 192.168.1.1 as the forwarding router to enable communication across networks

6. Server Setup

  1. Configure Wi-Fi SSID and PSK to connect with the home or office router using the GUI network setting.
  2. Assign an IP address to the server through DHCP or manual configuration.
  3. Add routes to 192.168.2.0/24 and 10.0.0.0/8 for connectivity with Raspberry Pi units and the action camera, respectively. The forward router address for both routes is 192.168.1.99.

7. Communication Testing

  1. On the Raspberry Pi Zero 2W (2) in Waterproof Enclosure, execute python3 enable_wifi_ap.py to activate the action camera Wi-Fi.
  2. On the Raspberry Pi Zero 2W, run the iwconfig command to verify that Wi-Fi is active and confirm successful communication with the action camera.
  3. On the server, run "ping 10.5.5.9" command and confirm the expected "Destination port unreachable" response.

8. Dataset Collection

  1. After communication is established, execute "python3 collect_dataset.py T N". (tested with OpenCV v4.12.0)
  2. Replace T with the water type (T1-T5) and N with the number of images to collect.
  3. Postprocessing and Save the collected dataset on the server for further preprocessing (Table 2)

Neural network diagram; input 299x299x3, global average pooling, fully connected, dropout 0.5
Figure 5: Simplified CNN model architectures used for initial training: Presents abstracted neural network structures applied as baseline models. Please click here to view a larger version of this figure.

Neural network diagram with image input, pre-trained model, global pooling, and fully connected layers.
Figure 6: Pre-trained deep learning models utilized in the study: Depicts transfer learning architectures leveraged for classification tasks. Please click here to view a larger version of this figure.

Artificial Neural Network diagram; data pre-processing, varied hidden layers in ANN process.
Figure 7: Artificial Neural Network (ANN) architectures: Shows customized ANN configurations built to evaluate water image classification performance. Please click here to view a larger version of this figure.

Transient absorption spectra graph; spectral fitting analysis results; T1-T5 datasets.
Figure 8: Normalized grayscale histogram of sample dataset images: Provides distribution characteristics of pixel intensities across representative input samples. Please click here to view a larger version of this figure.

9. Deep Learning Training

NOTE: The simplified CNN baselines, pre-trained models, and ANN architectures used in this study are illustrated in Figures 5-8, respectively.

  1. Place the collected dataset file in the directory "V2".
  2. Create histogram of images by running python3 histogram_gen.py (Tested with OpenCV v4.12.0 and CSV v1.0).
  3. Train the model by executing python3 ann_training.py. The ANN trained model will be stored in ann_model.keras (Tested with tensorflow v2.19.0, sklearn v 1.6.1, OpenCV v4.12.0 and CSV v1.0).
  4. Evaluate the confusion matrix by running python3 confusion_matrix.py using the trained model ann_model.keras from Section 9.3. Ensure that the ann_model.keras file is placed in the current directory (Tested with tensorflow v2.19.0, sklearn v 1.6.1, OpenCV v4.12.0 and CSV v1.0).

10. Real-time Deep Learning Classification

  1. Store the trained ann_model.keras file in the classification directory.
  2. Classify real-time water quality by running the command "python3 ann_predict.py". This output will display the GUI containing the captured image and the classified water type.
    NOTE: The example is shown in Figure 12 (right panel) (Tested with tensorflow v2.19.0, sklearn v 1.6.1, OpenCV v4.12.0 and CSV v1.0).

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The dataset was divided into independent training, validation, and test subsets. Model performance was monitored on the validation set during training, and the final evaluation was conducted using a held-out test dataset containing previously unseen images. Consistent performance across validation and test sets indicates stable generalization.

For real-time water quality classification, simplified CNN models and pre-trained networks (Inception V3, Xception, and ResNet50) were initially tested,...

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

A critical step in this protocol is Raspberry Pi-based controller network setting. Incorrect settings result in failure to communicate between the server and the action camera. Before testing the provided programs, communication between the server and the action camera should be verified by PING command. While the proposed model operates in real time on embedded hardware, quantitative measurements of inference time and energy consumption were not evaluated and are beyond the scope of this study.

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors have nothing to disclose.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors would like to express their gratitude to Kasetsart University, Thailand, Vishwakarma University, India and Regent University, USA for their helpful comments, discussions, and insights which have greatly improved our research. We gratefully acknowledge the support provided by the Faculty of Engineering at Sriracha, Kasetsart University, through the Research Unit Fund (Grant No. KUSRCRU69-2001) for the 2026 fiscal year.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
GoPro Hero 11 BlackGoProfor taking photos and record videos
GoPro Hero 12 BlackGoProfor taking photos and record videos
GoPro Hero 13 BlackGoProfor taking photos and record videos
Raspbery PIRaspberry PIZero 2WController
Wireless RouterZTEHG8045x5-12
Ethernet adaptorsTp-linkUE300
ServerDellT30
Battery Pack 12 VDC--Power Supply
DC pumpThai WaterAW500Srobot movement
5V step Down--Step down from 12V to 5V
8-channel Relay--Controlling pumps
GoPro Quick applicationGoProGoProfor testing GoPro Wi-Fi connection

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Macedo, H. R., Junior, O. J. L., Werneck, P. R., Feiden, A. Carbon footprint and automation in aquaculture. Rev Gest Soc Ambient. 18 (11), 1-15 (2024).
  2. Girard, L., et al. The balance of carbon emissions versus burial in fish ponds: The role of primary producers and management practices. Aquac Rep. 39, 102456(2024).
  3. Growth monitoring of koi fish (cypri nus carpio) in natural hatchery techniques. Putri, F., Dewi, N. IOP Conf Ser Earth Environ Sci, umbulan, pasuruan, east java, 236 (1), Available at: https://iopscience.iop.org/article/10.1088/1755-1315/236/1/012016/meta Accessed 1755-1315 (2019).
  4. Armi, L., Fekri-Ershad, S. Texture image analysis and texture classification methods-a review. arXiv. , Avaible at: https://arxiv.org/abs/1904.06554 accessed (2025) (2019).
  5. Bhatnagar, A., Devi, P. Water quality guidelines for the management of pond fish culture. Int J Environ Sci. 3 (6), 1980-2009 (2013).
  6. Andrian, K. N., Wihadmadyatami, H., Wijayanti, N., Karnati, S., Haryanto, A. A comprehensive review of current practices, challenges, and future perspectives in koi fish (cyprinus carpio var. Koi) cultivation. Vet World. 17 (8), 1846(2024).
  7. Yanuhar, U., Musa, M., Evanuarini, H., Wuragil, D. K., Permata, F. S. Water quality in koi fish (cyprinus carpio) concrete ponds with filtration in nglegok district, blitar regency. Univ J Agric Res. 10 (6), 814-820 (2022).
  8. Hemal, M. M., et al. An integrated smart pond water quality monitoring and fish farming recommendation aquabot system. Sensors. 24 (11), 3682(2024).
  9. Parasar, D., et al. Waste detection and water quality assessment in aquatic environments: A comprehensive study using yolov8 and xgboost. , (2024).
  10. Bartz, R., Feiden, A. Water transparency analysis in fish farming environment through unmanned aerial vehicles. J Appl Res Technol. 21 (6), 912-920 (2023).
  11. Zhartybayeva, M., Serik, N., Nurzhanova, A., Rakhimov, R., Tulegenova, S. Development of an integrated approach to the analysis and forecast of hydrographic and bathymetric data of water bodies and tailings ponds. East Eur J Enterp Technol. 127 (10), (2024).
  12. Guo, H., Tao, X. Water quality image classification for aquaculture using deep transfer learning. Neural Netw World. 33 (1), 1(2023).
  13. Jantarakasem, C., Sioné, L., Templeton, M. R. Estimating drinking water turbidity using images collected by a smartphone camera. AQUA Water Infrastruct Ecosyst Soc. 73 (6), 1277-1284 (2024).
  14. Research on water quality image classification method based on convolutional neural network. Jin, C., et al. Adv Inf Manag Commun Electron Autom Control Conf, 6, Available at: https://ieeexplore.ieee.org/document/10575513  Accessed (2025) 1823-1827 (2024).
  15. River water quality estimation based on convolutional neural network. Oga, T., Umeki, Y., Iwahashi, M., Matsuda, Y. Signal Inf Process Assoc Annu Summit Conf, (2018), Available at: https://ieeexplore.ieee.org/document/8659554 Accessed 1841-1866 (2018).
  16. Guo, H., Huang, J. J., Chen, B., Guo, X., Singh, V. P. A machine learning-based strategy for estimating non-optically active water quality parameters using sentinel-2 imagery. Int J Remote Sens. 42 (5), 1841-1866 (2021).
  17. Zhou, H., Qiu, J., Lu, H. -L., Li, F. -F. Intelligent monitoring of water quality based on image analytics. J Contam Hydrol. 258, 104234(2023).
  18. Water quality monitoring system for fisheries using internet of things (iot). Ya’acob, N., et al. IOP Conf Ser Mater Sci Eng, 1176 (1), Available at: https://iopscience.iop.org/article/10.1088/1757-899X/1176/1/012016/meta Accessed (2025) 012016(2021).
  19. Development of image processing incorporated real-time smart water quality monitoring system to detect algae and debris for a sustainable environment. Harischandra, M., et al. Int Conf Adv Comput. 245–250, (2023), Available at: https://ieeexplore.ieee.org/document/10417531 Accessed (2025) 245-250 (2023).
  20. Chen, C. -H., Wu, Y. -C., Zhang, J. -X., Chen, Y. -H. Iot-based fish farm water quality monitoring system. Sensors. 22 (17), 6700(2022).
  21. Arepalli, P. G., Naik, K. J. Water quality classification framework for iot-enabled aquaculture ponds using deep learning based flexible temporal network model. Earth Sci Inform. 18 (2), 351(2025).
  22. Arepalli, P. G., Naik, K. J., Amgoth, J. An iot based water quality classification framework for aqua-ponds through water and environmental variables using cgtfn model. Int J of Environ Res. 18 (4), 73(2024).
  23. Visvanathan, G., Patil, K., Suryawanshi, Y., Meshram, V., Jadhav, S. Mitigating urban heat island and enhancing indoor thermal comfort using terrace garden. Sci Rep. 14 (1), 9697(2024).
  24. Visvanathan, G., Patil, K., Suryawanshi, Y., Chumchu, P. Sensor based dataset to assess the impact of urban heat island effect mitigation and indoor thermal comfort via terrace gardens. Data Brief. 49, 109431(2023).
  25. Evaluating underwater data transmission using wi-fi considering variable salinity levels. Schropp, M., Golz, M. OCEANS Conf, (2025), Available at: https://ieeexplore.ieee.org/document/11104537 Accessed (2025) 1-6 (2025).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Aquaculture MonitoringUnderwater Image ClassificationWater Quality MonitoringRaspberry Pi ControllerAutonomous Water RobotAquatic Environment EvaluationReal Time Monitoring
Video Coming Soon

Related Articles