A method for identifying abalone out-of-bounds behavior based on dynamic subtraction statistical characteristics
By performing block grayscale processing and difference analysis on aquaculture videos, the behavior of abalone crossing the boundary is identified, which solves the problems of high recognition accuracy and cost of existing methods in complex environments, and realizes efficient and low-cost abalone crossing-the-bounds detection.
Patent Information
- Application Number
- CN202510222595.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-02-27
AI Technical Summary
Existing target detection methods in aquaculture are sensitive to environmental noise, have difficulty distinguishing individual abalone in high-density farming, are costly, and have limited applicability in complex environments, making it difficult to accurately identify abalone crossing boundaries.
By dividing the video of abalone climbing the wall into blocks and grayscale processing, the difference between the grayscale value of the sampling frame and the average grayscale value of the video is calculated to form a difference sequence and an inter-frame difference matrix. The difference curve is drawn and the trend of the curve change is analyzed to identify abalone crossing the boundary.
It improves the accuracy and adaptability of identifying cross-border behavior of breeding abalone, enhances the adaptability to complex backgrounds and lighting changes, reduces hardware requirements, and is suitable for application in small and medium-sized farms.
Smart Images

Figure CN120164255B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image recognition, and in particular relates to a method for identifying abalone out-of-bounds behavior based on dynamic subtraction statistical characteristics. Background Art
[0002] In aquaculture, abalone, a high-value aquatic product, has a crucial impact on aquaculture efficiency and economic benefits through its reproduction and spawning behavior. Accurately monitoring its spawning behavior is key to achieving scientific aquaculture. Early warning monitoring of abalone spawning behavior beyond its designated limits can effectively prevent premature spawning, thereby avoiding the decline in seedling quality caused by incomplete gonadal maturation or unsuitable environmental conditions. This measure is crucial in abalone aquaculture, as the timing and state of abalone spawning directly determine the development, survival rate, and subsequent growth performance of the seedlings.
[0003] While modern target detection methods possess a high level of intelligence when applied to aquaculture, they also suffer from various limitations. First, they are sensitive to environmental noise, such as interference from suspended particles, bubbles, and light refraction, which can easily lead to false or missed detections. In high-density aquaculture, the close proximity or overlap of abalone can also make it difficult for the algorithm to distinguish individuals, affecting detection accuracy. Furthermore, these methods rely on large-scale annotated data and high-performance hardware, making training and updating models expensive, especially in diverse environments where frequent adjustments are required to adapt to new scenarios. Deep learning models often lack interpretability, have limited ability to identify rare abnormal behaviors, and struggle to cope with dynamic and complex scenarios. More importantly, their high cost and technical complexity limit their applicability to small and medium-sized farms, and their ability to control fine boundary detection and multi-target separation is also insufficient. These shortcomings pose numerous challenges to the application of modern target detection methods in complex aquaculture scenarios.
[0004] In order to overcome the above problems, the present invention proposes a method for identifying abalone out-of-bounds behavior based on dynamic subtraction statistical characteristics. Summary of the Invention
[0005] In order to solve the above technical problems, the present invention proposes a method for identifying abalone crossing-border behavior based on dynamic subtraction statistical characteristics to solve the problems existing in the above-mentioned prior art.
[0006] To achieve the above object, the present invention provides a method for identifying abalone crossing-border behavior based on dynamic subtraction statistical characteristics, comprising the following steps:
[0007] The video of the abalone climbing the wall was divided into blocks and grayscaled to obtain the average grayscale value of the video;
[0008] Extracting a sampling frame of the abalone wall-climbing video based on a sampling rate, and calculating a difference between a grayscale value of the sampling frame and an average grayscale value of the video to obtain a difference sequence;
[0009] Comparing the sampling frames in pairs to obtain an inter-frame difference matrix;
[0010] The difference sequence and the inter-frame difference matrix are respectively plotted into difference curves, and the abalone out-of-bounds behavior is determined based on the difference curves.
[0011] Optionally, the process of dividing and gray-scaling the video of the abalone climbing the wall to obtain an average grayscale value of the video includes:
[0012] The video of the abalone climbing the wall is divided into blocks to obtain block videos;
[0013] Gray-scaling the segmented video and calculating the pixel grayscale value of each frame image in the segmented video;
[0014] Calculating an average grayscale value of each frame of image based on the grayscale values of the pixels in each frame of image;
[0015] The average grayscale value of the video is obtained based on the average grayscale values of several frames of images.
[0016] Optionally, the calculation expression of the video average grayscale value is:
[0017]
[0018] Where, represents the average grayscale value of the video, n represents the total number of video frames, M×N represents the matrix obtained by graying the current frame, k represents the kth frame of video, i and j represent the rows and columns of pixels in the image respectively, and Y ij Represents the grayscale value of each pixel in each frame of the image.
[0019] Optionally, the process of performing pairwise comparison on the sampling frames to obtain an inter-frame difference matrix includes:
[0020] Dividing the sample frames into pairs to obtain a plurality of pairs of video frames;
[0021] Calculate the grayscale difference between each pair of video frames to obtain the mean grayscale difference;
[0022] A symmetric matrix is constructed based on the mean grayscale differences corresponding to several pairs of video frames to obtain an inter-frame difference matrix.
[0023] Optionally, the expression for calculating the grayscale difference mean is:
[0024]
[0025] Where Dij Represents the mean grayscale difference between two frames, F i (x,y) represents the grayscale value of frame i at position (x,y), F j (x,y) represents the grayscale value of frame j at position (x,y).
[0026] Optionally, the process of plotting the difference sequence into a difference curve to determine the abalone out-of-bounds behavior includes:
[0027] Plotting the difference sequence into a difference curve to obtain a first difference curve;
[0028] Calculating the first derivative of the first difference curve to obtain a curvature change rate;
[0029] If the curvature change rate at the current moment is higher than the average level, it is determined that abalone out-of-bounds behavior has occurred.
[0030] Optionally, the process of plotting the inter-frame difference matrix into a difference curve to determine the abalone crossing-border behavior includes:
[0031] Plotting the inter-frame difference matrix into a difference curve to obtain a second difference curve;
[0032] Calculating the mean and standard deviation of the second difference curve to set a dynamic threshold;
[0033] Traversing the second difference curve, when a point exceeding the dynamic threshold appears in the second difference curve, determining it as an abnormal point;
[0034] The abnormal point is matched with the time information of the boundary area. When the abnormal point occurs in the time period of the boundary area, it is determined that abalone crosses the boundary.
[0035] Compared with the prior art, the present invention has the following advantages and technical effects:
[0036] The present invention is based on a method for identifying cross-border behavior of abalone species based on the statistical characteristics of dynamic subtraction. Through precise grayscale processing and difference calculation, it realizes efficient identification of cross-border behavior of abalone species. First, the video of non-abalone climbing the wall is divided into blocks and grayscale processed to obtain the average grayscale value of the video, which provides a benchmark for subsequent analysis. Then, based on the sampling rate, the sampling frames are extracted, and the difference between their grayscale values and the average grayscale value of the video is calculated to form a difference sequence. This process effectively captures the basic changes between video frames. Furthermore, the sampling frames are compared pairwise to obtain the inter-frame difference matrix, which deeply explores the subtle dynamic differences between frames. Finally, the difference sequence and the inter-frame difference matrix are plotted into a difference curve. By analyzing the fluctuation and change trend of the curve, the cross-border behavior of abalone is accurately determined. This method not only improves the accuracy of recognition, but also enhances the adaptability to complex backgrounds and lighting changes. It provides strong technical support for the management of abalone species in aquaculture and has important practical application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0038] Figure 1 This is a flowchart of an abalone spawning early warning method based on image recognition and its application in an embodiment of the present invention;
[0039] Figure 2 This is a difference sequence calculation step according to an embodiment of the present invention;
[0040] Figure 3 This is a simulation diagram of inter-frame difference calculation according to an embodiment of the present invention;
[0041] Figure 4 is the grayscale difference between the sample frame and the average grayscale value of the video according to the embodiment of the present invention;
[0042] Figure 5 This is the image effect after dynamic subtraction processing in an embodiment of the present invention;
[0043] Figure 6 is the average grayscale value difference between the sampling frames in the embodiment of the present invention. DETAILED DESCRIPTION
[0044] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0045] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0046] Example 1
[0047] like Figure 1 As shown, in this embodiment, a method for identifying abalone crossing-border behavior based on dynamic subtraction statistical characteristics is provided, which performs well in processing complex backgrounds and dynamic environments. By combining segmentation subtraction with statistical characteristic analysis, this method can effectively cope with the challenges brought by background and illumination changes, and greatly improve the accuracy and robustness of detection. It includes the following steps: dividing the video of abalone climbing the wall into blocks and grayscale processing to obtain the average grayscale value of the video; extracting the sampling frames of the video of abalone climbing the wall based on the sampling rate, and calculating the difference between the grayscale value of the sampling frame and the average grayscale value of the video to obtain a difference sequence; performing pairwise comparison on the sampling frames to obtain an inter-frame difference matrix; respectively drawing the difference sequence and the inter-frame difference matrix into difference curves, and determining the abalone crossing-border behavior based on the difference curve.
[0048] Step 1: First, divide the video of the abalone climbing the wall into blocks and then take a part of it for grayscale processing to obtain several block videos. Based on the several block videos, calculate the average grayscale value of the entire video. This average grayscale value is used as the standard and recorded as The steps for calculating the difference sequence are as follows: Figure 2 shown.
[0049] ① Each frame of the video consists of m×n pixels, and each pixel is represented by three color channels: red R, green G, and blue B. The grayscale value Y of each pixel in each frame is ij It can be calculated using the following weighted average formula:
[0050] Y ij =0.299×R ij +0.587×G ij +0.114×B ij
[0051] Here, i and j represent the row and column of pixels in the image, respectively.
[0052] ② For a certain frame k of the video, the grayscale frame is an M×N matrix. The average grayscale value Y of the frame is k It can be expressed as:
[0053]
[0054] in, Represents the grayscale value of position (i, j) in the kth frame.
[0055] ③Assuming that the video consists of n frames, the average grayscale value of the entire video can be expressed as Y:
[0056]
[0057] The average grayscale value of the entire video is the sum of the grayscale values of all pixels in all frames, divided by the total number of all pixels in the video. Each video frame is grayscaled, and the grayscale value of each pixel is accumulated and averaged.
[0058] Secondly, this embodiment extracts specific frames from the video according to the set sampling rate and calculates the difference between the grayscale values of these frames and the above-mentioned video average grayscale value Y. This difference is used to analyze the changes between frames:
[0059]
[0060] Among them, ΔY m It is the absolute difference between the average gray value of the mth sampling frame and the "standard".
[0061] The sampling interval is Where FPS is the frame rate of the video, and s is the number of sampled frames per second; thus, a sampled difference sequence is obtained, which paves the way for the statistical analysis of abalone behavior in step 3 below.
[0062] Step 2: Compare the sampled frames of the video in pairs and calculate the grayscale difference between each pair of frames. Specifically, the difference between the two grayscale frames is quantified by calculating the absolute difference between them. These difference values are stored in a symmetric matrix, and the upper triangular part is finally extracted to analyze the changes between frames, such as Figure 3 shown.
[0063] ① Assume that the grayscale images corresponding to the i-th frame and the j-th frame in the video are F i and Fj, each element in the frame difference matrix D ij Represents the mean grayscale difference between two frames:
[0064]
[0065] Where M and N are the width and height of the frame respectively; F i (x,y) represents the grayscale value of frame i at position (x,y).
[0066] ② The frame difference matrix D is a symmetric matrix, and only its upper triangular part needs to be extracted for statistical analysis.
[0067]
[0068] The matrix size is n×n, and the upper triangular part contains By traversing the upper triangular matrix row by row and column by column, these elements are collected into a one-dimensional array.
[0069] Step 3: Quantify and describe the dynamic characteristics of the video content by performing statistical analysis on the grayscale differences between frames, thereby revealing the differences between different videos or the change patterns within a specific video.
[0070] ① The difference sequence ΔY obtained in step 1 above m It represents the grayscale difference of each sampling frame. In this embodiment, these differences are plotted into a difference curve to obtain a first difference curve. This curve will show the trend of grayscale changes between frames in the video, and can intuitively reflect the dynamic changes in the video; further statistical analysis can be performed to observe the rate of change of the curve by calculating the first-order derivative of the first difference curve. If the derivative value at a certain moment is significantly higher than the average level or the value of the surrounding points, it means that a more drastic change has occurred at this moment. That is, when the cross-border behavior of the species occurs, the first-order derivative at a certain moment will be significantly higher than the average level.
[0071] ② The one-dimensional array of inter-frame differences obtained in the above step 2 is plotted into a difference curve to obtain a second difference curve. This curve reflects the distribution of grayscale differences between different frames, and the trend of grayscale changes between frames can be intuitively seen. Statistical analysis is performed on the difference curve to represent the grayscale difference between frames. The dynamic threshold is set by statistically analyzing the overall mean and standard deviation of the difference curve, and the threshold is set by the statistical result to judge the abalone wall. The dynamic threshold formula is: T = μ + k·σ, where k is the amplification factor; this threshold dynamically adapts to the overall level and fluctuation of the difference curve, and there is no need to set a fixed value. Traverse the difference curve and find the point that exceeds the dynamic threshold T, that is: ΔG i > T, it is determined to be an outlier. These outliers are matched with the time information of the boundary area. If the outlier occurs during the time period of the boundary area, it can be determined that the abalone has crossed the boundary.
[0072] As specific implementations of this example, the present invention used a conventional subtraction method, YOLOv8, and an image recognition-based abalone spawning warning method to conduct experiments on abalone out-of-bounds behavior. The performance comparison between the abalone out-of-bounds behavior recognition method based on dynamic subtraction statistics and existing target detection methods is shown in Table 1.
[0073] Table 1
[0074]
[0075] Table 1 compares the proposed method for identifying abalone crossing-bounds behavior based on dynamic subtraction statistics, conventional subtraction methods, and YOLOv8. The results demonstrate that the image recognition-based abalone spawning warning method outperforms other methods in terms of precision, recall, F1 score, and false alarm rate for detecting abalone spawning on the wall, making it more suitable for practical applications.
[0076] The difference curve is statistically analyzed by the method proposed in the present invention. First, the video of the abalone climbing the wall is divided into blocks, and a portion of the video frames are selected for grayscale conversion. The average grayscale value of the entire video is calculated, which is 109.48. Then, the grayscale value of the sampled frame is analyzed with the overall average grayscale value of the video to obtain the difference curve. Figure 4 As shown in the figure, the difference curve shows significant changes at the critical moments when the abalone enters or leaves the detection area. This change is mainly manifested in that when the abalone enters the detection area (i.e., crosses the boundary), the difference between the grayscale value of the sampling frame and the overall average grayscale value increases sharply, and the interpolation effect is particularly obvious. When the abalone crawls out of the detection area, the difference value also fluctuates significantly.
[0077] The significance of this difference can be reflected through the morphological changes in the difference curve, thereby achieving accurate detection and judgment of abalone's cross-border behavior. More specifically, the difference curve will show large fluctuations and drastic changes at the boundary of the detection area. Through statistical analysis of the difference curve, the regular characteristics of grayscale changes in the video can be further quantified. At the same time, this method can reveal the entire dynamic process of abalone from entering the detection area to crawling out of the detection area through the changes of each key point in the difference curve, providing a reliable theoretical basis and statistical support for judging abalone's cross-border behavior.
[0078] like Figure 5 The figure shows the image effects of abalone after dynamic subtraction processing when and when abalone is crossing the boundary. These processed images intuitively reflect the different characteristics of abalone behavior. When abalone crosses the boundary, the dynamic subtraction effect is obvious, which can highlight the movement trajectory and changes of the abalone within the detection area. When there is no cross-border behavior, the dynamic subtraction image is relatively stable, with almost no significant changes. This dynamic subtraction method effectively extracts the movement characteristics of abalone and provides strong visual support for the rapid detection and differentiation of cross-border behavior.
[0079] By comparing the sample frames of the abalone climbing wall video pairwise, the grayscale difference between each pair of frames can be calculated, thereby achieving accurate detection and analysis of abalone crossing the boundary. Specifically, this process is achieved by calculating the absolute difference between the corresponding pixels of the two grayscale images. That is, by calculating the difference between the two grayscale frames pixel by pixel and taking the absolute value, the grayscale difference matrix between the frames can be obtained. These inter-frame difference values are stored in a symmetric matrix, where each element D of the matrix is ij represents the average grayscale difference between sample frames i and j. Since the matrix is symmetrical, only the upper triangular part needs to be extracted for subsequent statistical analysis.
[0080] In specific operation, this embodiment performs a dynamic analysis of the difference sequence of the extracted upper triangular part data. By comparing the changes of these differences over time, the regularity of the grayscale difference between video frames can be observed, such as Figure 6 As shown in the figure, when an abalone crosses the detection zone, the inter-frame difference sequence undergoes significant changes, manifested as a sudden increase or dramatic fluctuation in the difference amplitude. This phenomenon is primarily attributed to the abalone's significant motion characteristics when entering or leaving the detection zone, which leads to a sudden increase in the inter-frame grayscale value change.
[0081] Furthermore, analysis of the inter-frame grayscale difference matrix can reflect the dynamic changes in video content, providing an efficient and reliable quantitative method for detecting abalone's out-of-bounds behavior. Through structured storage and dynamic analysis of the difference matrix, it is possible to accurately capture the points where dramatic changes in inter-frame grayscale differences occur. These changes correspond precisely to the key moments when abalone enters or leaves the detection area. This analysis method not only improves the accuracy of out-of-bounds detection but also provides a highly versatile solution for capturing target behavior in dynamic scenarios.
[0082] Based on the above experimental results, the accuracy rate of the abalone spawning warning method based on dynamic subtraction statistical characteristics proposed in the present invention reaches 87.23%. Through the comparative analysis of different grayscale differences, it provides a reliable theoretical basis and practical support for the detection and identification of abalone spawning behavior beyond the boundary. By analyzing the difference between the grayscale value of the sampling frame and the overall average grayscale value of the video, the key behavioral characteristics of abalone crossing the boundary to enter or leave the detection area can be accurately captured; and through the dynamic statistical analysis of the inter-frame grayscale difference matrix, the regularity of the inter-frame changes in the video can be further revealed, especially the significant fluctuation of the inter-frame grayscale difference when the abalone spawning behavior beyond the boundary occurs. This patented method provides an efficient, reliable and universal technical solution for abalone spawning warning.
[0083] The proposed analysis method based on inter-frame grayscale differences does not rely on object detection frameworks, but directly identifies abalone behavior through grayscale changes between video frames. This makes the method simpler and more flexible, while also requiring less hardware.
[0084] By calculating the mean and standard deviation of the difference curve and setting a dynamic threshold, the present invention can adaptively adjust sensitivity to different video content. In complex backgrounds or lighting conditions, the dynamic threshold can automatically adjust to the dynamic changes in the video, reducing false positives. Compared with traditional methods based on background modeling or static thresholds, dynamic thresholds can better cope with grayscale differences in different environments, improving detection accuracy and robustness.
[0085] The above are merely preferred embodiments of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for identifying abalone out-of-bounds behavior based on dynamic subtraction statistical characteristics, characterized in that: The following steps are involved: The video of the abalone climbing the wall was divided into blocks and grayscaled to obtain the average grayscale value of the video; Extracting a sampling frame of the abalone wall-climbing video based on a sampling rate, and calculating a difference between a grayscale value of the sampling frame and an average grayscale value of the video to obtain a difference sequence; Comparing the sampling frames in pairs to obtain an inter-frame difference matrix; The process of obtaining the inter-frame difference matrix includes: dividing the sample frame into pairs to obtain a plurality of pairs of video frames; calculating the grayscale difference between each pair of video frames to obtain a grayscale difference mean; constructing a symmetric matrix based on the grayscale difference mean values corresponding to the plurality of pairs of video frames to obtain an inter-frame difference matrix; The difference sequence and the inter-frame difference matrix are respectively plotted into difference curves, and the abalone out-of-bounds behavior is determined based on the difference curves; The process of plotting the inter-frame difference matrix into a difference curve to determine the abalone crossing-border behavior includes: plotting the inter-frame difference matrix into a difference curve to obtain a second difference curve; statistically calculating the mean and standard deviation of the second difference curve to set a dynamic threshold; traversing the second difference curve, and when a point exceeding the dynamic threshold appears in the second difference curve, it is determined to be an abnormal point; and matching the abnormal point with the time information of the boundary area, when the abnormal point occurs in the time period of the boundary area, it is determined that the abalone crossing-border behavior occurs.
2. The method for identifying abalone crossing-border behavior based on dynamic subtraction statistical characteristics according to claim 1 is characterized in that: The process of dividing and graying the video of the abalone climbing the wall to obtain the average grayscale value of the video includes: The video of the abalone climbing the wall is divided into blocks to obtain block videos; Gray-scaling the segmented video and calculating the pixel grayscale value of each frame image in the segmented video; Calculating an average grayscale value of each frame of image based on the grayscale values of the pixels in each frame of image; The average grayscale value of the video is obtained based on the average grayscale values of several frames of images.
3. The method for identifying abalone crossing-border behavior based on dynamic subtraction statistical characteristics according to claim 2 is characterized in that: The calculation expression of the average gray value of the video is: Where, Represents the average grayscale value of the video, n represents the total number of video frames, M×N represents the matrix obtained by graying the current frame, k represents the kth frame of video, i and j represent the rows and columns of pixels in the image respectively, Represents the grayscale value of each pixel in each frame of the image.
4. The method for identifying abalone crossing-border behavior based on dynamic subtraction statistical characteristics according to claim 1 is characterized in that: The expression for calculating the mean grayscale difference is: Where, represents the mean grayscale difference between two frames, Represents a frame In position The gray value at Represents a frame In position The gray value at .
5. The method for identifying abalone crossing-border behavior based on dynamic subtraction statistical characteristics according to claim 1 is characterized in that: The process of plotting the difference sequence into a difference curve to determine the abalone out-of-bounds behavior includes: Plotting the difference sequence into a difference curve to obtain a first difference curve; Calculating the first derivative of the first difference curve to obtain a curvature change rate; If the curvature change rate at the current moment is higher than the average level, it is determined that abalone out-of-bounds behavior has occurred.
Citation Information
Patent Citations
Elevator passenger comprehensive safety intelligent monitoring method based on machine vision
CN106241533A
Fruit fly climbing detection and tracking method based on background reduction, frame difference and Meanshift algorithm
CN112183420A