World Aquaculture Magazine - September 2025

38 SEPTEMBER • WORLD AQUACULTURE • WWW.WAS.ORG digital photography. I constructed triplicates of five tanks labelled A, B, C, D, and E. Each tank contained three zebrafish of varying lengths: small, maturing, and matured. Videos of each tank were recorded, lasting between 1 to 2 minutes, using a Xiaomi 11 Lite NE mobile phone, which records in 4K resolution at 30 frames per second. The distance from the tank to the camera was not fixed, as I utilized ArUco markers placed on each tank (Wang et al. 2023). These markers served as reference points for measuring the length of the fish regardless of how far the tank was from the camera (Figure 3). The images and videos of each tank are then used as input into Zid-AI, which generates the estimated lengths of each zebrafish across all tanks. In parallel, I manually measured the fish in each tank after anesthetizing them, using digital photography and the software TpsDigs. The results from each replicate were carefully recorded. Figure 3 shows recorded images which were processed afterwards to measure the lengths. How Does it Work? Model: A neural network is a non-linear mathematical function that receives a set of inputs and gives outputs depending on a set of parameters called weights which are determined during the training process (Bishop 1994), the model feeds the data into a network or mesh of neurons, each layer breaks an image or frame in a video and passes through the network where the pattern of a specific object is identified. Each layer acts as a feature extractor, giving the output as prediction of the object on which the model is trained. In this case, the model is trained with zebrafish images so the network can classify the objects that are similar to zebrafish as zebrafish. Figure 4 explains the process much more simply by means of a diagram. Functions: The use of neural network models is not only limited to identifying the object but also various functionalities such as measurement of length and speed by using various functions of image processing and coordinate transformation. In fields nowadays, the use of stereo vision is vast, which aids in measuring a fish’s length and biomass in an aquaculture system, but stereo vision cameras are expensive. The cost-effective way of taking the video is by a mobile phone camera, although the pixel and frame rates in a video can vary, which will lead to false measurement of the length. To fix this issue, a genius function of OpenCV involves a fiducial marker group in computer vision, that is ArUco markers (Siki and Takacs 2021). They are fixed landmarks placed in an environment to facilitate pose estimation, object detection, and spatial measurements. ArUco (Figure 5) markers are typically binary squares with a QR code-like structure, which have a specific length and width and can serve as reference points to measure objects that are near the marker. Now, the problem is that a tank or an aquaculture system is not a twodimensional space; it has three dimensions: length, width, and depth. To avoid errors in length measurement with fishes, 2 AruCo markers are used in a glass aquarium, one on the frontal surface of the tank and one on the rear side. They both have the same dimensions, and the model measures the dimensions the same irrespective of their distance from the camera. The measurement of swimming speed, on the other hand, can be done by measuring the movement of an object in a video from one place to another, knowing the displacement in pixels and the time taken to reach a specific frame, let’s say the distance moved by a fish from frame one which is the starting of the video to the 10th frame of the video in a certain period. By knowing the velocity in pixels/second, we can convert this to cm/second by using the formula, Speed in cm/s = speed in px/s X (Scale factor) where the scale factor is the ratio of reference object length measured in centimeters by reference object length in pixels, in this case, the reference object will be the zebrafish for which we need the swimming speed. Measuring the swimming speed of a fish in a holding aquarium using a mobile phone camera is a difficult task as the pixels can vary from phone to phone, but keeping the scaling factor in mind and using an ArUco marker to help determine it will aid in the proper measurement of swimming speed. Results: The accuracy of the model and the measurement comparison are discussed here. As for the model evaluation, we use a parameter called precision-recall value. Precision means the ability of a classification model to return only the data points in a class, while recall is the ability of a model to identify all the points in the relevant class. From Figure 6 we can determine Precision-recall value for the model ranges from 83% to 87.6%, which in simple terms indicates the object identified in the test group or unseen images is correctly identified as zebrafish. The performance of the AI in an aquarium is tested by using the validation method discussed earlier. Table 1 explains the correlation between the measurements taken by the model and measurements taken by digital photography. The performance of the model and the actual measurements are shown in Tables 2 and 3. Furthermore, statistical analysis suggests that the measurements taken by Zid-AI and actual measurements are positively correlated, and medium and large groups of fishes have strong correlations but marginally non-significant p-values, while for small fishes, the p-value is high (0.89452) and with the weakest correlation among the test groups, implying that the model works well on fishes of medium and large size. Constraints There are three constraints that should be discussed. The first lies in the camera of a mobile phone. As there is no standard frame rate or pixels/cm on every mobile, it will be a difficult task to get universal results that are the same through every mobile. Even though the ArUco marker is used, it is not easy to measure the dimensions due to loss of focus and lens distortion, which is a common optical effect where straight lines appear curved, or objects appear to have different shapes due to the characteristics of the camera lens. This will result in inaccurate measurements, and calibrating this lens distortion is essential to achieve more accurate results. It is easy to calibrate using OpenCV’s CalibrateCamera function to estimate the camera matrix and distortion coefficients, then apply inverse distortion transformation to correct the image (Zhang 2000).

RkJQdWJsaXNoZXIy MjExNDY=