Petrochemical wastewater, which contains heavy metals and petroleum-based pollutants, is a major environmental and health hazard. Zebrafish are sensitive to water quality changes and can be used as biological indicators for water quality monitoring. By observing their number, behavior, activity and other parameters, the type, concentration and toxicity of pollutants in the water can be inferred. However, the traditional method of monitoring zebrafish toxicity behavior by manual observation and analysis is subjective, labor-intensive and inefficient. Therefore, how to automate the monitoring and identification of zebrafish toxicity behavior using computer vision technology is an important and challenging research topic. The common methods of computer vision technology in zebrafish toxicity behavior monitoring and recognition can be divided into three steps: foreground extraction, target tracking and behavior analysis. However, there are problems such as sensitivity to light changes, inability to deal with occlusion and overlapping phenomena, and low efficiency. Therefore, To improve efficiency and detection accuracy in complex situations such as fish shading for automated and real-time identification of zebrafish toxic behavior. In this study, four typical pollutants (zinc, chromium, lead, and phenol) in petrochemical tail water were selected to experimentally observe the swimming behavior of zebrafish at different concentrations and exposure times. A multi-target tracking technique based on YOLOv8+Bytetrack was used to extract the characteristic values of the zebrafish's movements (average velocity, maximum velocity, minimum velocity, average number of collisions). YOLOv8 is a deep learning-based end-to-end target detection algorithm that enables efficient and accurate target detection. Bytetrack is a multi-target tracking algorithm based on target detection, which can achieve real-time target tracking, and at the same time, the use of low-scoring frames for the tracking algorithm for secondary matching, which can effectively optimize the problem of switching ids due to occlusion in the tracking process. The convolutional neural network Resnet was used to analyze the motion trajectory maps of zebrafish. The bounding box and confidence level output from the YOLOv8 model are inputted into the algorithm to obtain a unique ID and trajectory for each zebrafish. Finally, the zebrafish's features such as position, speed, number of wall touches and trajectory are extracted based on the tracking results. The experimental results show that the algorithm's tracking accuracy, leakage rate and detection time (per 300 frames) can reach 90.26%, 16.33% and 0.19min, respectively, which is a big improvement in detection time and accuracy compared with the traditional target detection methods. The manual labeling tracking accuracy is up to 100%, but the monitoring time is 125.62 min, which is 661.16 times of the multi-target tracking method in this study, and the detection time of the threshold segmentation-based Kalman filter, SOTMOT-based multi-target tracking, and FairMOT-based multi-target tracking are 3.59, 0.41, and 0.37 min respectively, which are 18.89 , 2.16, and 1.95 times, but the tracking accuracies are 67.09, 88.52, and 90.10%, which are 74.32%, 98.07%, and 99.82% of the present method, while the leakage detection rates are 72.80%, 20.69%, and 26.45%, which are 4.46, 1.27, and 1.62 times of the present method. This method also outperforms other multi-target tracking methods (SOTMOT and Deepsort) in terms of target tracking accuracy (MOTA) and target tracking precision (MOTP).Meanwhile, according to the different pollutants, the method can accurately identify the corresponding movement status and trajectory changes of zebrafish in the specific pollutant environments. There was an increase and then a decrease in the velocity of zebrafish exposed to zinc sulfate and lead acetate as compared to the control group. There was a significant difference (P<0.05) between the effects of zinc sulfate and lead acetate on the increase in velocity of zebrafish at the beginning of the exposure. The velocity of zebrafish in the potassium dichromate-exposed group showed a fluctuating trend, which was slightly lower than that of the control group, whereas the proportion of abnormal trajectories was significantly higher (P<0.05) compared with the other experimental groups. Under phenol exposure conditions, the velocity of zebrafish tended to fluctuate over a wide range, while the number of wall touches was significantly higher compared to the other experimental groups (P<0.05). At the later stage of exposure, the velocity of zebrafish in zinc sulfate, lead acetate and potassium dichromate exposure groups gradually stabilized. The velocity of zebrafish under zinc sulfate and lead acetate exposure tended to decrease significantly. In the potassium dichromate group, the velocity of zebrafish under 1 and 2 TU phenol exposure increased sharply and then fluctuated within a certain range. 4 TU phenol exposure resulted in partial mortality of zebrafish. In summary, the multi-target tracking method can quickly identify the type of pollutant to which zebrafish are exposed by setting thresholds for the speed, the number of wall touches, and the percentage of abnormal trajectories in zebrafish behavior. This method is not only simple and effective, but also can realize accurate identification and real-time response, which is of great reference significance in the field of fish toxicity behavior identification. |