Target detection and tracking algorithm-based alumen ustum characteristic quantification method

By improving the YOLOv11 and DeepSORT algorithms, the accuracy problem of floc detection and tracking during the coagulation process in water plants was solved, enabling real-time monitoring and automated control of floc coagulation effect, thereby improving water quality safety and treatment efficiency.

CN121121069APending Publication Date: 2025-12-12NANJING SMART WATER TECHNOLOGY CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511295531.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing water plants rely on manual experience to judge the floc sedimentation effect during the coagulation process, resulting in inaccurate coagulant dosage, inability to adapt to real-time changes in water quality, and impact on water quality stability and treatment costs.

Method used

An improved YOLOv11 target detection algorithm is adopted, combined with the context guidance module CGBD and the multi-scale attention mechanism EMA to enhance the flower detection capability, and the MPDIoU loss function is used to optimize the bounding box regression; the DeepSORT algorithm is combined for target tracking, and stable tracking is achieved through cascaded matching and trajectory verification mechanisms.

Benefits of technology

It enables real-time monitoring and automated control of floc coagulation effect, improves detection accuracy and tracking stability, provides quantitative basis for coagulant dosing, and enhances water quality safety and treatment efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121121069A_ABST
    Figure CN121121069A_ABST
Patent Text Reader

Abstract

The invention discloses a alumen ustum characteristic quantification method based on a target detection and tracking algorithm, and belongs to the field of computer vision, and the method specifically comprises the steps: 1, collecting a alumen ustum data set; step 2, an alumen ustum detection and tracking algorithm based on improved YOLOv11-DeepSORT is carried out; comprising an improved YOLOv11 target detection algorithm and an improved YOLOv11-DeepSORT target tracking algorithm. The intelligent addition of the water treatment coagulant provides a quantitative technical basis, is beneficial to realizing automatic and fine control of the coagulation process, and improves the water quality safety and the treatment efficiency. In future work, the robustness of the algorithm is further optimized in a more complex actual underwater environment, and how to establish a more direct quantitative relationship between the alumen ustum form and motion parameters and the coagulant dosage is explored, so that more intelligent and more accurate coagulation process regulation and control are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of computer vision, and particularly relates to a method for quantifying alum flower characteristics based on a target detection and tracking algorithm. BACKGROUND

[0002] In a water treatment process, the coagulation process plays a decisive role in water quality. By adding a coagulant to raw water, impurities and suspended particles in the water are aggregated into larger alum flowers, which facilitates subsequent sedimentation and filtration treatment. The coagulation effect is closely related to the coagulant dosage, water quality conditions, pH value, temperature and other factors, so the coagulant dosage needs to be accurately adjusted and controlled to ensure water quality safety and treatment efficiency.

[0003] At present, most water plants rely on artificial experience to judge the alum flower sedimentation effect and control the coagulant dosage. This traditional method is highly subjective and labor-intensive, and cannot adapt to real-time changes in water quality, which can easily result in excessive or insufficient dosing, affecting water quality stability and treatment costs. With the rapid development of computer vision and deep learning technologies, image recognition, target detection, target tracking and other technologies have been gradually applied in intelligent coagulant dosing. By analyzing the alum flower state in the coagulation process through digital image processing technology, the morphological parameters and motion parameters of the alum flower can be obtained, providing quantitative basis for realizing precise automatic control of the coagulation process.

[0004] Most existing water plants control the coagulant dosage by detecting the effluent turbidity of the settled water to represent the coagulation effect. A large number of studies have found that the morphological parameters (number, area, fractal dimension, equivalent diameter) and motion parameters (settling velocity, motion trajectory) of the alum flower are closely related to the effluent turbidity. Fractal dimension is a main parameter representing the structural characteristics of the alum flower. Changes in the fractal dimension during the coagulation process not only reflect the formation process and rules of the alum flower, but also have a good correlation with the effluent turbidity after sedimentation. Generally, a larger fractal dimension indicates a higher compactness of the alum flower structure, resulting in enhanced settling performance and lower effluent turbidity. Since the shape of the alum flower is irregular, its settling velocity is slower than that of a spherical alum flower of the same volume, so the irregular particles are defined as a sphere or a circle equivalent to the particle to some extent, and the equivalent diameter is introduced. The larger the equivalent diameter of the alum flower, the faster the settling velocity, i.e., the more complete the settling, the lower the effluent turbidity, and the better the coagulation effect. A detection system based on multi-target tracking was developed in Shanghai Pudong Linjiang Water Plant. The system integrates image analysis and processing, Kalman filtering, multi-hypothesis tracking (MHT) and other algorithms to solve key problems such as flocculation image acquisition and detection, flocculation feature extraction, and automatic optimization control of coagulant dosage in the coagulation process. This research fully reveals the strong correlation between flocculation settling velocity and sedimentation turbidity, providing a basis for automatic optimization control of coagulant dosage.

[0005] In recent years, deep learning-based object detection and tracking algorithms have achieved significant breakthroughs in the field of computer vision. Object detection algorithms are mainly divided into two categories: two-stage object detection algorithms and single-stage object detection algorithms. Two-stage object detection algorithms are a type of object detection method based on candidate regions; typical algorithms in this category include R-CNN and Faster R-CNN. [3] Single-stage object detection algorithms are regression-based object detection methods; classic algorithms include the SSD algorithm. [4] RetinaNet algorithm [5] And the YOLO series of algorithms, etc. The YOLO series of algorithms are widely used in the field of target detection due to their excellent detection performance and real-time performance. YOLOv11, as the latest version, has significant improvements in accuracy, speed and model size.

[0006] Target tracking algorithms can be categorized into generative and discriminative models from a model construction perspective. Representative generative tracking algorithms include optical flow (Lucas-Kanade) and particle filtering, but these methods are sensitive to changes in lighting and viewpoint, and are unsuitable for target occlusion or large-scale target tracking, resulting in less than ideal performance in complex scenes. Currently, discriminative tracking algorithms are more widely used, including SORT and DeepSORT algorithms. DeepSORT, by combining depth features and motion information, performs well in multi-target tracking tasks. However, when performing alum floc detection and tracking tasks, the complex underwater environment makes image quality susceptible to factors such as lighting and suspended objects; furthermore, the irregular shape and dense distribution of alum floc targets can easily lead to target occlusion, resulting in false positives and false negatives. Summary of the Invention

[0007] To address the aforementioned issues, this embodiment proposes a method for quantizing alum flower features based on target detection and tracking algorithms. First, the YOLOv11 model is improved by introducing a context guidance module (CGBD) and a multi-scale attention mechanism (EMA) into the backbone network to enhance the detection capability of alum flowers at different scales. The MPDIoU loss function is then employed to improve the bounding box regression accuracy and convergence speed. Finally, the improved YOLOv11 model is combined with the DeepSORT algorithm to achieve stable tracking of alum flower targets in complex environments.

[0008] This invention is implemented as follows:

[0009] A method for quantifying alum flower features based on target detection and tracking algorithms, comprising the following steps: Step 1: Collecting alum flower dataset; Step 2: Alum flower detection and tracking algorithm based on improved YOLOv11-DeepSORT, including improved YOLOv11 target detection algorithm and improved YOLOv11-DeepSORT target tracking algorithm.

[0010] Furthermore, step one specifically involves: capturing images of the target object using an underwater camera, transmitting the alum flower image to a storage device via a serial port, and finally displaying it on a monitor; and accurately labeling the captured alum flower image: manually labeling the alum flower target using LabelImg software.

[0011] Furthermore, in step two: the alum flower detection model is improved based on the YOLOv11 model. First, a context guidance module CGBD is added to the Backbone and Neck networks to learn the joint features of the context and further optimize them. Then, an efficient multi-scale attention mechanism EMA is introduced into the C2PSA module to reduce computational overhead while retaining rich channel information and increasing the model's ability to extract multi-scale features. Finally, the MPDIoU loss function is used instead of the YOLOv11 loss function to more accurately reflect the difference between the predicted box and the ground truth box.

[0012] Furthermore, the Context-Guided Development (CGBD) module includes: enhancing feature representation by combining local features and contextual information; the CGBD module contains a local feature extractor f loc , surrounding context extractor f sur Joint feature extractor f joi and global context extractor f glo Four parts; the image is processed by a 1x1 convolution, and then... loc and f sur The two branches learn features from the local and surrounding contexts, respectively. loc Implemented using a standard 3x3 convolutional layer, responsible for extracting local details; f sur Using a 3x3 depthwise convolution increases the receptive field size, responsible for extracting global or contextual information; f joi The features extracted from the two branches are integrated, and a Concat connection layer is used to merge local and global information. Batch Normalized Navier-Standard (BN) and PReLU activation functions are used to enhance feature representation capabilities. glo Global average pooling (GAP) is used to aggregate the contextual information of the entire feature map, and then two fully connected (FC) layers are used for further processing.

[0013] Furthermore, the multi-scale attention mechanism EMA is as follows: The EMA mechanism introduces the C2PSA module, which combines multiple PSABlocks. Each PSABlock contains the EMA mechanism and adds adjustment operations for the input and output channels. The goal of C2PSA_EMA is to extract and process the features of alum flower targets at multiple levels, thereby improving the robustness of the model in complex scenes. In particular, it improves the detection accuracy of alum flowers of different sizes when they are dense and there is target occlusion.

[0014] Furthermore, the MPDIoU loss function is as follows: The MPDIoU loss function improves the accuracy and efficiency of bounding box regression by minimizing the distance between the top-left and bottom-right corners of the predicted bounding box and the actual bounding box. It considers overlapping or non-overlapping areas, center point distances, and deviations in width and height, while simplifying the calculation process, which helps improve the training effect of bounding box regression and increase the convergence speed. w and h are the width and height of the ground truth box, respectively; (x1pred, y1pred) and (x1gt, y1gt) are the coordinates of the top-left corner of the predicted box and the ground truth box, respectively; (x2pred, y2pred) and (x2gt, y2gt) are the coordinates of the bottom-right corner of the predicted box and the ground truth box, respectively; d1 and d2 are the top-left and bottom-right corner distances between the predicted box and the ground truth box, respectively. The formula for calculating the MPDIoU-based loss function is as follows:

[0015] d1 2 =(x 1p red -x 1g t ) 2 +(y 1p red -y 1g t ) 2

[0016] d2 2 =(x 2p red -x 2g t ) 2 +(y 2p red -y 2g t ) 2

[0017]

[0018] L MPDIoU =1-MPDIoU.

[0019] Furthermore, the improved YOLOv11-DeepSORT target tracking algorithm is as follows:

[0020] The target tracking part adopts the DeepSORT algorithm, which improves the detection results of YOLOv11 as input. First, Kalman filtering is used to predict the trajectory. Then, the Hungarian algorithm is used to perform cascade matching and IOU matching on the predicted box and the detection box. Finally, Kalman filtering is performed to update the target. By adding cascade matching and trajectory verification mechanisms, the DeepSORT algorithm can track the target more stably and accurately. Even in the case of dense foliage and occlusion, it can effectively reduce the occurrence of target loss and mismatch.

[0021] The advantages of this invention compared to the prior art are as follows:

[0022] This invention presents an algorithm for detecting and tracking *Alum flocculation* targets based on an improved YOLOv11 and DeepSORT, enabling real-time monitoring of *Alum flocculation* coagulation effects. In the detection phase, the algorithm enhances feature representation by introducing a context-guided module (CGBD) and a multi-scale attention mechanism (EMA), preserving rich channel information while reducing computational overhead. Furthermore, the MPDIoU loss function is employed to improve the model's generalization ability. In the tracking phase, the DeepSORT algorithm is combined with the improved YOLOv11 algorithm, achieving stable target tracking through cascaded matching and trajectory verification mechanisms. Experimental results show that, compared to the base model, the improved YOLOv11 algorithm achieves higher mAP50 and mAP50-95 on the *Alum flocculation* dataset, representing improvements of 3.2% and 2.6% respectively, significantly improving detection accuracy while maintaining low computational complexity. Tracking performance (MOTA and MOTP) reaches 73.2% and 84.5% respectively, providing reliable technical support for automated control of coagulation and chemical dosing.

[0023] This invention provides a quantitative technical basis for the intelligent dosing of water treatment coagulants, which helps to achieve automated and refined control of the coagulation process, improving water quality safety and treatment efficiency. Future work will consider further optimizing the robustness of the algorithm in more complex actual underwater environments, and exploring how to establish a more direct quantitative relationship between floc morphology and motion parameters and coagulant dosage, so as to achieve more intelligent and precise control of the coagulation process. Attached Figure Description

[0024] Figure 1 This is the annotation interface for manually annotating alum flower targets using LabelImg software in this embodiment of the invention;

[0025] Figure 2 This is a network structure diagram of the YOLOv11 target detection algorithm of this invention;

[0026] Figure 3 This is a network structure diagram of the improved YOLOv11 target detection algorithm of this invention;

[0027] Figure 4 This is a network structure diagram of the CGBD module of the present invention;

[0028] Figure 5 This is a structural diagram of the C2PSA_EMA module of the present invention;

[0029] Figure 6 The flowchart of the improved YOLOv11-DeepSORT algorithm of this invention is shown below;

[0030] Figure 7 The image shows the detection results of the YOLOv11 algorithm and the improved YOLOv11 algorithm of this invention on the alum flower dataset;

[0031] Figure 8 This is a tracking result image of consecutive frames of alum flower images using the DeepSORT algorithm of this invention;

[0032] Figure 9 This is a tracking result image of consecutive frames of alum flower images using the improved YOLOv11-DeepSORT algorithm of this invention;

[0033] Figure 10 This is a heatmap for the correlation analysis of mutual information and MIC in this invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the following examples provide a more detailed description of the invention. It should be noted that the specific embodiments described herein are merely illustrative and not intended to limit the scope of the invention.

[0035] The specific method for quantifying alum flower features based on target detection and tracking algorithms in this invention is as follows:

[0036] 1. Alum Floc Dataset: Image acquisition requires a professional underwater camera to meet the need for real-time capture of alum floc targets. The underwater camera captures images of the target, which are then transmitted to a storage device via a serial port and finally displayed on a monitor. This embodiment uses a Barlus network underwater HD camera (model UW-S2F-4DWC6X10, resolution 1920×1080P, frame rate 60FPS), equipped with an intelligent cleaning brush head for automatic cleaning. It can operate safely and stably in the flocculation reaction tank and provide high-definition alum floc monitoring images.

[0037] To train the target detection model, the acquired alum flower images need to be accurately labeled. This embodiment uses LabelImg software to manually label the alum flower targets; the labeling interface is shown below. Figure 1 As shown. After filtering, a dataset containing 600 images was obtained, which was divided into a training set of 420 images, a validation set of 120 images, and a test set of 60 images in a 7:2:1 ratio.

[0038] 2. A floc detection and tracking algorithm based on the improved YOLOv11-DeepSORT, flowchart as follows: Figure 6 As shown.

[0039] 2.1 Improved YOLOv11 Object Detection Algorithm: YOLOv11 is another update from Ultralytics based on YOLOv8, achieving higher accuracy, faster speed, and fewer parameters, supporting tasks such as image detection, segmentation, and classification. The network model consists of three parts: the backbone network, the neck network, and the DectHead detection head. The network structure is as follows: Figure 2 As shown.

[0040] The YOLOv11 detection model employs the C3k2f module in its backbone and neck network. This module uses two convolutional kernels and segments the feature map through a bottleneck layer, refining the feature representation and accelerating extraction. Additionally, a C2PSA module is added after the Spatial Pyramid Pooling (SPPF) module. C2PSA is an extension of the C2f module, introducing Position-Sensitive Attention (PSA) to enhance feature extraction capabilities through multi-head attention and a feedforward neural network (FFN). It can selectively add residual structures to optimize gradient propagation and network training. Furthermore, using FFN maps input features to a higher-dimensional space, capturing complex nonlinear relationships within the input features and allowing the model to learn richer feature representations. Finally, two depthwise separable convolutional layers (DWConv) are added to the cls branch of the detection head, significantly reducing computational redundancy and improving computational efficiency.

[0041] This embodiment's alum flower detection model is an improvement upon the YOLOv11 model. First, a Context-Guided Module (CGBD) is added to the Backbone and Neck networks to learn joint features from the context and further optimize them. Then, an efficient multi-scale attention mechanism (EMA) is introduced into the C2PSA module to reduce computational overhead while preserving rich channel information and increasing the model's ability to extract multi-scale features. Finally, the MPDIoU loss function is used instead of the YOLOv11 loss function to more accurately reflect the difference between the predicted and ground truth boxes. The improved YOLOv11 network structure is as follows: Figure 3 As shown.

[0042] The Context Guided Blockdown (CGBD) module is specifically designed for YOLOv11. Traditional convolutional kernels primarily focus on local region information when extracting features. While they can capture local edges and texture details well, they fall short in preserving the overall image's contextual information. Underwater scenes often suffer from high noise, image blur, and low visibility, leading to the easy loss of important features in the target area. Therefore, this embodiment introduces a Context Guided Blockdown (CGBD) module, which enhances feature representation by combining local features and contextual information. The CGBD module includes a local feature extractor f... loc , surrounding context extractor f sur Joint feature extractor f joi and global context extractor f glo Four parts, network structure as follows Figure 4 As shown. After the image undergoes a 1x1 convolution, it is processed by f... loc and f sur The two branches learn features from the local and surrounding contexts, respectively. loc Implemented using a standard 3x3 convolutional layer, responsible for extracting local details; f sur Using a 3x3 depthwise convolution increases the receptive field size, responsible for extracting global or contextual information; f joi The features extracted from the two branches are integrated, and a Concat connection layer is used to merge local and global information. Batch Normalized Navier-Standard (BN) and PReLU activation functions are used to enhance feature representation capabilities. glo Global average pooling (GAP) is used to aggregate the contextual information of the entire feature map, and then two fully connected (FC) layers are used for further processing.

[0043] The context-guided module CGBD can effectively learn the joint features of local features and contextual information. The local branch strengthens the extraction of local contours and subtle texture information of alum flowers, helping to distinguish subtle differences from the background; the global branch captures information of the overall underwater scene, understands the relationship between targets, helps to identify overlapping or partially occluded alum flowers, and improves the network's ability to detect small targets in complex backgrounds.

[0044] Multi-scale Attention Mechanism (EMA): During the formation of alum flocs, their sizes vary, ranging from tiny initial particles to larger flocs, appearing as targets of different scales in the image. Furthermore, underwater environments often contain complex background noise such as bubbles, suspended impurities, uneven lighting, and water turbidity. These interfering factors can easily lead to false positives or false negatives in detecting alum floc targets. Therefore, this embodiment introduces an efficient multi-scale attention mechanism (EMA) into the C2PSA module of the original detection model. Through efficient multi-scale feature fusion and attention calculation, it improves the model's ability to detect alum floc targets of different scales while maintaining computational efficiency.

[0045] The EMA attention mechanism is an attention module specifically designed to improve the performance of object detection tasks. Its core idea is to achieve efficient and comprehensive feature enhancement through a combination of parallel decomposition and multi-scale attention. EMA overcomes the limitations of traditional attention mechanisms (such as SENet and CBAM) in capturing multi-scale information and optimizes computational efficiency. In object detection tasks with multi-scale and complex scenes, it can enhance the model's ability to process features. The EMA mechanism is introduced into the C2PSA module, combined with multiple PSABlocks, each containing the EMA mechanism and incorporating input and output channel adjustment operations. The overall structure is as follows: Figure 5 As shown, the goal of C2PSA_EMA is to extract and process alum flower target features at multiple levels, thereby improving the model's robustness in complex scenes. Specifically, it improves the detection accuracy for alum flowers of different sizes, especially in situations with dense alum flowers and target occlusion.

[0046] MPDIoU Loss Function: YOLOv11 uses the CIoU loss function by default, which considers the overlap area between target boxes, the distance between center points, and the aspect ratio. It measures the predicted and ground truth boxes across multiple geometric factors, helping to improve the model's ability to locate targets. However, in underwater target detection scenarios, the traditional CIoU loss function has poor generalization performance and is not effective for underwater target detection. Therefore, this embodiment uses the MPDIoU loss function, a bounding box similarity comparison index based on minimum point distance, which directly minimizes the distance between the top left and bottom right corner points of the predicted bounding box and the actual labeled bounding box, more accurately reflecting the difference between the predicted and ground truth boxes.

[0047] The MPDIoU loss function improves the accuracy and efficiency of bounding box regression by minimizing the distances between the top-left and bottom-right corners of the predicted bounding box and the actual bounding box. It considers overlapping or non-overlapping areas, center point distances, and deviations in width and height, while simplifying the calculation process, thus improving the training effect and convergence speed of bounding box regression. w and h are the width and height of the ground truth bounding box, respectively. (x1 pred,y1 pred ) and (x1 gt ,y1 gt (x2) represents the coordinates of the top-left corner of the predicted bounding box and the top-left corner of the ground truth bounding box, respectively. pred ,y2 pred ) and (x2 gt ,y2 gt (x) represents the coordinates of the bottom right corner of the predicted bounding box and the ground truth bounding box, respectively. The loss function based on MPDIoU is calculated as follows:

[0048] d1 2 =(x 1p red -x 1g t ) 2 +(y 1p red -y 1g t ) 2

[0049] d2 2 =(x 2p red -x 2g t ) 2 +(y 2p red -y 2g t ) 2

[0050]

[0051] L MPDIoU =1-MPDIoU

[0052] 2.2 Improved YOLOv11-DeepSORT target tracking algorithm

[0053] The SORT algorithm achieves target tracking by connecting the detected target bounding box to an existing trajectory. Its core is the Kalman filter.

[15] The Kalman filter combines the target's current ground truth vector with the current detection vector to infer the target's state vector at the next time step, aiming to predict the next moment's motion based on a series of current motion events. The Hungarian algorithm addresses the target ID assignment problem by using linear weighting to combine target position information and appearance features, matching a series of detection boxes with the predicted boxes from the Kalman filter to achieve tracking. When the target is occluded, the traditional SORT algorithm easily loses tracking trajectory. The DeepSORT algorithm, based on the original algorithm, adds a cascaded matching mechanism and a trajectory verification mechanism. By setting a threshold, it determines whether the target trajectory is confirmed. Only trajectories that meet a certain number of observations and have high matching quality are confirmed, reducing the possibility of false matches.

[0054] The target tracking section of this embodiment employs the DeepSORT algorithm, using the improved detection results of YOLOv11 as input. First, a Kalman filter is used to predict the trajectory. Then, the Hungarian algorithm is used to perform cascade matching and IOU matching on the predicted and detected bounding boxes. Finally, a Kalman filter update is performed. The algorithm flow is shown in the figure. By adding cascade matching and trajectory verification mechanisms, the DeepSORT algorithm can track targets more stably and accurately, effectively reducing target loss and mismatches even in situations with dense clusters and occlusion.

[0055] 3. Experiment

[0056] To verify the effectiveness and superiority of the improved YOLOv11-DeepSORT algorithm proposed in this embodiment for target detection and tracking, this chapter designs a series of comparative experiments. First, the experimental environment configuration and evaluation metrics are introduced. Then, detailed experiments and result analyses are conducted on the performance of target detection and target tracking, and ablation experiments are performed to verify the effectiveness of each improved module.

[0057] 3.1 Dataset and Experimental Parameter Configuration

[0058] The experiment used the self-built *Alum sphaerocephala* dataset described in Section 1. All experiments in this embodiment were conducted on an Ubuntu 20.04 operating system using the PyTorch deep learning framework. The experimental environment configuration was as follows: programming language: Python 3.10; CPU: Intel Core i9-9900k; GPU: NVIDIA GeForce RTX 3090. During the training phase, the SGD optimizer was used to train the model, with 300 training epochs. The input image resolution was 640×640, momentum was 0.937, weight decay factor was 0.0005, initial learning rate was 0.01, batch size was 16, and number of threads was 8.

[0059] 3.2 Evaluation Indicators

[0060] 3.2.1 Target Detection Evaluation Indicators

[0061] This embodiment evaluates the model using metrics such as precision (P), recall (R), mean average precision (mAP), number of parameters, and gigabit-to-float (GFLOPs). The calculation formulas are as follows:

[0062]

[0063] In the formula, TP (True Positives) represents the number of samples that are actually positive and predicted as positive by the model; FP (False Positives) represents the number of samples that are actually negative but predicted as negative by the model; FN (False Negatives) represents the number of samples that are actually positive but predicted as negative by the model. N is the number of classes in the dataset, AP is the average precision on the PR curve, and mAP represents the average precision obtained by averaging all classes in the dataset. This metric can comprehensively evaluate the detection performance of the model.

[0064] 3.2.2 Target Tracking Evaluation Indicators

[0065] Target tracking performance is evaluated using metrics such as MOTA (Multiple Object Tracking Accuracy), MOTP (Multiple Object Tracking Precision), IDF1 (ID F1 Score), and FPS (Frames Per Second).

[0066] MOTA comprehensively considers missed detections, false detections, and ID switching to measure the overall performance of the tracker. The calculation formula is as follows:

[0067]

[0068] In the formula, FN t FP t IDSW t Let GT represent the number of missed detections, false detections, and ID switching counts in frame t, respectively. t This represents the actual number of targets in frame t.

[0069] MOTP measures the average overlap between the tracking result and the actual target. The calculation formula is as follows:

[0070]

[0071] In the formula, d i,tC represents the distance between the i-th tracked target and the corresponding real target in the t-th frame. t This represents the number of matches in frame t.

[0072] IDF1 is used to measure the tracker's performance in maintaining the consistency of target identity, and the calculation formula is as follows:

[0073]

[0074] In the formula, IDTP, IDFP, and IDFN represent the number of correctly tracked targets, the number of incorrectly tracked targets, and the number of untracked targets, respectively.

[0075] FPS represents the processing speed of the algorithm, that is, the number of frames processed per second.

[0076] 3.3 Experimental Results and Analysis

[0077] 3.3.1 Analysis of Target Detection Experimental Results

[0078] (1) Performance comparison of different algorithms

[0079] To verify the effectiveness of the improved YOLOv11 algorithm proposed in this embodiment for the target detection task of *Agrostis spp.*, it was compared with current mainstream target detection algorithms, including Faster R-CNN, YOLOv9, YOLOv10, and the original YOLOv11. Table 1 shows the comparison results of the detection performance of each algorithm on the *Agrostis spp.* test set.

[0080] Table 1 Comparison of detection performance of different algorithms on the *Fructus alum* dataset.

[0081]

[0082] The analysis of the results in the table shows that the improved YOLOv11 algorithm outperforms other algorithms in all performance metrics. Compared with the original YOLOv11, the improved YOLOv11 improves precision (P) by 3.3%, recall (R) by 2.4%, mAP50 by 3.2%, and mAP50-95 by 2.6%. This indicates that the introduced CGBD module, EMA attention mechanism, and MPDIoU loss function effectively enhance the model's ability to detect *Hemiberlesia lataniae* targets. Meanwhile, the improved YOLOv11 maintains low computational complexity with only 3.4M parameters and 7.1G computational cost. The experimental results demonstrate the effectiveness of the improved YOLOv11 algorithm proposed in this embodiment for *Hemiberlesia lataniae* target detection.

[0083] Figure 7The detection results of the YOLOv11 algorithm and the improved YOLOv11 algorithm of this embodiment on the alum flower dataset are shown respectively. Clear alum flower clusters with significant contrast to the background are considered as valid targets. As can be seen from the figure, the improved YOLOv11 detection algorithm of this embodiment can detect more small alum flower targets.

[0084] (2) Ablation test

[0085] To further verify the effectiveness of the improved algorithm in this embodiment, ablation experiments were conducted on the CGBD module, EMA attention mechanism, and MPD loss function on the *Fanhua* dataset. The experimental results are shown in Table 2. All experiments were conducted under the same experimental parameter configuration.

[0086] Table 2 shows the ablation experimental results of the algorithm on the *Fructus alum* dataset.

[0087]

[0088]

[0089] The analysis of the results shows that when the CGBD module is introduced alone, mAP50 increases from 72.4% to 74.1%, and mAP50-95 increases to 48.9%. This indicates that the context-guided module effectively improves the model's ability to capture alum flowers by enhancing multi-scale feature extraction capabilities, especially when handling alum flowers of different sizes. After introducing the EMA attention mechanism, mAP50 increases to 75.2%, and mAP50-95 increases to 49.7%, while the number of parameters decreases from 3.5M to 2.8M. This shows that the EMA mechanism helps the model focus more effectively on important channel information while reducing computational overhead, thus enhancing feature representation capabilities. Finally, after applying the MPDIoU loss function, mAP50 increases to 75.6%, and mAP50-95 increases to 50.2%, achieving the best model performance.

[0090] 3.3.2 Analysis of Target Tracking Experiment Results

[0091] To evaluate the performance of the improved YOLOv11-DeepSORT algorithm proposed in this embodiment for target tracking, we compared it with the original DeepSORT target tracking algorithm. The experimental results are shown in Table 3.

[0092] Table 3 Comparison of tracking performance of different algorithms on the *Fructus alum* dataset.

[0093]

[0094] Experimental results show that the target detection and tracking algorithm based on improved YOLOv11 and DeepSORT proposed in this embodiment demonstrates superior performance in key performance indicators.

[0095] Figure 8 and Figure 9 The tracking results of the DeepSORT algorithm and the improved YOLOv11-DeepSORT algorithm on consecutive frames of alum flower images are shown in the figure. As can be seen from the figure, the DeepSORT algorithm is prone to losing tracked targets during the tracking process, such as id:7 and id:650; while the improved YOLOv11-DeepSORT algorithm does not lose tracked targets and can achieve stable tracking.

[0096] 4. Correlation analysis between the characteristics of floc and water quality characteristics

[0097] 4.1 Data Preparation and Standardization

[0098] The data used was from Flocfeature_results.csv, which includes floc characteristics and water quality indicators. Floc characteristics include floc indices: Number, Mean Area, Dimension, and Equivalent Diameter. Water quality characteristics include Flow, Dosing Flow, pH, and Temperature. Z-score normalization was used to eliminate the influence of dimensions; the formula is (x-mean) / std.

[0099] 4.2 Correlation Analysis

[0100] Mutual information (MI) measures the degree of information sharing between two variables and can capture any form of statistical dependency. It is calculated using mutual_info_regression, with each floc feature as the input variable and the water quality feature as the target variable. The input data is reshaped into a two-dimensional array to meet API requirements. Maximum information coefficient (MIC) explores the maximum mutual information between variables through grid partitioning and normalizes it (0-1 range). alpha = 0.6 (upper limit coefficient of grid partitioning) and c = 15 (grid resolution parameter) are used to obtain the MIC value of feature pairs using the compute_score method.

[0101] The heat map was obtained by analyzing the two methods described above, such as... Figure 10Fractal dimension is the most sensitive indicator, with MIC values ​​of 0.53, 0.50, and 0.41 for pH, influent flow rate, and chemical dosing rate, respectively. This indicates that fractal dimension can accurately capture changes in water quality and is most responsive to changes in pH and influent flow rate, making it a priority variable for reflecting water quality status. The number of flocs has moderate sensitivity to changes in pH and influent flow rate, with MIC values ​​of 0.42 and 0.37, respectively. It can be used as an auxiliary variable to assess changes in pH and influent flow rate, and its changes are more stable than those of fractal dimension, making it suitable for monitoring water quality changes. The correlation between floc area and quantitative parameters is limited, but it still shows a certain non-linear relationship with pH, ​​with a MIC value of 0.38. Area does not directly reflect water quality status but can provide auxiliary information for other characteristic parameters. The equivalent diameter has the weakest sensitivity to all water quality characteristic parameters, especially with chemical dosing rate, where the mutual information is 0, indicating almost no correlation. It provides little help in reflecting water quality status.

[0102] In summary, fractal dimension can be used as the most sensitive indicator of water quality changes, and is especially suitable for inferring changes in water pH and influent flow rate. The number of flocs can be used as a supplement, and the average area can play a certain auxiliary role.

[0103] This embodiment addresses the issues of high subjectivity and low efficiency in manually judging the floc state during water treatment coagulation by proposing a floc target detection and tracking algorithm based on an improved YOLOv11 and DeepSORT. In the target detection stage, a context-guided module (CGBD) is introduced to enhance multi-scale feature extraction capabilities, an EMA attention mechanism is incorporated into the C2PSA module to optimize channel information, and the MPDIoU loss function is used to improve bounding box regression accuracy and model generalization ability. In the target tracking stage, the detection results of the improved YOLOv11 are combined with the DeepSORT algorithm, utilizing its cascaded matching and trajectory verification mechanisms to achieve stable tracking of flocs. Experimental results show that compared with mainstream detection algorithms such as Faster R-CNN, YOLOv9, YOLOv10, and the original YOLOv11, the improved YOLOv11 algorithm in this embodiment achieves higher mAP50 and mAP50-95 on the floc dataset, reaching 75.6% and 50.2% respectively, significantly improving detection accuracy while maintaining low computational complexity. Ablation experiments further validated the effectiveness of the CGBD module, EMA attention mechanism, and MPDIoU loss function in improving model performance. In target tracking, the improved YOLOv11-DeepSORT algorithm demonstrated superior performance compared to the original YOLOv11-DeepSORT in key metrics such as MOTA, MOTP, and IDF1, achieving MOTA of 73.2% and MOTP of 84.5%. This effectively reduced missed detections, false detections, and ID switching during tracking, enabling stable and accurate tracking of alum flocs in complex underwater environments.

[0104] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements can be made without departing from the principle of the present invention, and these improvements should also be considered within the scope of protection of the present invention.

Claims

1. A method for quantifying alum flower features based on target detection and tracking algorithms, characterized in that, The method is as follows: Step 1: Collect the alum flower dataset; Step 2: A floc detection and tracking algorithm based on the improved YOLOv11-DeepSORT; This includes improvements to the YOLOv11 target detection algorithm and improvements to the YOLOv11-DeepSORT target tracking algorithm.

2. The method for quantifying alum flower features based on target detection and tracking algorithms according to claim 1, characterized in that, The first step is as follows: The underwater camera captures images of the collected objects, which are then transmitted to a storage device via a serial port and finally displayed on a monitor. Accurate labeling of the collected alum flower images: The alum flower targets were manually labeled using LabelImg software.

3. The method for quantifying alum flower features based on target detection and tracking algorithms according to claim 1, characterized in that, In step two, the alum flower detection model is improved based on the YOLOv11 model. First, a context guidance module CGBD is added to the Backbone and Neck networks to learn the joint features of the context and further optimize them. Then, an efficient multi-scale attention mechanism EMA is introduced into the C2PSA module to reduce computational overhead while retaining rich channel information and increasing the model's ability to extract multi-scale features. Finally, the MPDIoU loss function is used instead of the YOLOv11 loss function to more accurately reflect the difference between the predicted box and the ground truth box.

4. The method for quantifying alum flower features based on target detection and tracking algorithms according to claim 3, characterized in that, The Context-Guided Development (CGBD) module includes: enhancing feature representation by combining local features and contextual information; the CGBD module contains a local feature extractor f loc , surrounding context extractor f sur Joint feature extractor f joi and global context extractor f glo Four parts; the image is processed by a 1x1 convolution, and then... loc and f sur The two branches learn features from the local and surrounding contexts, respectively. loc Implemented using a standard 3x3 convolutional layer, responsible for extracting local details; f sur Using a 3x3 depthwise convolution increases the receptive field size, responsible for extracting global or contextual information; f joi The features extracted from the two branches are integrated, and a Concat connection layer is used to merge local and global information. Batch Normalized Navier-Standard (BN) and PReLU activation functions are used to enhance feature representation capabilities. glo Global average pooling (GAP) is used to aggregate the contextual information of the entire feature map, and then two fully connected (FC) layers are used for further processing.

5. The method for quantifying alum flower features based on target detection and tracking algorithms according to claim 3, characterized in that, The multi-scale attention mechanism EMA is as follows: The EMA mechanism introduces the C2PSA module and combines multiple PSABlocks. Each PSABlock contains the EMA mechanism and adds adjustment operations for the input and output channels. The goal of C2PSA_EMA is to extract and process the features of alum flower targets at multiple levels, thereby improving the robustness of the model in complex scenes. In particular, it improves the detection accuracy of alum flowers of different sizes when they are dense and there is target occlusion.

6. The method for quantifying alum flower features based on target detection and tracking algorithms according to claim 3, characterized in that, The MPDIoU loss function improves the accuracy and efficiency of bounding box regression by minimizing the distances between the top-left and bottom-right corners of the predicted bounding box and the actual bounding box. It considers overlapping or non-overlapping areas, center point distances, and deviations in width and height, while simplifying the calculation process, thus improving the training effect and convergence speed of bounding box regression. w and h represent the width and height of the ground truth bounding box, respectively; (x1pred, y1pred) and (x1gt, y1gt) represent the coordinates of the top-left corners of the predicted and ground truth bounding boxes, respectively; (x2pred, y2pred) and (x2gt, y2gt) represent the coordinates of the bottom-right corners of the predicted and ground truth bounding boxes, respectively; d1 and d2 represent the distances between the top-left and bottom-right corners of the predicted and ground truth bounding boxes, respectively. The formula for calculating the MPDIoU-based loss function is as follows: d1 2 =(x 1p red -x 1g t ) 2 +(y 1p red -y 1g t ) 2 d2 2 =(x 2p red -x 2g t ) 2 +(y 2p red -y 2g t ) 2 L MPDIoU *1-MPDIoU.

7. The method for quantifying alum flower features based on target detection and tracking algorithms according to claim 1, characterized in that, The improved YOLOv11-DeepSORT target tracking algorithm is as follows: The target tracking part adopts the DeepSORT algorithm, which improves the detection results of YOLOv11 as input. First, Kalman filtering is used to predict the trajectory. Then, the Hungarian algorithm is used to perform cascade matching and IOU matching on the predicted box and the detection box. Finally, Kalman filtering is performed to update the target. By adding cascade matching and trajectory verification mechanisms, the DeepSORT algorithm can track the target more stably and accurately. Even in the case of dense foliage and occlusion, it can effectively reduce the occurrence of target loss and mismatch.

Citation Information

Cited By

  • An alum flower image acquisition system and an acquisition and classification method thereof

    CN122473419A