Fish culture behavior monitoring method based on laser geminate transistor array
Through laser tube array technology, combined with linear discriminant analysis, kernel density estimation and LightGBM model, fish behavioral characteristics are extracted, which solves the problem of low monitoring performance of existing technologies in complex underwater environments and achieves high-precision, low-cost Fish behavior monitoring.
Patent Information
- Application Number
- CN202410682445.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-05-29
AI Technical Summary
Existing fish monitoring technology based on machine vision has low performance in complex underwater environments due to insufficient lighting and turbid water quality, making it difficult to effectively monitor fish behavior.
A method of monitoring the behavior of farmed fish based on laser tube arrays is adopted. Signals are collected through laser tube arrays. Linear discriminant analysis and kernel density estimation are used to extract characteristics related to the number of fish groups, and an elastic network regression model is trained to predict the number of fish groups; from statistics, The time series and information entropy dimensions are used to extract the characteristics of fish school movement, and the LightGBM gradient boosting decision tree is used to predict the fish movement; two-dimensional kernel density estimation is used to describe fish dense areas, extract aggregation-related features, and train the LightGBM model to predict fish aggregation degree and Gathering center.
It achieves high-precision and low-cost fish behavior monitoring in complex underwater environments, overcomes the light and water quality limitations of traditional technology, provides long-distance, low-cost, and high-precision monitoring effects, and has broad application prospects.
Smart Images

Figure CN118734009A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of aquaculture monitoring, and in particular to a method for monitoring the behavior of farmed fish based on a laser pair tube array. Background Art
[0002] Fish behavior is an important signal that reflects the health status of fish and changes in their living environment. Timely identification and early warning of abnormal fish behavior can help to diagnose diseases at an early stage, optimize feeding and management strategies, improve survival rates and reproductive success rates, and protect biological welfare. In the past, monitoring of fish status mostly relied on post-capture anatomical analysis. With the advancement of technology, it has become possible to implant sensors in fish through surgery to achieve remote real-time monitoring.
[0003] Nowadays, with the development of computer vision technology, image-based analysis has gradually become mainstream. However, the existing mainstream fish monitoring methods, such as traditional camera methods, are limited by the absorption and scattering effects of water on light in underwater environments, and the image quality is poor, making it difficult to apply in complex aquaculture environments. Although infrared images can overcome the low-light problem to a certain extent, they have the same limitations when used underwater; for acoustic images, although sound waves have less energy attenuation underwater and have a higher penetration depth, high-performance acoustic equipment is expensive and has a high operating threshold, making it difficult to popularize and promote.
[0004] In contrast, laser-paired technology has shown unique advantages in the field of fish monitoring. The excellent underwater propagation performance brought by the concentrated energy of the laser beam, combined with its extremely high response speed, makes laser-paired technology particularly suitable for real-time monitoring scenarios. In addition, lasers have good anti-interference ability and accuracy, and can capture subtle target features in complex underwater environments. Through sparse laser-paired arrays, it can reduce costs while maintaining monitoring efficiency, which is conducive to its widespread application in the aquaculture industry. Summary of the invention
[0005] The purpose of this invention is to solve the problem of low performance of existing video image analysis technology based on machine vision in complex conditions such as insufficient light and turbid water in actual aquaculture environments, and propose a method for monitoring the behavior of farmed fish based on a laser tube array. This method has unique potential in identifying fish behavior in aquaculture due to its long-distance, low-cost, high-precision and strong anti-interference characteristics, and has certain application prospects and promotion value.
[0006] The purpose of the present invention can be achieved by adopting the following technical solutions:
[0007] A method for monitoring the behavior of farmed fish based on a laser tube array, characterized in that it comprises the following steps:
[0008] S1. Place the transmitting array and receiving array of the laser pair tube on both sides of the aquaculture tank to continuously collect signals of fish activities;
[0009] S2, using linear discriminant analysis to reduce the dimension of the multi-channel tube-pairing signals collected by the laser tube-pairing array in S1 into one signal, and using kernel density estimation to extract the fish population-related features of the reduced-dimensional signals;
[0010] S3, training an elastic network regression model for the fish population related features obtained in S2 to predict the fish population;
[0011] S4, extracting the fish school movement-related features from three dimensions: statistical features, time series features, and information entropy features for the multi-channel tube signals collected by the laser tube array in S1;
[0012] S5, based on the fish school movement related features obtained based on the laser tube array in S4, train the LightGBM gradient boosting decision tree to predict the fish school movement;
[0013] S6, using two-dimensional kernel density estimation to depict the fish school dense area for the multi-channel laser tube array collected in S1, and extracting the relevant characteristics of fish school aggregation degree by combining density map and isodensity lines;
[0014] S7, based on the fish aggregation related features obtained by S6 based on the laser tube array, train the LightGBM gradient boosting decision tree to predict the fish aggregation;
[0015] S8, using two-dimensional kernel density estimation to calculate the fish school aggregation center index for the multi-channel tube signals collected by the laser tube array in S1; and verifying the calculated fish school aggregation center index, and correcting it through linear transformation;
[0016] S9. Construct an analysis model of fish behavior based on the number of fish predicted in S3, the amount of fish movement predicted in S5, the fish aggregation degree predicted in S7, and the corrected fish aggregation center index in S8.
[0017] Furthermore, the step S1 includes the following steps:
[0018] S101. The laser pair tube consists of a laser transmitting tube and a laser receiving tube, which are placed on both sides of the aquaculture tank. The laser transmitting tube will emit a highly concentrated laser beam, while the laser receiving tube can detect the laser emitted by the laser transmitting tube and convert the optical signal into an electrical signal. Multiple laser pair tubes are arranged in a matrix with a length of x and a width of y, forming an x×y laser pair tube array. The spacing between adjacent laser pair tubes in the array is just larger than the size of the largest individual in the school of fish, so that a fish can only block the light path of one laser pair tube at a time;
[0019] S102, the laser tube continuously collects on-off signals. When a school of fish passes by a laser tube, the laser light path is blocked and the signal value is 1, indicating that the laser tube is triggered; when no school of fish passes by, the signal value is 0. The collected signal can be expressed as a three-dimensional binary array L(t,x,y) of t×x×y, where the dimension t corresponds to the time axis in a time window of length T frames, and x and y correspond to the row coordinate and column coordinate of the array on the plane, respectively.
[0020] Furthermore, the step S2 comprises the following steps:
[0021] S201, collect data from the laser tube array, and use the actual number of fish as the category label. Here, it is assumed that the total number of categories is C. The process of linear discriminant analysis is as follows:
[0022] First, calculate the scatter matrix S within each category w For each category (i.e., different number of fish schools) i, its scatter matrix can be calculated by the following formula:
[0023]
[0024] Among them, X i is the set of samples belonging to category i, μ i is the sample mean of category i; C is the total number of categories;
[0025] Next, calculate the inter-class scatter matrix S b . It can be calculated by the following formula:
[0026]
[0027] Among them, N i is the number of samples of category i, μ is the mean of all samples, μ i is the sample mean of category i;
[0028] Solve the generalized eigenvalue problem of linear discriminant analysis, that is, solve the matrix S w -1 S b The eigenvalues and corresponding eigenvectors of are shown in the following formula:
[0029] det(S w -1 S b -λI)=0
[0030] The det(·) function calculates the matrix determinant, I is the unit matrix, and the eigenvalue λ can be obtained by solving the eigenvalue equation 1 ,λ 2 ,…,λ d ,
[0031] (S w -1 S b -λ i I) i =0
[0032] For each eigenvalue λ i , solving the equations gives the corresponding eigenvector w i ;
[0033] Select the most important eigenvector according to the size of the eigenvalue as the projection matrix W;
[0034] Project the sample into the subspace formed by the selected eigenvectors, that is, perform a linear transformation:
[0035] Y=XW
[0036] Where X is the original data matrix, i.e., the x×y laser pair signal L(t,x,y), Y is the projected data matrix, i.e., the laser pair signal L'(t) reduced to one channel, and W is the projection matrix;
[0037] S202, using kernel density estimation to perform statistical analysis on the signal L'(t) after the linear discriminant analysis in S201, the formula is as follows:
[0038]
[0039] in, is the estimated value of the kernel density estimation curve at position x, T is the length of the observed signal L'(t), and K(·) is the Gaussian kernel function;
[0040] S203, calculating the mean value of the signal L'(t) as the first feature of the number of fish: calculating the mean value of the signal L'(t) is to sum L'(t) and divide it by the length T of L'(t);
[0041] S204, the kernel density estimation curve calculated in S202 The second to tenth features of the number of fish are extracted, which are:
[0042] Peak number: Use the differential operation to calculate the first-order difference of the signal Δf[n] = f[n]-f[n-1]. Then traverse the differential signal Δf[n] and find the point n that satisfies the conditions Δf[n]>0 and Δf[n+1]<0. These points are the peak points. Finally, count the number of peak points found, which is the peak number N. p ;
[0043] Main peak position: the position of the largest peak point in the kernel density estimation curve;
[0044] Main peak height: the height of the largest peak in the kernel density estimation curve, that is, the maximum value of the peak point;
[0045] Tail peak spacing: The distance between the leftmost tail peak (left tail peak) and the rightmost tail peak (right tail peak) of the kernel density estimation curve. The relative coordinates between the tail peaks are used to measure the position of the tail peaks.
[0046] Tail peak height: the average of the peak height of the left tail peak and the peak height of the right tail peak.
[0047] Curve support width: the interval where the probability density function is non-zero, that is, the horizontal axis span from the leftmost to the rightmost side of the kernel density estimation curve;
[0048] Tail width: the width of the tail area in the kernel density estimation curve, where the tail is the tail on both sides of the curve, that is, the area with an amplitude less than two standard deviations of the mean, is called the tail area; the mean is the mean calculated by S203;
[0049] Tail shape: Use a quadratic polynomial to fit the curve in the tail region, and then evaluate the tail shape based on the parameters of the quadratic polynomial. Assume that the kernel density estimation curve approximately follows a quadratic decay form in the tail:
[0050] f(x)∝ax 2 +bx+c
[0051] The parameter that needs attention is a, which is the coefficient of the quadratic term. By fitting the tail curve of the kernel density estimation curve, parameter a can be estimated to describe the tail shape.
[0052] Median point: The median point is obtained through the cumulative density function of the kernel density estimation. The abscissa where the cumulative density function is equal to 0.5 is the median point; the cumulative density function is the kernel density estimation curve The integral function of
[0053] S205, combining the first to tenth features of the number of fish in S203 and S204 to form a fish number feature vector X.
[0054] Furthermore, the process of step S3 is as follows: for the fish number feature extracted from the laser tube array signal, the actual fish number is used as a label to train an elastic network regression model; wherein the laser tube array signal is the multi-channel tube signal collected by the laser tube array; the model expression is as follows:
[0055] Assume there is a dataset consisting of features and labels Where X i is the feature vector composed of ten fish population features in S203, q iis the corresponding target variable, i.e. the number of fish, and n is the number of samples in the data set. The model expression of elastic network regression is as follows:
[0056]
[0057] in, is the target variable for prediction, X is i The feature matrix is composed of , β is the feature coefficient vector, and b is the intercept term. The loss function of elastic net regression consists of two parts, one is the mean square error (MSE), and the other is the penalty term of L1 norm and L2 norm:
[0058]
[0059] Among them, α is the regularization parameter, which controls the strength of the penalty term; ρ is the weight parameter of the L1 norm, which is used to adjust the degree of feature selection; q and are the true value and predicted value of the target variable respectively. By minimizing the loss function through gradient descent, we can get the optimal characteristic coefficient β and intercept term b, realize elastic network regression, and predict the number of fish as Q;
[0060] Furthermore, the step S4 comprises the following steps:
[0061] S401, extracting statistical features from the laser tube array signal, including a mean and a variance.
[0062] Mean: Calculation of the overall triggering times of the tube, the formula is:
[0063]
[0064] Wherein T is the time window length set in S102.
[0065] Variance: The variance of each pair of tubes is calculated independently, and finally the variance of each pair of tubes is aggregated and averaged to obtain the global variance of the overall data. The calculation formula is:
[0066]
[0067] S402, extracting timing features from the laser tube array signal, including differential and autocorrelation decay rates.
[0068] Difference: Calculate the difference between the data of the adjacent time points and find the absolute value, then sum the difference data:
[0069]
[0070] Autocorrelation decay rate: First, find the autocorrelation function of the tube data, and then use the exponential decay model to fit its decay rate.
[0071] The expression for the autocorrelation is:
[0072]
[0073] The expression of the exponential decay model is:
[0074] f(x)∝e -λx
[0075] Where λ is the decay rate parameter, which represents the decay rate of the curve. By fitting the curve of the above autocorrelation expression through the above exponential decay model, the obtained parameter λ is the autocorrelation decay rate;
[0076] S403, extracting information entropy features from the laser tube array signal, including sample entropy, differential entropy and conditional entropy.
[0077] Sample entropy: First, calculate the sum of the spatial dimensions x and y at each time point t to get S t :
[0078]
[0079] Each S t Considered as a sample, the probability distribution of all samples is calculated as follows:
[0080]
[0081] Finally, the sample entropy H is calculated using the following formula: s :
[0082]
[0083] Differential entropy: The calculation first takes the difference between each adjacent time point, as follows:
[0084]
[0085] Each D t As a sample, the probability distribution p(Dt) and differential entropy H can be obtained d .
[0086] Conditional entropy: Assume that the data frame of the current pipe is A, and B represents the data frame of the next pipe. p(A,B) represents the probability that the current pipe data is A and the next pipe data is B. In this case, the conditional entropy H(B|A) can be expressed as follows:
[0087]
[0088] Furthermore, the process of step S5 is to train the LightGBM gradient boosting decision tree model with the fish school movement amount feature extracted from the laser tube array signal and the actual fish school movement amount as a label, and the implementation process is as follows:
[0089] S501, the model will initialize a decision tree with only one leaf node as the initial model;
[0090] S502: Calculate the gradient of the loss function for each sample using the training data. For regression problems, the gradient is the difference between the predicted value and the actual value.
[0091] S503. According to the calculated gradient, a new decision tree is constructed. The tree is constructed in a depth-first manner. In the process of building a decision tree, LightGBM adopts a leaf node-based splitting strategy, that is, it selects an optimal splitting point from the current leaf node to generate a child node, and also uses a histogram algorithm to approximately find the best splitting point.
[0092] S504: When the maximum depth of the tree is reached or the splitting can no longer reduce the loss function, the splitting is stopped and the leaf node is set as the termination node.
[0093] S505: Update the predicted value of each leaf node to gradually approach the actual residual. The learning rate is used to control the update amplitude to prevent overfitting.
[0094] S506: Repeat the above steps until a stopping condition is met, such as reaching a predetermined number of trees or the loss function converges to a threshold.
[0095] S507, multiple decision trees are integrated into the final model. When predicting, the prediction results of each tree are weighted and summed to obtain the final predicted value of the movement of the fish school, which is A gr .
[0096] Furthermore, step S6 includes the following steps:
[0097] S601, the horizontal and vertical coordinates of the laser beam signal collected within a period of time with a value of 1 (i.e., a school of fish passes through the laser beam path area) are regarded as an observation data point (x i ,y i ), represents the coordinate value of the i-th data point, and the number of data points is recorded as N. A two-dimensional kernel density estimation is used to evaluate the overall density distribution of these data points. The two-dimensional Gaussian kernel function has the following form:
[0098]
[0099] σ x and σ yare the standard deviations along the x-axis and y-axis respectively. For a point (x, y) in two-dimensional space, its density estimate can be expressed as the weighted sum of all kernel functions at that point:
[0100]
[0101] S602. According to the calculation result of the two-dimensional kernel density estimation in S601, the following aggregation characteristics are extracted:
[0102] Density peak: The density value of the highest point in the density map:
[0103] D peak =max(D(x,y))
[0104] Density median: The middle value obtained by arranging all density values of the density map by size:
[0105] D median =Median(D(x,y))
[0106] Density energy: the sum of the squares of all density values in the density map:
[0107]
[0108] Density range: The difference between the maximum and minimum values in the density plot:
[0109] D range =max(D(x,y))-min(D(x,y))
[0110] Density interquartile range: The difference between the upper quartile and the lower quartile after the density values in the density map are arranged by size:
[0111] D interquartile =Q3-Q1
[0112] Among them, Q3 and Q1 are the upper quartile and the lower quartile respectively;
[0113] Density variance: The variance of all density values in the density map:
[0114]
[0115] Density Kurtosis: The kurtosis of the density plot is calculated using the fourth-order central moment:
[0116]
[0117] Density gradient: The gradient of the density map in space, that is, the rate at which the density changes:
[0118]
[0119] Main density area: the area of the area in the density map that is greater than a certain density threshold; the density threshold can be set to one-fifth of the density peak;
[0120] Length of isodense line: the mean length of each isodense line;
[0121] Main isodensity line deviation measurement: The main isodensity line is the one with the highest height among the isodensity lines, and its included area is the main density area;
[0122] The mean distance from each point on the main isodensity curve to the center:
[0123]
[0124] Among them, (x i ',y i ') represents the point on the main density curve, n is the number of points on the main density curve, represents the central coordinate of the principal density curve;
[0125] Moran's Index: Moran's Index is an indicator used to measure spatial autocorrelation in spatial statistics and can be calculated using the following formula:
[0126]
[0127] The Moran index can be calculated by the above formula, by summing the original acquisition signal L(t,x,y) in the time t dimension to obtain L'(x,y). Where L'(x,y) i and L'(x,y) j is the observation at location i and j, N is the total number of observations, is the average of all observations. ij is an element in the spatial weight matrix, representing the spatial relationship between positions i and j, and is taken as the distance between i and j. total is the sum of all elements of the weight matrix.
[0128] Furthermore, the process of step S7 is to train the LightGBM gradient boosting decision tree model with the fish aggregation features extracted from the laser tube array signal and the actual fish aggregation as a label to predict the fish aggregation G.
[0129] Furthermore, the step S8 comprises the following steps:
[0130] S801, based on the kernel density estimation density map of the laser tube array data obtained in S601, calculate the coordinates of its peak point as the estimated value of the aggregation center:
[0131]
[0132] That is, D in S602 peak The corresponding position;
[0133] S802, the estimated value calculated by the laser pair tube array is compared and verified with the true value, and the scales of the two are kept consistent through linear transformation to achieve correction of the calculated aggregation center, and finally the aggregation center of the fish school can be recorded as C. The true value is an accurate value obtained by reliable means.
[0134] Furthermore, the step S9 includes the following steps:
[0135] S901, for the fish school movement amount A predicted in S5 gr The average individual movement amount A can be calculated by the number of fish schools Q predicted in S3 in :
[0136] A in =A gr / Q
[0137] S902, combining the fish aggregation degree G predicted in S7 and the average individual movement amount A in Different thresholds are set for the fish school aggregation degree G, and they are divided into three qualitative levels: high level, medium level and low level; to indicate the differences in their activity level or aggregation density, and to conduct qualitative analysis of fish school behavior.
[0138] Compared with the prior art, the present invention has the following advantages and effects:
[0139] (1) The present invention is based on the laser-paired tube array for monitoring the behavior of farmed fish. With its excellent underwater penetration ability, low operation and maintenance cost, high-quality recognition and excellent anti-interference performance, it can effectively overcome the shortcomings of existing machine vision-based video image analysis technology in actual farming environments caused by turbid water quality, insufficient light and other reasons.
[0140] (2) The method for extracting the core index features of fish behavior based on the laser tube array proposed in this invention innovatively extracts effective features from the data collected by the laser tube array, paving the way for the regression prediction of various indicators. In terms of the number of fish, linear discriminant analysis is used to reduce the dimension of the data, and the number of fish is extracted in combination with kernel density estimation; in terms of the amount of movement index, the laser tube data is analyzed from three levels: statistics, time series, and information entropy; in terms of the degree of aggregation and the center of aggregation index, the density map and iso-density lines generated by two-dimensional kernel density estimation are used to mine the key spatial distribution features.
[0141] (3) The present invention innovatively implements regression prediction of various fish behavior indicators such as fish counting, movement, aggregation and aggregation center through the features extracted from the laser tube array data. In fish counting, the elastic network regression model is used, combining the penalty terms of L1 norm and L2 norm, and the complexity and feature selection ability of the model are controlled by adjusting the weight parameters of these two penalty terms. In the prediction of fish movement and aggregation indicators, the LightGBM gradient boosting decision tree regression model is used, which adopts the histogram-based decision tree learning method. Compared with the traditional gradient boosting tree algorithm, LightGBM has improved performance and efficiency, and has the advantages of automatically processing missing values, supporting categorical features, and high parallelism. BRIEF DESCRIPTION OF THE DRAWINGS
[0142] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0143] Figure 1 This is a general working flow chart of a method for monitoring the behavior of farmed fish based on a laser tube array disclosed in Example 1 of the present invention;
[0144] Figure 2 Schematic diagram of the arrangement of the laser tube array and the camera in Example 1 of the present invention;
[0145] Figure 3 is a result diagram of the linear discriminant analysis in Example 1 of the present invention;
[0146] Figure 4 is the density curve of the kernel density estimation in Example 1 of the present invention;
[0147] Figure 5 is a scatter plot of fish school activity prediction in Example 1 of the present invention;
[0148] Figure 6 is a density map of the two-dimensional kernel density estimation in Example 1 of the present invention;
[0149] Figure 7 is a scatter plot of fish aggregation prediction in Example 1 of the present invention;
[0150] Figure 8 It is the original fish school gathering center prediction scatter plot in Example 1 of the present invention;
[0151] Fig. 9 It is a calibrated fish school aggregation center prediction scatter plot in Example 1 of the present invention. DETAILED DESCRIPTION
[0152] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0153] Example 1
[0154] This embodiment discloses a method for monitoring the behavior of farmed fish based on a laser tube array. Figure 1 As shown, the specific steps are as follows:
[0155] S1. Use the laser array to collect signals of fish activities. In order to mark and verify the laser array data, a camera is used to collect fish activity videos. The specific implementation steps are as follows:
[0156] S101. Arrange the transmitting array and receiving array of the laser pair tube in a 4×4 matrix on both sides of the aquaculture tank, and continuously collect signals of fish activities at a sampling rate of 10Hz. Every 6000 frames (denoted as T) of the collected signal are intercepted as a sample. The collected signal can be represented as a 6000×4×4 three-dimensional binary array L(t,x,y), where the length of dimension t is 6000, corresponding to the time axis of the collection; the lengths of dimensions x and y are both 4, corresponding to the row and column coordinates of the array on the plane, respectively. When L(t,x,y) is equal to 0, it means that the laser pair tube at this position is in the on state, that is, the straight optical path between the pair tubes is not blocked by any object; and when the value of L(t,x,y) is 1, it means that the laser pair tube is interrupted, which usually means that a school of fish has blocked the laser beam emitted by the pair tube, causing the optical path to be broken. Assume that n samples are collected, and the data set is recorded as [L 1 ,L 2 ,...,L n ], where L n Represents the laser pair array data within a time window of length T;
[0157] S102, placing a camera on the other side of the aquaculture water tank, and synchronously collecting data with the laser tube array, the laser tube array and the camera are arranged as follows Figure 2 The collected video signal is segmented with the same time window size T (i.e., the length is 10 minutes), denoted as [V 1 ,V 2 ,...,V n ], where V n is a video signal of length T. V n will be the corresponding Ln Annotate and validate data.
[0158] S2. For the laser pair array signals collected in S1, each pair of tubes collected data is regarded as a feature independently, and the signals of 16 laser pair tubes are reduced to one dimension using linear discriminant analysis, and the features related to the number of fish are extracted by combining kernel density estimation. The specific implementation process is as follows:
[0159] S201. The implementation process of linear discriminant analysis first involves calculating the intra-category scatter matrix and the inter-category scatter matrix. Then, by performing eigenvalue decomposition on these two scatter matrices, their eigenvectors are obtained. Next, the eigenvectors are selected to form a projection matrix so that data points of different categories can be better separated in the projection space after projection. Finally, the original data is linearly transformed through the selected projection matrix, and the data is projected into a low-dimensional space to achieve data dimensionality reduction. The reduced-dimensional data set is represented as [L' 1 ,L' 2 ,...,L' n ], where L' n is a one-dimensional array of length T after each sample is reduced in dimension. The result after linear discriminant analysis is as follows Figure 3 As shown;
[0160] S202, the dimension-reduced data L' n Select the Gaussian kernel function for kernel density estimation, and use a small area (kernel) around each observation as a weight function. By summing and normalizing all kernel functions, the density function is estimated. The estimated density map is as follows: Figure 4 As shown;
[0161] S203, extracting ten features from the estimated density map, including the number of peaks, main peak position, main peak height, tail peak spacing, tail peak height, curve support height, tail thickness, tail shape, median point and mean, recorded as [X 1 ,X 2 ,...,X n ], where X n is a feature vector of length 10, corresponding to the ten features extracted from each sample;
[0162] S3, for the fish population related features obtained in S2, the actual number of fish population counted manually is used as the label: {(X 1 ,y 1 ),(X 2 ,y 2 ),...,(X n ,y n )}, where (X n ,y n) represents a set of feature vectors extracted from the laser tube array data and the actual number of fish labels. The elastic network regression model is trained with this data set to predict the number of fish. The results show that the mean square error of fish counting is 5.14 and the coefficient of determination is 0.961. Discrete prediction values are generated by retaining the integer part of the regression results, and the prediction values are compared with the actual number of fish labels to generate a confusion matrix, and the precision, recall and F1 scores are calculated for different numbers of fish:
[0163] Table 1 Precision, recall and F1 score of fish school counting
[0164] Number of fish Accuracy Recall F1 score 1 100% 100% 100% 2 100% 100% 100% 3 100% 99.10% 99.50% 4 96.60% 97.40% 97% 5 95.50% 90.70% 93% 6 88.10% 88.10% 88.10% 7 75.80% 79.70% 77.70% 8 69.30% 74.50% 71.80% 9 71.20% 75.40% 73.20% 10 91.40% 72% 80.60%
[0165] The results show that for the prediction of a relatively small number of fish, the model shows a high degree of accuracy, almost reaching the state of error-free prediction. As the size of the fish school increases, the performance of the model shows a gradual decline, but the overall error is small and within the acceptable error range. The number of fish schools predicted by elastic network regression is denoted as
[0166] S4, the laser tube array signal [L 1 ,L 2 ,...,L n ], from the statistical features, two features, mean and variance, are extracted; from the time series features, two features, difference and autocorrelation decay rate, are extracted; from the information entropy features, three features, sample entropy, difference entropy and conditional entropy, are extracted. The extracted features are denoted as [X' 1 ,X' 2 ,...,X' n ], where X' n is a feature vector of length 7, representing the motion-related features calculated from each sample in the laser-paired tube data;
[0167] S5, based on the fish movement related features obtained by the laser tube array in S4, train the LightGBM gradient boosting decision tree to predict the fish movement. The specific implementation process and results are as follows:
[0168] S501, video of synchronous acquisition of laser tube array [V 1 ,V 2 ,...,V n ], after preprocessing such as video denoising and grayscale, the Gaussian mixture model is used to extract the foreground. n The sum of the foreground area of each frame can be used to obtain the standard fish movement index [A 1 ,A 2 ,...,A n In order to unify the data range, the movement index [A1 ,A 2 ,...,A n ] Use min-max normalization to scale to the range of [1,100];
[0169] S502, the fish school movement characteristics [X' 1 ,X' 2 ,...,X' n ], with the standard motion amount for video processing [A 1 ,A 2 ,...,A n ] as annotation, we can get the data set: {(X' 1 ,A 1 ),(X' 2 ,A 2 ),...,(X' n ,A n )}, where X'' n is the motion feature extracted from the laser tube array data, Z' n The motion index obtained by video processing. The LightGBM gradient boosting decision tree regression model is trained with this dataset, the mean square error and determination coefficient of the prediction are calculated, and the performance is compared with other regression models:
[0170] Table 2. Comparison of regression model performance
[0171] Regression Model Mean square error Coefficient of determination LightGBM 5.77 0.965 Gradient Boosted Decision Tree (GBDT) 9.66 0.989 Decision Tree 42.6 0.955 Random Forest Regression 51.3 0.957 k-nearest neighbor regression 69.8 0.927 Elastic Net Regression 74.8 0.922 Support Vector Machine 88.3 0.908
[0172] The results show that the mean square error of the LightGBM model is 5.77 and the determination coefficient is 0.965, showing a significant performance advantage. The prediction scatter plot is as follows: Figure 5 As shown. The predicted movement of the fish school is
[0173] S6. For the laser tube array signal collected in S1, two-dimensional kernel density estimation is used to depict the fish school dense area, and the relevant features of the aggregation degree are extracted by combining the density map and isodensity lines. The specific implementation process is as follows:
[0174] S601, taking each data point as the center, placing a two-dimensional Gaussian kernel function around it, and then estimating the density by superimposing the kernel functions. The estimated density map is as follows: Figure 6 As shown:
[0175] S602. For the estimated density map and isopycnals, twelve features are extracted, including density peak, density median, density energy, density range, density interquartile range, density variance, density kurtosis, density gradient, main density region area, isopycnal length, main isopycnal deviation measurement and Moran index, which are denoted as [X”1 ,X” 2 ,...,X” n ], where X” n is a feature vector of length 12, representing the aggregation-related features calculated from each sample in the laser-paired tube data;
[0176] S7, based on the fish aggregation related features obtained based on the laser tube array in S6, train the LightGBM gradient boosting decision tree to predict the movement of fish schools. The specific implementation process and results are as follows:
[0177] S701, video of laser tube array synchronous acquisition [V 1 ,V 2 ,...,V n ], after preprocessing such as video denoising and grayscale, the centroid of the target fish school is detected using background subtraction and connected block extraction, and then the centroid of the individual fish school is segmented using Delaunay triangulation. n The sum of the side lengths of all triangles in each frame segmentation result can be used to obtain the standard fish aggregation index [G 1 ,G 2 ,...,G n In order to unify the data range, the aggregation index [G 1 ,G 2 ,...,G n ] Use min-max normalization to scale to the range of [1,100];
[0178] S702, the fish school aggregation characteristics obtained from the laser tube array in S6 are annotated with the standard aggregation of video processing, and the data set is obtained: {(X” 1 ,G 1 ),(X” 2 ,G 2 ),...,(X” n ,G n )}, where X” n is the concentration feature extracted from the laser tube array data, G n is the aggregation index obtained by video processing. The LightGBM gradient boosting decision tree regression model was trained with this dataset, and the calculated mean square error was 5.14 and the determination coefficient was 0.961. The prediction scatter plot is shown in the figure below. Figure 7 As shown, each evaluation index shows good prediction effect;
[0179] S8. For the laser tube array signal collected in S1, a two-dimensional kernel density estimation is used to calculate the aggregation center index; and the calculated aggregation center index is verified and corrected by linear transformation. The implementation process and results are as follows:
[0180] S801. Use two-dimensional kernel density estimation to obtain a density map of spatial distribution for the laser tube data. Calculate the horizontal and vertical coordinates of the maximum peak point in the density map as the aggregation center, which is recorded as in The horizontal and vertical coordinates of the cluster center of each sample, and the value range is defined as [0,100];
[0181] S802, video of laser tube array synchronous acquisition [V 1 ,V 2 ,...,V n ], after preprocessing such as video denoising and grayscale, the centroid of the target fish school is detected using background subtraction and connected block extraction, and then the centroid of the individual fish school is segmented using Delaunay triangulation. n The average centroid of all triangles in each frame segmentation result is calculated to obtain the standard fish gathering center coordinates [C 1 ,C 2 ,...,C n ], where C n is the horizontal and vertical coordinate value of the gathering center, and the value range is defined as [0,100];
[0182] S803, the gathering center of the laser tube data calculation Compared with the actual value of the cluster center calculated from the video [C 1 ,C 2 ,...,C n ] for comparative verification, the mean square error is 97.5, the determination coefficient is 0.802, and the prediction scatter plot is as follows Figure 8 As shown. The cluster center of the prediction After linear transformation and correction of the slope and intercept, the mean square error dropped from 97.5 to 17.1, a decrease of 82.5%. At the same time, the coefficient of determination increased from 0.802 to 0.966, an increase of 20.4%. The corrected prediction scatter plot is shown in the figure below: Fig. 9 As shown. The corrected clustering center is recorded as
[0183] S9: The amount of fish movement predicted in S5 The number of fish schools can be predicted by S3 To calculate the average individual exercise
[0184]
[0185] Combined with the fish aggregation degree predicted in S7 and the fish gathering center calculated in S8 The average individual exercise volume Aggregation and gathering centers Different thresholds are set to divide them into three qualitative levels. Average individual exercise index and fish aggregation It is divided into high level, medium level and low level to indicate the difference in activity or aggregation density. It is divided into three layers: upper layer, middle layer and lower layer, which represent the vertical distribution positions of fish in the aquaculture tank. Fish aggregation and gathering centers Based on the classification of fish school behavior indicators in the table below, it can be determined whether there are corresponding typical behaviors.
[0186] Table 3 Classification of typical fish school behaviors
[0187] Average individual exercise Fish aggregation Fish gathering center Panic behavior High level Low level Middle level Hypoxic behavior Low level High level upper layer Environmentally inappropriate behavior Low level High level Lower level Food grabbing behavior High level High level upper layer
[0188] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A method for monitoring the behavior of farmed fish based on a laser tube array, characterized in that: The following steps are involved: S1. Place the transmitting array and receiving array of the laser pair tube on both sides of the aquaculture tank to continuously collect signals of fish activities; S2, using linear discriminant analysis to reduce the dimension of the multi-channel tube-pairing signals collected by the laser tube-pairing array in S1 into one signal, and using kernel density estimation to extract the fish population-related features of the reduced-dimensional signals; S3, training an elastic network regression model for the fish population related features obtained in S2 to predict the fish population; S4, extracting the fish school movement-related features from three dimensions: statistical features, time series features and information entropy features for the multi-channel tube signals collected by the laser tube array in S1; S5, based on the fish school movement related features obtained based on the laser tube array in S4, train the LightGBM gradient boosting decision tree to predict the fish school movement; S6, using two-dimensional kernel density estimation to depict the fish school dense area for the multi-channel laser tube array collected in S1, and extracting the relevant characteristics of fish school aggregation degree by combining density map and isodensity lines; S7, based on the fish aggregation related features obtained by S6 based on the laser tube array, train the LightGBM gradient boosting decision tree to predict the fish aggregation; S8, using two-dimensional kernel density estimation to calculate the fish school aggregation center index for the multi-channel tube signals collected by the laser tube array in S1; and verifying the calculated fish school aggregation center index, and correcting it through linear transformation; S9. Construct an analysis model of fish behavior based on the number of fish predicted in S3, the amount of fish movement predicted in S5, the fish aggregation degree predicted in S7, and the corrected fish aggregation center index in S8.
2. The method for monitoring the behavior of farmed fish based on a laser tube array according to claim 1, characterized in that: The process of step S1 is as follows: S101. The laser pair tube is composed of a laser transmitting tube and a laser receiving tube, which are placed opposite to each other on both sides of the aquaculture tank; the laser transmitting tube emits a highly concentrated laser beam, and the laser receiving tube can detect the laser emitted by the laser transmitting tube and convert the optical signal into an electrical signal; multiple laser pair tubes are arranged in a matrix form of x length and y width to form an x×y laser pair tube array; the spacing between adjacent laser pair tubes in the array is just larger than the size of the largest individual in the school of fish, so that a fish can only block the optical path of one laser pair tube at a time; S102, the laser tube continuously collects on-off signals. When a school of fish passes by a laser tube, the laser light path is blocked and the signal value is 1, indicating that the laser tube is triggered; when no school of fish passes by, the signal value is 0. The collected signal can be expressed as a three-dimensional binary array L(t,x,y) of t×x×y, where the dimension t corresponds to the time axis in a time window of length T frames, and x and y correspond to the row coordinate and column coordinate of the array on the plane, respectively.
3. The method for monitoring the behavior of farmed fish based on a laser tube array according to claim 2, characterized in that: The step S2 comprises the following steps: S201, collecting data from the laser pairing array, using the actual number of fish as the category label, and projecting the x×y laser pairing signals L(t,x,y) to one laser pairing signal L'(t) through linear discriminant analysis to achieve signal dimensionality reduction; S202, using kernel density estimation to perform statistical analysis on the signal L'(t) after the linear discriminant analysis in S201, and obtain a kernel density estimation curve S203, calculating the mean of the signal L'(t) as the first feature of the number of fish; wherein calculating the mean of the signal L'(t) is to sum L'(t) and divide it by the length T of L'(t); S204, the kernel density estimation curve calculated in S202 The second to tenth features of the number of fish are extracted, which are: Peak number: Use the differential operation to calculate the first-order difference of the signal Δf[n]=f[n]-f[n-1]; then traverse the differential signal Δf[n] and find the point n that satisfies the conditions Δf[n]>0 and Δf[n+1]<0. These points are the peak points; finally, count the number of peak points found, which is the peak number N p ; Main peak position: the position of the largest peak point in the kernel density estimation curve; Main peak height: the height of the largest peak in the kernel density estimation curve, that is, the maximum value of the peak point; Peak spacing: the distance between the leftmost peak and the rightmost peak of the kernel density estimation curve, where the relative coordinates between the peaks are used to measure the positions of the peaks; Tail peak height: the average of the peak height of the left tail peak and the peak height of the right tail peak; Curve support width: the horizontal axis span from the leftmost to the rightmost side of the kernel density estimation curve; Tail width: the width of the tail region in the kernel density estimation curve, where the tail is the tail on both sides of the curve, that is, the region with an amplitude less than two standard deviations of the mean, is called the tail region; wherein the mean is the mean calculated in S203; Tail shape: A quadratic polynomial is used to fit the curve of the tail region, and then the tail shape is evaluated based on the parameters of the quadratic polynomial; the kernel density estimation curve approximately follows the quadratic decay form in the tail: f(x)∝ax 2 +bx+c The parameter a is the coefficient of the quadratic term. By fitting the tail curve of the kernel density estimation curve, the parameter a can be estimated to describe the tail shape. Median point: The median point is obtained through the cumulative density function of the kernel density estimation. The abscissa where the cumulative density function is equal to 0.5 is the median point; the cumulative density function is the kernel density estimation curve The integral function of S205, combining the first to tenth features of the number of fish in S203 and S204 to form a fish number feature vector X.
4. The method for monitoring the behavior of farmed fish based on a laser tube array according to claim 3, characterized in that: The step S3 comprises the following steps: for the fish population feature vector X extracted in S2, using the actual fish population as a label, training an elastic network regression model, and predicting the fish population as Q.
5. The method for monitoring the behavior of farmed fish based on a laser tube array according to claim 4, characterized in that: The process of step S5 is as follows: for the fish school movement amount related features extracted from the laser tube array signal, the actual fish school movement amount is used as a label to train the LightGBM gradient boosting decision tree model to achieve regression prediction of the fish school movement amount, and the predicted fish school movement amount is obtained as A gr ; Among them, the laser tube array signal is the multi-channel tube signal collected by the laser tube array.
6. The method for monitoring the behavior of farmed fish based on a laser tube array according to claim 5, characterized in that: The process of step S7 is: for the fish aggregation related features extracted from the laser tube array signal, the actual fish aggregation is used as a label, the LightGBM gradient boosting decision tree model is trained, and the fish aggregation G is predicted.
7. The method for monitoring the behavior of farmed fish based on a laser tube array according to claim 6, characterized in that: The step S9 comprises the following steps: S901, for the fish school movement amount A predicted in S5 gr The average individual movement amount A can be calculated by the number of fish schools Q predicted in S3 in : A in =A gr / Q S902, combining the fish aggregation degree G predicted in S7 and the average individual movement amount A in Different thresholds are set for the fish school aggregation degree G, and they are divided into three qualitative levels: high level, medium level and low level; to indicate the differences in their activity level or aggregation density, and to conduct qualitative analysis of fish school behavior.
Citation Information
Patent Citations
Underwater fish school observation device and method
CN112465778A
Fish type identification method and device and storage medium
CN113468247A
Fish school gathering behavior and fish school hunger behavior real-time analysis method based on density distribution
CN117409368A
Cited By
Method for adjusting aggregation degree and athletic ability of lutjanus erythropterus through light color parameters
CN120787847A
