A method for detecting fish feeding response based on dictionary learning
The dictionary learning method is combined with the Lucas-Kanade optical flow method and the K-SVD iteration method to optimize the structure dictionary and sparse representation, which solves the problem of inaccurate sparse vector detection in the existing technology and improves the efficiency of fish feeding response detection.
Patent Information
- Application Number
- CN201910459997.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing fish feeding response detection methods fail to effectively consider the structural information inside the sparse vector when solving sparse vectors, resulting in inaccurate detection and low efficiency.
A method based on dictionary learning is used, combined with the Lucas-Kanade optical flow method to extract optical flow information of feature points, and the K-SVD iterative method is used to optimize the structural dictionary and sparse representation coefficients, and reference events are combined to learn and detect the structured dictionary.
The detection rate of fish feeding reaction detection is improved, which is 8% to 15% higher than the existing technology.
Smart Images

Figure CN110211154B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for detecting fish feeding reactions based on dictionary learning, and belongs to the technical field of digital image processing. Background Art
[0002] In recent years, with the development of animal stress-related disciplines, people have paid more and more attention to the study of fish stress biology. This paper expounds the concept of stress, the occurrence and harm of fish stress, mainly including the impact of stress response on the growth, behavior and body health of fish. Corresponding mitigation measures are proposed from the perspective of feed feeding. Finally, the problems between feed feeding and fish stress response are analyzed, and its development prospects are prospected, aiming to provide a reference for the research and application of healthy aquaculture and fish conservation biology.
[0003] Existing behavioral response methods produced by feeding usually use large-scale global pixels as dictionaries each time when selecting local background pixels, which brings a large computational burden to solving sparse vectors; when solving sparse vectors, the structural sparse information inside the sparse vectors is not considered, resulting in inaccurate solution of sparse vectors and low target detection efficiency. Summary of the invention
[0004] In view of the above-mentioned defects in the prior art, the present invention proposes a method for detecting fish feeding response based on dictionary learning.
[0005] The method for detecting fish feeding response based on dictionary learning of the present invention comprises the following steps:
[0006] Step 1: Preprocessing: grayscale and denoise the image Ft to obtain the preprocessed image Ft';
[0007] Step 2: Feature point extraction: Extract feature points from the image Ft' to obtain a series of feature points;
[0008] Step 3: Calculation of velocity value matrix and velocity direction matrix: including the following steps:
[0009] Step 1: Use the Lucas-Kanade optical flow method to extract the optical flow information at the feature points, calculate the speed of each feature point in each frame, and obtain the speed value matrix Vectort and the speed direction matrix Angle t , remove the values that are too large or too small in the matrix to filter out the noise caused by the change of ambient light, and finally only retain the speed formed by the movement of the object;
[0010] Step 2: The frame at time t is F t , the frame after Δt is F t+Δt pt is the previous feature point of Ft, with coordinates (xi, yi), p t+Δt Ft+Δt The corresponding feature point on the graph has coordinates (xj, yj);
[0011] The horizontal components of the velocity vector are Vx=Δx / Δt, Vy=Δy / Δt,
[0012] Then the value of the velocity vector of this feature point is:
[0013]
[0014] α=arctan(Vx / Vy)
[0015] Where α is the angle between the velocity vector of the current feature point and the horizontal axis;
[0016] Then the matrix formed by the velocity value of each feature point is the velocity value matrix of this frame, and the velocity direction value of each feature point constitutes the velocity direction matrix of this frame;
[0017] Step 4: Acceleration matrix construction: Based on the velocity matrix and velocity direction matrix of two adjacent frames, calculate the acceleration matrix At of each frame;
[0018] Step 5: Solve the acceleration of the feature point based on the vector triangle (the speed difference of the feature point per unit time). is the velocity of the feature point in the previous frame, is the speed of the current frame, then , is the magnitude of the speed change, , (ΔVx, ΔVy are the two components of the velocity change of the point in two frames);
[0019] , ;
[0020] The acceleration of the feature point is ,
[0021] , βt is the angle between the acceleration vector and the horizontal direction, βt=arctan(ΔVx / ΔVy);
[0022] This constitutes the acceleration matrix At;
[0023] Step 6: Calculate the frame average acceleration: Take all pixels of the current frame as a whole, and take the average acceleration of all feature points with non-zero acceleration in the acceleration matrix of the current frame as the frame average acceleration of the fish school in the current frame, set as ,but ,
[0024] Among them, p i is a motion feature point with non-zero acceleration in the current frame, a t(p i ) is p i The acceleration of n is the number of all motion feature points with non-zero acceleration in the current frame;
[0025] Step 7: Feeding reaction detection: Set a training set, and set an appropriate frame average acceleration threshold based on the training set. The value above the threshold is the behavioral reaction caused by feeding;
[0026] Step 8: Dictionary learning: Combine sparse representation with structural information and use structured dictionaries for learning and detection, including the following steps:
[0027] Step 1: Introducing reference events for the learning process of structured dictionaries;
[0028] Step 2: Use K-SVD iterative method to optimize the structural dictionary and sparse representation coefficients.
[0029] Preferably, in the first step of step eight, the reference event cited includes fish school motion characteristics, and the HS optical flow method is used to extract the gradient histogram.
[0030] Preferably, in the first step of step eight, the reference event is a collection of normal events, the normal events have similar characteristics, and smoothing regularization is used to describe the relationship between the normal events.
[0031] Preferably, in the first step of step eight, the similar features include similar movement conditions of the school of fish and the relative positions of the school of fish.
[0032] Preferably, in the second step of step eight, the structure dictionary and the sparse representation coefficients are optimized using the K-SVD iteration method, including the following steps:
[0033] a. Learning process: The learning process of the structured dictionary includes the extraction of fish movement features in the reference event, smoothing and regularizing of the features, and optimization of the sparse coefficients through iteration;
[0034] b. Detection process: Utilize the learned structured dictionary and combine it with reference events to detect events in the video sequence containing fish schools.
[0035] The beneficial effects of the present invention are as follows: the method for detecting fish feeding reactions based on dictionary learning of the present invention, by using the Lucas-Kanade optical flow method to extract optical flow information at feature points and using the K-SVD iterative method to optimize the structural dictionary and sparse representation coefficients, the obtained detection result is 8% to 15% higher than the detection rate of the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a principle flow chart of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose and technical solution of the present invention more clear, the present invention is further described in detail below in conjunction with embodiments.
[0038] Embodiment 1:
[0039] like Figure 1 As shown, the method for detecting fish feeding response based on dictionary learning of the present invention comprises the following steps:
[0040] Step 1: Preprocessing: grayscale and denoise the image Ft to obtain the preprocessed image Ft';
[0041] Step 2: Feature point extraction: Extract feature points from the image Ft' to obtain a series of feature points;
[0042] Step 3: Calculation of velocity value matrix and velocity direction matrix: including the following steps:
[0043] Step 1: Use the Lucas-Kanade optical flow method to extract the optical flow information at the feature points, calculate the speed of each feature point in each frame, and obtain the speed value matrix Vectort and the speed direction matrix Angle t , remove the values that are too large or too small in the matrix to filter out the noise caused by the change of ambient light, and finally only retain the speed formed by the movement of the object;
[0044] Step 2: The frame at time t is F t , the frame after Δt is F t+Δt pt is the previous feature point of Ft, with coordinates (xi, yi), p t+Δt F t+Δt The corresponding feature point on the graph has coordinates (xj, yj);
[0045] The horizontal components of the velocity vector are Vx=Δx / Δt, Vy=Δy / Δt,
[0046] Then the value of the velocity vector of this feature point is:
[0047]
[0048] α=arctan(Vx / Vy)
[0049] Where α is the angle between the velocity vector of the current feature point and the horizontal axis;
[0050] Then the matrix formed by the velocity value of each feature point is the velocity value matrix of this frame, and the velocity direction value of each feature point constitutes the velocity direction matrix of this frame;
[0051] Step 4: Acceleration matrix construction: Based on the velocity matrix and velocity direction matrix of two adjacent frames, calculate the acceleration matrix At of each frame;
[0052] Step 5: Solve the acceleration of the feature point based on the vector triangle. is the velocity of the feature point in the previous frame, is the speed of the current frame, then , is the magnitude of the speed change, , (ΔVx, ΔVy are the two components of the velocity change of the point in two frames);
[0053] , ;
[0054] The acceleration of the feature point is ,
[0055] , βt is the angle between the acceleration vector and the horizontal direction, βt=arctan(ΔVx / ΔVy);
[0056] This constitutes the acceleration matrix At;
[0057] Step 6: Calculate the frame average acceleration: Take all pixels of the current frame as a whole, and take the average acceleration of all feature points with non-zero acceleration in the acceleration matrix of the current frame as the frame average acceleration of the fish school in the current frame, set as ,but ,
[0058] Among them, p i is a motion feature point with non-zero acceleration in the current frame, a t (p i ) is p i The acceleration of n is the number of all motion feature points with non-zero acceleration in the current frame;
[0059] Step 7: Feeding reaction detection: Set a training set, and set an appropriate frame average acceleration threshold based on the training set. The value above the threshold is the behavioral reaction caused by feeding;
[0060] Step 8: Dictionary learning: Combine sparse representation with structural information and use structured dictionaries for learning and detection, including the following steps:
[0061] Step 1: Introducing reference events for the learning process of structured dictionaries;
[0062] Step 2: Use K-SVD iterative method to optimize the structural dictionary and sparse representation coefficients.
[0063] In the first step of step eight, the reference event cited includes fish school motion features, and the HS optical flow method is used to extract the gradient histogram.
[0064] In the first step of step eight, the reference event is a collection of normal events, and the normal events have similar characteristics. Smoothing regularization is used to describe the relationship between normal events.
[0065] In the first step of step eight, the similar features include similar movement conditions of the fish schools and the relative positions of the fish schools.
[0066] In the second step of step eight, the structure dictionary and sparse representation coefficients are optimized using the K-SVD iteration method, including the following steps:
[0067] a. Learning process: The learning process of the structured dictionary includes the extraction of fish movement features in the reference event, smoothing and regularizing of the features, and optimization of the sparse coefficients through iteration;
[0068] b. Detection process: Utilize the learned structured dictionary and combine it with reference events to detect events in the video sequence containing fish schools.
[0069] The beneficial effects of the present invention are as follows: the method for detecting fish feeding reactions based on dictionary learning of the present invention, by using the Lucas-Kanade optical flow method to extract optical flow information at feature points and using the K-SVD iterative method to optimize the structural dictionary and sparse representation coefficients, the obtained detection result is 8% to 15% higher than the detection rate of the prior art.
[0070] The present invention can be widely used in digital image processing occasions.
[0071] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. All equivalent modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the patent scope of the present invention.
Claims
1. A method for detecting fish feeding response based on dictionary learning, characterized in that: The steps include: Step 1: Preprocessing: grayscale and denoise the image Ft to obtain the preprocessed image Ft'; Step 2: Feature point extraction: Extract feature points from the image Ft' to obtain a series of feature points; Step 3: Calculation of velocity value matrix and velocity direction matrix: including the following steps: Step 1: Use the Lucas-Kanade optical flow method to extract the optical flow information at the feature points, calculate the speed of each feature point in each frame, and obtain the speed value matrix Vectort and the speed direction matrix Angle t , remove the values that are too large or too small in the matrix to filter out the noise caused by the change of ambient light, and finally only retain the speed formed by the movement of the object; Step 2: The frame at time t is F t , the frame after Δt is F t+Δt pt is the feature point on Ft, with coordinates (xi, yi), p t+Δt F t+Δt The corresponding feature point on the graph has coordinates (xj, yj); The horizontal components of the velocity vector are Vx=Δx / Δt, Vy=Δy / Δt, Then the value of the velocity vector of this feature point is: α=arctan(Vx / Vy) Where α is the angle between the velocity vector of the current feature point and the horizontal axis; Then the matrix formed by the velocity value of each feature point is the velocity value matrix of this frame, and the velocity direction value of each feature point constitutes the velocity direction matrix of this frame; Step 4: Acceleration matrix construction: Based on the velocity matrix and velocity direction matrix of two adjacent frames, calculate the acceleration matrix At of each frame; Step 5: Solve the acceleration of the feature point based on the vector triangle. is the velocity of the feature point in the previous frame, is the speed of the current frame, then , is the magnitude of the speed change, , ΔVx, ΔVy are the two components of the velocity change of the point in two frames; , ; The acceleration of the feature point is , , βt is the angle between the acceleration vector and the horizontal direction, βt=arctan(ΔVx / ΔVy); This constitutes the acceleration matrix At; Step 6: Calculate the frame average acceleration: Take all pixels of the current frame as a whole, and take the average acceleration of all feature points with non-zero acceleration in the acceleration matrix of the current frame as the frame average acceleration of the fish school in the current frame, set as ,but , Among them, p i is a motion feature point with non-zero acceleration in the current frame, a t (p i ) is p i The acceleration of n is the number of all motion feature points with non-zero acceleration in the current frame; Step 7: Feeding reaction detection: Set a training set, and set an appropriate frame average acceleration threshold based on the training set. The value above the threshold is the behavioral reaction caused by feeding; Step 8: Dictionary learning: Combine sparse representation with structural information and use structured dictionaries for learning and detection, including the following steps: Step 1: Introducing reference events for the learning process of structured dictionaries; Step 2: Use K-SVD iterative method to optimize the structural dictionary and sparse representation coefficients.
2. The method for detecting fish feeding response based on dictionary learning according to claim 1, characterized in that: In the first step of step eight, the reference event cited includes fish school motion features, and the HS optical flow method is used to extract the gradient histogram.
3. The method for detecting fish feeding response based on dictionary learning according to claim 1, characterized in that: In the first step of step eight, the reference event is a collection of normal events, and the normal events have similar characteristics. Smoothing regularization is used to describe the relationship between normal events.
4. The method for detecting fish feeding response based on dictionary learning according to claim 3, characterized in that: In the first step of step eight, the similar features include similar movement conditions of the fish schools and the relative positions of the fish schools.
5. The method for detecting fish feeding response based on dictionary learning according to claim 1, characterized in that: In the second step of step eight, the structure dictionary and sparse representation coefficients are optimized using the K-SVD iteration method, including the following steps: a. Learning process: The learning process of the structured dictionary includes the extraction of fish movement features in the reference event, smoothing and regularizing of the features, and optimization of the sparse coefficients through iteration; b. Detection process: Utilize the learned structured dictionary and combine it with reference events to detect events in the video sequence containing fish schools.
Citation Information
Patent Citations
Human body behavior recognition method based on kernel sparse coding
CN105930790A
Remote sensing image sparse coding dictionary learning method based on embedded DSP
CN106991426A
Multi-view video anomaly detection method based on sparse coding
CN109117774A
Feature extraction method and apparatus
IN201627007366A
Superpixel classification method based on semi-supervised k-SVD and multiscale sparse representation
US20200019817A1
