A Dynamic Counting Method for Uneaten Food in Sturgeon Based on Multi-Target Tracking

By employing a multi-target tracking method, utilizing video acquisition, image enhancement, and an improved YOLO/SORT algorithm, accurate counting of uneaten feed in sturgeon farming was achieved. This method solves the problems of low efficiency, high cost, and large counting errors associated with traditional methods, and is suitable for industrialized sturgeon farming scenarios.

CN120823483BActive Publication Date: 2025-12-02SICHUAN AGRI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511325057.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-17
Publication Date
2025-12-02
Estimated Expiration
2045-09-17

AI Technical Summary

Technical Problem

In industrial sturgeon farming, existing technologies are limited by the fact that traditional manual methods for counting uneaten feed are inefficient, costly, and prone to errors, making it difficult to meet the needs of large-scale farming. Static image-based target detection technology is not accurate enough for counting in large-scale farming ponds, and the characteristics of water surface reflection and blurring, as well as the small size and rapid movement of uneaten feed, increase the difficulty.

Method used

A multi-target tracking approach is adopted, which involves video acquisition, image enhancement, target detection and tracking. An improved YOLO model and SORT algorithm are used for bait detection and tracking, and a dynamic counting line is combined for accurate statistics. This includes high-resolution camera video data acquisition, image enhancement technology to optimize image quality, improved SORT algorithm for stable tracking, and an adaptive dynamic threshold matching strategy to improve association accuracy.

Benefits of technology

It enables precise counting of uneaten feed, improves the accuracy and efficiency of counting, reduces the cost of manual counting, and meets the needs of large-scale aquaculture environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120823483B_ABST
    Figure CN120823483B_ABST
Patent Text Reader

Abstract

This invention discloses a dynamic counting method for uneaten feed in sturgeon based on multi-target tracking, comprising the following steps: Step S1: Collecting video data of uneaten feed in the water flow at the water exchange inlet of the sturgeon breeding pond using an underwater camera; Step S2: Optimizing the quality of the acquired images using image enhancement technology; Step S3: Using a YOLO model as a detector to achieve accurate detection of uneaten feed, and using an improved SORT algorithm to stably track the uneaten feed; Step S4: Performing precise statistical analysis on the tracking results based on a dynamic counting line. This invention is applicable to uneaten feed counting in industrialized sturgeon farming, providing precise data support for feed feeding management, optimizing feed utilization efficiency, reducing farming costs, and providing efficient technical support for intelligent aquaculture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent aquaculture technology, and in particular to a dynamic counting method for uneaten feed in sturgeon based on multi-target tracking, which is applicable to feeding management in industrialized sturgeon farming scenarios. Background Technology

[0002] In industrialized sturgeon farming, accurate uneaten feed counting is crucial for optimizing feed utilization efficiency, improving farming profitability, and reducing operating costs. Industrialized sturgeon farming typically employs recirculating aquaculture systems. Farmers observe the amount of uneaten feed at the outlet 20-30 minutes after feeding; excessive uneaten feed indicates overfeeding, requiring a reduction in the next feeding to avoid waste. However, traditional manual counting methods are inefficient, costly, and prone to errors, making them unsuitable for large-scale farming. Some studies have attempted feed counting using target detection techniques based on static images, but these methods are limited by the large size of the ponds, severe fish occlusion, and the difficulty of a single image covering the entire area, hindering their effectiveness in industrialized farming. Addressing the characteristics of recirculating aquaculture for sturgeon, multi-target tracking counting methods based on video data can dynamically capture the movement trajectory of uneaten feed, achieving more comprehensive coverage and higher accuracy. However, surface reflection and blurring, along with the small size and rapid movement of uneaten feed, pose challenges to counting accuracy. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a dynamic counting method for sturgeon uneaten bait based on multi-target tracking. By comprehensively applying video acquisition, image enhancement, target detection and tracking, and dynamic counting lines, the method achieves accurate counting of uneaten bait.

[0004] The objective of this invention is achieved through the following technical solution: a dynamic counting method for sturgeon uneaten bait based on multi-target tracking, comprising the following steps:

[0005] Step S1: Use an underwater camera to collect video data of uneaten feed in the water flow at the water exchange point of the sturgeon breeding pond;

[0006] Step S2: Optimize the quality of the acquired images using image enhancement techniques;

[0007] Step S3: Use the YOLO model as a detector to achieve accurate detection of uneaten bait, and use the improved SORT algorithm to stably track uneaten bait;

[0008] Step S4: Perform precise statistics on the tracking results based on the dynamic counting line.

[0009] Further, step S1 includes the following steps:

[0010] Step S101: Select a high-resolution industrial-grade waterproof underwater camera, install it above the water exchange port, and point the lens towards the main water flow channel to ensure that the monitoring field of view covers the entire width of the water exchange port.

[0011] Step S102: After the sturgeon has basically finished feeding, start the camera to record and continuously collect video data to obtain video data covering the movement of the remaining bait.

[0012] Step S103: Perform preliminary processing on the captured video, cropping out irrelevant segments and retaining key footage.

[0013] Furthermore, step S2 employs image enhancement technology to rapidly process video frames through noise reduction and contrast enhancement, thereby improving the quality of the residual bait video data and effectively mitigating underwater lighting unevenness and water ripple interference. The specific steps are as follows:

[0014] Step S201: Perform median filtering on the video frames for noise reduction. For each frame, this effectively smooths water surface reflections and random noise while preserving the edge features of the remaining bait, providing a clear base image for subsequent processing.

[0015] Step S202: Convert the image to the HSV color space. Convert each frame of the image from the RGB color space to the HSV color space so that the luminance channel can be processed separately, preparing for subsequent adaptive contrast enhancement;

[0016] Step S203: Apply the CLAHE (Adaptive Contrast Enhancement) algorithm. Apply the CLAHE algorithm to the luminance channel in the HSV color space to enhance the contrast between the uneaten bait and the water background, highlighting the characteristics of the uneaten bait;

[0017] Step S204: Convert back to RGB color space. Convert the processed HSV image back to RGB color space to ensure that the remaining bait is more visually noticeable, facilitating subsequent detection and tracking.

[0018] Furthermore, the YOLO model is used as a detector to achieve real-time and accurate detection of uneaten bait, and the improved SORT algorithm is used to stably track uneaten bait.

[0019] The improved SORT algorithm described above has the following characteristics:

[0020] A Center-Point-Based Target Association Method. Addressing the limitations of traditional IoU-based target association methods in sturgeon bait tracking, a center-point-based SORT algorithm is proposed. This method performs inter-frame target association by tracking the center point position of the bait, making it more suitable for small targets and dynamic water flow environments, effectively improving association accuracy.

[0021] An adaptive dynamic threshold matching strategy is employed. Based on the real-time target motion characteristics, the matching threshold is adaptively adjusted to address the matching confusion or missed matches that can easily occur with a fixed threshold, thereby improving the algorithm's robustness and counting accuracy.

[0022] The center-point-based target association method extracts the center-point coordinates of the remaining bait and combines them with inter-frame motion state prediction to calculate the Euclidean distance between center points for target matching. This overcomes the problem of traditional IoU methods easily failing to match when the remaining bait is small, the spacing is large, and the appearance is similar. The specific dimensional transformation is as follows:

[0023] Traditional SORT algorithms employ a target association method based on Intersection over Union (IoU), relying on the four-dimensional features of the target bounding box, including the coordinates of the top-left corner of the bounding box. ,width and height Target matching is performed by calculating the IoU value of the bounding boxes between frames. However, in the sturgeon bait scene, the bait is small and the bounding box overlap is low, resulting in a low IoU value, which affects the matching effect.

[0024] This method is improved to a target association method based on center points to extract the coordinates of the center point of the remaining bait. By combining inter-frame motion trajectory prediction with Kalman filter-predicted motion trajectories, inter-frame Euclidean distance is calculated for target association. By reducing feature dimensionality and focusing on positional relationships, the accuracy and stability of matching are significantly improved.

[0025] The adaptive dynamic threshold matching strategy is characterized in that:

[0026] Using the covariance matrix of the Kalman filter Real-time assessment of the center point of the remaining bait The prediction bias measures the uncertainty of the target's motion state.

[0027] Based on the covariance matrix diagonal elements and (respectively) and (Prediction variance of direction), calculate the uncertainty measure:

[0028]

[0029] Dynamic threshold formula:

[0030]

[0031] in, As the baseline threshold, This is the weighting factor.

[0032] Based on dynamic threshold selection for target matching, when the target's motion state is stable (with low uncertainty), the threshold approaches the baseline value to improve matching accuracy; when the target's motion state is turbulent (with high uncertainty), the threshold increases to avoid target loss. This strategy effectively overcomes the problems of fixed thresholds, which easily lead to target loss during rapid movement and mismatch during slow movement.

[0033] Furthermore, an improved SORT algorithm is used for target tracking of the remaining bait to ensure trajectory stability and provide reliable input for subsequent counting decisions based on counting lines. Specifically:

[0034] Step S301: Object Detection. Generate bounding boxes and their confidence scores using the YOLO detector, and calculate the coordinates of the bounding box center points as input for subsequent tracking algorithms.

[0035] Step S302: State Modeling. Based on the center point target association method, a 4D Kalman filter is assigned to each detected residual bait target, and its state vector is defined as [x, y, v]. x , v y ] represents the x and y coordinates of the center point and its velocity in the x and y directions, respectively (initial velocity is set to 0). Simultaneously, the state covariance matrix P is initialized as a diagonal matrix and its coefficients are increased by a preset value (e.g., 1000) to represent the significant uncertainty of the state vector at the initial moment. The covariance matrix P is used for dynamic threshold adjustment in subsequent data association.

[0036] Step S303: Data Association. The Hungarian algorithm is used to match the Kalman predicted position with the detection center point, and the cost is calculated based on Euclidean distance. An adaptive threshold strategy dynamically adjusts the matching range; for unmatched targets, a new tracking ID is assigned. This adaptive threshold matching strategy uses the covariance matrix P to evaluate the uncertainty of the target's motion state and dynamically adjusts the matching threshold: when the target's motion is stable, the threshold is decreased to improve matching accuracy; when the target's motion is violent, the threshold is increased to prevent target loss. This strategy effectively overcomes the shortcomings of fixed thresholds, which are prone to target loss during rapid movement and mismatch during slow movement.

[0037] Step S304: Trajectory Update and Management. For successfully matched trajectories, the Kalman filter state is corrected using the corresponding detection center point; for unmatched trajectories, the number of lost frames is accumulated, and the trajectory is deleted when consecutive losses exceed a preset threshold. To ensure the stability and continuity of the trajectory, the center point coordinates of each trajectory are stored in the historical records of the most recent frames to maintain trajectory consistency in the event of short-term detection loss or slight shift in detection position. After each frame is processed, the Kalman filter iteratively updates the state covariance matrix P in the prediction and update steps to dynamically reflect the uncertainty of the target's motion state. This tracking result provides a unique tracking ID for subsequent accurate counting based on counting lines.

[0038] Furthermore, the precise statistical analysis of the tracking results based on the dynamic counting line described in step S4 is characterized by the following steps:

[0039] S401: Screen adjustment and search range division;

[0040] Adjust the video frame to ensure the water flow direction is from top to bottom. Within a predetermined area in the vertical direction of the image (e.g., 20%–80% of the image height), divide this area into multiple horizontal intervals. The center coordinates of each interval represent the potential location of the counting lines to ensure a reasonable distribution of the counting lines.

[0041] S402: Detection density statistics;

[0042] Based on the target detection results of the YOLO model, the center point of the remaining bait in each frame is calculated. coordinate:

[0043]

[0044] in and These represent the top and bottom edges of the detection box (bounding box), respectively. The coordinates along the axis. Simultaneously, the center point of any remaining bait with a confidence level below the threshold is recorded. Coordinates are used to assess areas where problems may exist.

[0045] S403: Density and Problem Area Scoring;

[0046] For each search interval divided by S401, calculate the detection density (the number of uneaten bait centers falling into that interval) and the low confidence density (the number of uneaten bait centers with a confidence level below a threshold falling into that interval). Normalize both the detection density and the low confidence density.

[0047]

[0048]

[0049] The comprehensive scoring formula for each interval is as follows:

[0050]

[0051] A lower score indicates a lower detection density and fewer problem areas in that interval, making it more suitable as a counting line location.

[0052] S404: Density score smoothing;

[0053] The detection density score is smoothed using a fixed-window convolution operation to reduce noise and ensure the stability of the interval score.

[0054] S405: Counting line position selection;

[0055] Select the comprehensive score from the smoothed results. The lowest interval is selected as the primary counting line position. To improve the stability of the results, multiple regions with scores close to the lowest value (e.g., within ±5% of the lowest value) can be considered as candidate intervals. Then, the center is selected from these candidate intervals. The interval whose coordinates are closest to the preset reference position (e.g., 75% of the screen height) will have its final counting line positioned at the center of the selected interval. coordinate.

[0056] S406: Counting mechanism;

[0057] Based on the target tracking results obtained in step S3 and the counting line position determined in S405, the trajectory of the remaining bait is determined: when the center point of the same remaining bait moves from above to below the counting line in consecutive frames, it is counted as a valid count. Since the counting object is bound to a unique tracking ID, multiple counts caused by repeated detection can be effectively avoided, thus ensuring the accuracy and stability of the statistical results. By accumulating statistics on all trajectories, the total number of remaining baits in the video is obtained.

[0058] The beneficial effects of this invention are: by comprehensively applying video acquisition, image enhancement, target detection and tracking, and dynamic counting lines, this invention achieves accurate counting of uneaten bait. Attached Figure Description

[0059] Figure 1 This is a flowchart of the present invention.

[0060] Figure 2 This is a diagram showing the layout of the water exchange inlet monitoring system.

[0061] Figure 3 Flowchart for image enhancement.

[0062] Figure 4 This is a flowchart of the dynamic counting line. Detailed Implementation

[0063] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings, but the scope of protection of the present invention is not limited to the following description.

[0064] like Figure 1 As shown, a dynamic counting method for sturgeon uneaten bait based on multi-target tracking includes:

[0065] Step S1: Use an underwater camera to collect video data of uneaten feed in the water flow at the water exchange point of the sturgeon breeding pond;

[0066] Step S2: Optimize the quality of the acquired images using image enhancement techniques;

[0067] Step S3: Use the YOLO model as a detector to achieve accurate detection of uneaten bait, and use the improved SORT algorithm to stably track uneaten bait;

[0068] Step S4: Perform precise statistics on the tracking results based on the dynamic counting line.

[0069] Further, step S1 includes the following steps:

[0070] Step S101: As Figure 2 An industrial-grade waterproof underwater camera with a resolution of no less than 1080p is selected and installed above the water exchange port, with the lens pointing in the direction of the main water flow channel to ensure that the monitoring field of view covers the entire width of the water exchange port.

[0071] Step S102: 20–30 minutes after feeding, once the sturgeon has finished eating, start the camera to record continuously for at least 10 minutes to ensure a complete record of the entire process of uneaten food passing through the water exchange inlet with the water flow.

[0072] Step S103: Perform preliminary processing on the acquired video, cropping out segments unrelated to the movement of the remaining bait and retaining key footage.

[0073] Furthermore, such as Figure 3 Step S2 employs image enhancement technology, which rapidly processes video frames through noise reduction and contrast enhancement to improve the quality of residual bait video data and effectively alleviate underwater lighting unevenness and water ripple interference problems. The specific steps are as follows:

[0074] Step S201: Perform median filtering on the video frames for noise reduction. For each frame, this effectively smooths water surface reflections and random noise while preserving the edge features of the remaining bait, providing a clear base image for subsequent processing.

[0075] Step S202: Convert the image to the HSV color space. Convert each frame of the image from the RGB color space to the HSV color space so that the luminance channel can be processed separately, preparing for subsequent adaptive contrast enhancement;

[0076] Step S203: Apply the CLAHE (Adaptive Contrast Enhancement) algorithm. Apply the CLAHE algorithm to the luminance channel in the HSV color space to enhance the contrast between the uneaten bait and the water background, highlighting the characteristics of the uneaten bait;

[0077] Step S204: Convert back to RGB color space. Convert the processed HSV image back to RGB color space to ensure that the remaining bait is more visually noticeable, facilitating subsequent detection and tracking.

[0078] Furthermore, the YOLO model is used as a detector to achieve real-time and accurate detection of uneaten bait, and the improved SORT algorithm is used to stably track uneaten bait.

[0079] It should be noted that the YOLO model is a pre-trained model, and the preparation process for its training data is as follows:

[0080] Multi-target tracking annotation was performed using the DarkLabel tool. For the image-enhanced bait video, the bounding box of each bait was annotated frame by frame, ensuring that each bait was assigned a unique ID in the video sequence, thus generating continuous and consistent tracking data.

[0081] Enable semi-automatic tracking to optimize annotation efficiency. Utilize DarkLabel's built-in semi-automatic tracking algorithm to predict the displacement of residual bait in adjacent frames and automatically generate preliminary bounding boxes. Manual correction of deviations is only required, significantly reducing the workload of frame-by-frame annotation.

[0082] The distribution of uneaten bait was statistically analyzed. Based on the annotation results, the number of uneaten baits in each video segment was analyzed, and standardized counting data was generated.

[0083] Construct a counting dataset. Divide the labeled data into video segments and allocate them appropriately into training, validation, and test sets to construct a dataset for the bait counting task;

[0084] Construct an object detection dataset. Based on the partitioned dataset, perform frame extraction and data format conversion, transforming the extracted images and their annotation information into the standard format required by the YOLO model.

[0085] During the pre-training process, the YOLO model is trained using the training set and validated using the validation and test sets, thus obtaining the YOLO model as a detector.

[0086] It should be noted that the improved SORT algorithm described in step S3 has the following characteristics:

[0087] A Center-Point-Based Target Association Method. Addressing the limitations of traditional IoU-based target association methods in sturgeon bait tracking, a center-point-based SORT algorithm is proposed. This method performs inter-frame target association by tracking the center point position of the bait, making it more suitable for small targets and dynamic water flow environments, effectively improving association accuracy.

[0088] An adaptive dynamic threshold matching strategy is employed. Based on the real-time target motion characteristics, the matching threshold is adaptively adjusted to address the matching confusion or missed matches that can easily occur with a fixed threshold, thereby improving the algorithm's robustness and counting accuracy.

[0089] The center-point-based target association method extracts the center-point coordinates of the remaining bait and combines them with inter-frame motion state prediction to calculate the Euclidean distance between center points for target matching. This overcomes the problem of traditional IoU methods easily failing to match when the remaining bait is small, the spacing is large, and the appearance is similar. The specific dimensional transformation is as follows:

[0090] Traditional SORT algorithms employ a target association method based on Intersection over Union (IoU), relying on the four-dimensional features of the target bounding box, including the coordinates of the top-left corner of the bounding box. ,width and height Target matching is performed by calculating the IoU value of the bounding boxes between frames. However, in the sturgeon bait scene, the bait is small and the bounding box overlap is low, resulting in a low IoU value, which affects the matching effect.

[0091] This method is improved to a target association method based on center points to extract the coordinates of the center point of the remaining bait. By combining inter-frame motion trajectory prediction with Kalman filter-predicted motion trajectories, inter-frame Euclidean distance is calculated for target association. By reducing feature dimensionality and focusing on positional relationships, the accuracy and stability of matching are significantly improved.

[0092] It should be noted that the adaptive dynamic threshold matching strategy is characterized by:

[0093] Using the covariance matrix of the Kalman filter Real-time assessment of the center point of the remaining bait The prediction bias measures the uncertainty of the target's motion state.

[0094] Based on the covariance matrix diagonal elements and (respectively) and (Prediction variance of direction), calculate the uncertainty measure:

[0095]

[0096] Dynamic threshold formula:

[0097]

[0098] in, The baseline threshold is 3 in this example. This is the weighting factor (in this example, the value is 2.5).

[0099] Based on dynamic threshold selection for target matching, when the target's motion state is stable (with low uncertainty), the threshold approaches the baseline value to improve matching accuracy; when the target's motion state is turbulent (with high uncertainty), the threshold increases to avoid target loss. This strategy effectively overcomes the problems of fixed thresholds, which easily lead to target loss during rapid movement and mismatch during slow movement.

[0100] Furthermore, such as Figure 4 Step S4, which involves performing precise statistics on the tracking results based on a dynamic counting line, is characterized by the following steps:

[0101] S401: Screen adjustment and search range division;

[0102] Adjust the video frame to ensure the water flow direction is from top to bottom. Within a predetermined area in the vertical direction of the image (in this example, 30% to 80% of the image height), divide the area into multiple horizontal intervals. The center coordinates of each interval represent the potential location of the counting lines to ensure a reasonable distribution of the counting lines.

[0103] S402: Detection density statistics;

[0104] Based on the target detection results of the YOLO model, the center point of the remaining bait in each frame is calculated. coordinate:

[0105]

[0106] in and These represent the top and bottom edges of the bounding box, respectively. The coordinates along the axis. Simultaneously, record the center point of any remaining bait where the confidence level is below a threshold (0.5 in this example). Coordinates are used to assess areas where problems may exist.

[0107] S403: Density and Problem Area Scoring;

[0108] For each search interval divided by S401, calculate the detection density (counting the number of uneaten bait centers falling into that interval) and the low confidence density (counting the number of low-confidence uneaten bait centers falling into that interval). Normalize both the detection density and the low confidence density.

[0109]

[0110]

[0111] The comprehensive scoring formula for each interval is as follows:

[0112]

[0113] A lower score indicates a lower detection density and fewer problem areas in that interval, making it more suitable as a counting line location.

[0114] S404: Density score smoothing;

[0115] The detection density score is smoothed using a fixed-window convolution operation (in this example, a 3×3 mean kernel) to reduce noise and ensure the stability of the interval score.

[0116] S405: Counting line position selection;

[0117] Choose overall rating The lowest interval is used as the candidate counting line position. To improve the stability of the results, multiple regions with scores close to the lowest value can be considered as candidate intervals (in this example, all intervals with scores within the range of the lowest score plus 0.1 are considered as candidate intervals). From these candidate intervals, the center is selected. The coordinates are selected to be closest to the preset reference position range (in this example, 75% of the screen height is used as the reference position) to ensure that the counting line is located in the position after the remaining bait has undergone sufficient movement. The final counting line position is the center of the selected range. coordinate.

[0118] S406: Counting mechanism;

[0119] Based on the selected counting line, the unique ID of each uneaten bait is tracked. When the center point of the same uneaten bait moves from above to below the counting line in consecutive frames, it is recorded as a valid count to ensure accurate and duplicate counting. The total number of uneaten baits in the video is obtained by statistical analysis.

[0120] The foregoing description illustrates and describes a preferred embodiment of the present invention. However, as previously stated, it should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept described herein through the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A dynamic counting method for uneaten bait in sturgeon based on multi-target tracking, characterized in that: Includes the following steps: Step S1: Use an underwater camera to collect video data of uneaten feed in the water flow at the water exchange point of the sturgeon breeding pond; Step S2: Optimize the quality of the acquired images using image enhancement techniques; Step S3: Use the YOLO model as a detector to achieve accurate detection of uneaten bait, and use the improved SORT algorithm to stably track uneaten bait; In step S3, the improved SORT algorithm performs inter-frame target association by tracking the center point position of the remaining bait, and adopts an adaptive dynamic threshold matching strategy to adaptively adjust the matching threshold according to the real-time target motion characteristics in order to solve the matching chaos or missed matching that is easily caused by a fixed threshold. Step S4: Perform precise statistics on the tracking results based on the dynamic counting line; Step S4 includes: S401: Screen adjustment and search range division; Adjust the video feed to ensure the water flow is from top to bottom; Within a predetermined area in the vertical direction of the image, the area is divided into multiple horizontal intervals, and the center coordinates of each interval represent the potential location of the counting lines to ensure a reasonable distribution of the counting lines. S402: Detection density statistics; Based on the target detection results of the YOLO model, the center point of the remaining bait in each frame is calculated. coordinate: ; These represent the top and bottom edges of the bounding box, respectively. Coordinates along the y-axis center This represents the y-coordinate of the center point of the uneaten bait; simultaneously, it records the center points of uneaten bait with a confidence level below a threshold. coordinate; S403: Density and Problem Area Scoring; For each search interval divided by S401, the detection density and low confidence density are calculated; the detection density is calculated by counting the number of uneaten bait centers falling into the search interval, and the low confidence density is calculated by counting the number of low confidence uneaten bait centers falling into the interval. The detection density and low-confidence density are normalized to obtain N(d) and C(d), respectively; N(d) represents the normalized result of the detection density and C(d) represents the normalized result of the low-confidence density. The comprehensive scoring formula for each interval is as follows: ; S(y) represents the score of the interval. The lower the score, the lower the detection density and the fewer the problem areas in the interval, making it more suitable as the position of the counting line. S404: Density score smoothing; The detection density score is smoothed by using a fixed-window convolution operation to reduce the impact of noise and ensure the stability of the interval score. S405: Counting line position selection; Select the comprehensive score from the smoothed results. The lowest interval is selected as the preferred counting line position; to improve the stability of the results, multiple regions with scores close to the lowest value are considered as candidate intervals; among them, multiple regions with scores close to the lowest value refer to regions where the score differs from the lowest value by less than a set percentage threshold. Then, select the center from these candidate intervals. The interval whose coordinates are closest to the preset reference position will have its final counting line position at the center of the selected interval. coordinate; S406: Counting mechanism; Based on the target tracking results obtained in step S3 and the counting line position determined in S405, the trajectory of the remaining bait is determined: when the center point of the same remaining bait moves from above the counting line to below it in consecutive frames, it is counted as a valid count; since the counting object is bound to a unique tracking ID, multiple counts caused by repeated detection are avoided, ensuring the accuracy and stability of the statistical results; by accumulating statistics on all trajectories, the total number of remaining baits in the video is obtained.

2. The method for dynamic counting of uneaten bait in sturgeon based on multi-target tracking according to claim 1, characterized in that: Step S1 includes: Step S101: Select a waterproof underwater camera and install it above the water exchange inlet of the sturgeon breeding pond, with the lens facing the direction of the main water flow channel to ensure that the monitoring field of view covers the entire width of the water exchange inlet. Step S102: After the sturgeon has finished feeding, start the camera to record and continuously collect video data to obtain video data covering the movement of the remaining bait. Step S103: Perform preliminary processing on the acquired video, cropping out segments unrelated to the movement of the remaining bait and retaining key footage.

3. The method for dynamic counting of uneaten bait in sturgeon based on multi-target tracking according to claim 1, characterized in that: Step S2 employs image enhancement technology, rapidly processing video frames through noise reduction and contrast enhancement to improve the quality of residual bait video data and effectively alleviate underwater lighting unevenness and water ripple interference problems, including: Step S201: Median filtering is applied to the video frames for noise reduction: For each frame, the reflection on the water surface and random noise are effectively smoothed while the edge features of the remaining bait are preserved, providing a clear base image for subsequent processing. Step S202: Convert the image to HSV color space: Convert each frame of the image from RGB color space to HSV color space so that the luminance channel can be processed separately, in preparation for adaptive contrast enhancement; Step S203: Apply the CLAHE algorithm: Apply the CLAHE algorithm to the luminance channel in the HSV color space to enhance the contrast between the uneaten bait and the water background, highlighting the characteristics of the uneaten bait; where CLAHE refers to adaptive contrast enhancement. Step S204: Convert back to RGB color space: Convert the processed HSV image back to RGB color space to ensure that the residual bait is more visually noticeable, making it easier for subsequent detection and tracking.

4. The method for dynamic counting of uneaten bait in sturgeon based on multi-target tracking according to claim 1, characterized in that: The YOLO model is a pre-trained model used to accurately detect residual bait in the input image and output the detection results, which are the bounding box positions and the confidence scores corresponding to the bounding boxes in the image.

5. The method for dynamic counting of uneaten bait in sturgeon based on multi-target tracking according to claim 1, characterized in that: Step S3 includes: Step S301: Target detection. Use the YOLO detector to generate bounding boxes and their confidence scores for the enhanced image, and calculate the coordinates of the center point of the bounding boxes as input for subsequent tracking algorithms. Step S302: State Modeling: Based on the center point target association method, a 4D Kalman filter is assigned to each detected residual bait target, and its state vector is defined as [x, y, v]. x , v y ], representing the x and y coordinates of the center point and its velocity in the x and y directions, respectively, with the initial velocity set to 0; Meanwhile, the state covariance matrix P of the Kalman filter is initialized as a diagonal matrix, and the preset coefficients of the state covariance matrix P are enlarged as a whole to characterize the large uncertainty of the state vector at the initial time. The state covariance matrix P is used for dynamic threshold adjustment in subsequent data association. Step S303: Data Association: The Hungarian algorithm is used to match the Kalman predicted location with the detection center point, and the cost is calculated based on Euclidean distance. By using an adaptive threshold strategy to dynamically adjust the matching range, a new tracking ID is assigned to any detected targets that fail to match. The adaptive threshold matching strategy uses the state covariance matrix P to evaluate the uncertainty of the target motion state and dynamically adjusts the matching threshold: when the target motion is stable, the threshold is reduced to improve the matching accuracy; when the target motion is violent, the threshold is increased to prevent the target from being lost. Step S304: Trajectory Update and Management: For successfully matched trajectories, the Kalman filter state is corrected using the corresponding detection center point; For unmatched trajectories, the number of lost frames is accumulated. When the number of consecutive lost frames exceeds a preset threshold, the trajectory is deleted. To ensure the stability and continuity of the trajectory, the center point coordinates of each trajectory are stored in the historical records of the most recent frames to maintain the consistency of the trajectory in the event of short-term detection of missing frames or slight shifts in the detection position. After each frame is processed, the Kalman filter iteratively updates the state covariance matrix P in the prediction and update steps to dynamically reflect the uncertainty of the target's motion state. This tracking result provides a unique tracking ID for subsequent accurate counting based on counting lines.

Citation Information

Patent Citations

  • Fish identification method based on YOLOV5 improvement

    CN118609168A

  • Method and system for customized detection tracking and counting of people

    US20240338946A1