$$\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.

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.

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.

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.

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.