CN-122023400-A - Non-rigid body fish disease detection method and system based on attitude guidance characteristic alignment field
Abstract
The invention relates to the field of fish disease detection, in particular to a non-rigid body fish disease detection method and system based on an attitude guide characteristic alignment field. The method comprises the steps of constructing a gesture sensing branch comprising windmill convolution, extracting a direction field and curvature characteristics of fish body movement, generating a gesture offset field, embedding a gesture guiding characteristic alignment module in a focus detection main branch, driving a deformable convolution kernel to perform self-adaptive space sampling by using the gesture offset field, performing geometric correction from bending to straightening on fish body characteristics subjected to geometric deformation in a characteristic space, performing multi-scale texture enhancement detection based on the geometric correction characteristics, constructing a loss function, designing training strategies, training and outputting results. The invention can actively sense and offset the interference caused by the swimming deformation of the fish body, and obviously improves the detection precision and robustness of fine focus such as ulceration, white spots and the like in a complex underwater environment. The invention is suitable for detecting the non-rigid fish diseases.
Inventors
- LIU ZHOU
- CHEN XIAOYAN
- HUANG JUNJIE
- TAN KE
Assignees
- 四川农业大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260410
Claims (10)
- 1. The non-rigid body fish disease detection method based on the attitude guidance characteristic alignment field is characterized by comprising the following steps of: S1, constructing a gesture sensing branch comprising windmill convolution, extracting a direction field and curvature characteristics of fish body swimming, and generating a gesture offset field; s2, embedding a gesture guiding feature alignment module in a focus detection main branch, driving a deformable convolution kernel to perform self-adaptive space sampling by using the gesture offset field, and performing geometric correction from bending to straightening on fish body features subjected to geometric deformation in a feature space; s3, multi-scale texture enhancement detection based on geometric correction features; S4, constructing a loss function; S5, training by designing a training strategy and outputting a result.
- 2. The method for detecting non-rigid body fish diseases based on alignment fields of posture guide features as claimed in claim 1, wherein in step S1, the input of the posture sensing branch is an original image Or shallow features of the trunk ; Original image For underwater acquisition of fish image frames including bending, yaw and roll appearance changes due to swimming, shallow features of the trunk Basic texture features extracted in a shallow layer for a backbone network; the gesture sensing branch outputs as a gesture offset field Wherein Representing the position Two-dimensional displacement vectors which need to be applied to restore the straight posture; Constructing a gesture sensing branch comprising windmill convolution comprises introducing gesture self-adaptive windmill convolution into the gesture sensing branch, and extracting a direction field of fish body swimming specifically comprises the following steps: Direction adaptation is achieved by local direction field driven blade rotational alignment: in the position of the gesture sensing branch Local direction vector of the local prediction: ; and calculates the local principal direction angle: ; In the formula, Indicating the position of the fish body A local main shaft tangential direction nearby, which is continuously changed in space when the fish body is bent in a C shape or swung in an S shape, and which is rotated as a whole or is turned in a local torsion when the fish body is yawed or rolled; The windmill convolution comprises The direction of each blade and the relative angle are set as follows Location of then The blade direction at this point is defined as: ; In the formula, Is offset for the opposite direction, is used for defining the multi-branch sampling along the tangential direction or the normal direction and a plurality of inclined directions thereof; Through position The blade direction at the position realizes the rotary alignment of the convolution sampling direction along with the local posture change of the fish body.
- 3. The method for detecting the non-rigid body fish disease based on the alignment field of the posture guide features according to claim 2, wherein in the step S1, a posture adaptive windmill convolution is introduced into the posture sensing branch, and the extracting of the curvature feature of the fish body swimming specifically comprises: the scale self-adaption is realized through the self-adaption sampling scale of curvature gate control: the gesture sensing branch circuit obtains curvature indication quantity And constructing a scale gating factor: ; Offset blade sampling from fixed offset The adjustment is as follows: ; In the formula, The normalization function is represented as a function of the normalization, Representing the amount of curvature to scale mapping, A two-dimensional rotation matrix is represented, Representing a minimum sampling radius and a maximum sampling radius respectively, Representing a set of reference sampling points of the windmill nucleus in canonical coordinates, The sampling points are rotated according to the local direction of the fish body and the real sampling positions are scaled according to curvature in a self-adaptive manner; characteristic polymeric form of PA-PConv: To the position The output of PA-PConv is expressed as: ; Wherein the method comprises the steps of Represent the first A sample set of the individual leaves is provided, In order to correspond to the weight of the object, Representing feature graphs for pose estimation, from the pose-aware branch itself or from The fusion characteristics provided are those of the fusion, Comprises local texture and boundary information of the fish body.
- 4. The method for detecting a non-rigid body fish disease based on an alignment field of posture guide features according to claim 3, wherein in step S1, generating a pixel-level posture offset field specifically includes: the gesture sensing branch is obtaining gesture enhancement characteristics And then, outputting an offset field through a displacement regression head: ; In the formula, For the pose enhancement feature after PA-PConv direction or scale adaptation, Is a lightweight regression head.
- 5. The method for detecting a non-rigid body fish disease based on an alignment field of posture guide features of claim 4, wherein step S1 further comprises: Introducing bending consistency constraints to promote stability against C-type bending or S-type rocking, for input Performing controllable bending enhancement to obtain simulated swimming bending The offset fields are required to be consistent under geometric correspondence: ; In the formula, In order to enhance the transformation is, Representing the presentation to be Displacement field mapping back in coordinate system And (5) a coordinate system.
- 6. The method for detecting non-rigid body fish diseases based on the alignment fields of the posture guide features according to claim 4, wherein in the step S2, the input of the alignment module of the posture guide features includes a middle layer or deep layer feature map of the main branch of focus detection, and the posture offset field output by the posture sensing branch ; The output of the attitude guidance feature alignment module is an aligned feature map , Representing the spatial dimensions of the current feature layer of the primary branch, the downsampling result corresponding to the resolution of the artwork, The number of channels is represented, and the number of channels carries the separability information between the related semantics of the focus and the background of the fish body; driving the deformable convolution kernel to perform adaptive space sampling by using the attitude offset field, and performing geometric correction for straightening the geometrically deformed fish body characteristics in the characteristic space by bending specifically comprises the following steps: S201, attitude-guided deformable convolution alignment; Regular sampling of standard convolution: Standard convolution is in place The outputs of (2) are: ; In the formula, Representing the weight of the convolution kernel, A regular sampling grid representing a standard convolution kernel; offset sampling of deformable convolution: deformable convolution at each location Introducing an offset The output is: ; Wherein, the Sampling operations for employing bilinear interpolation at non-integer coordinates; s202, driving offset sampling by adopting an attitude offset field; Using attitude offset fields As a geometric alignment priori, and maps it to a sampling offset of the DCN, for the same location The same pose offset is shared for all sampling points: ; The pose guide alignment convolution is: ; s203, aligning convolution output through gesture guidance; registering the pose-guided aligned convolution output as : ; In the formula, Representing a convolution operation.
- 7. The method for detecting the non-rigid body fish disease based on the alignment field of the posture guide features of claim 6, wherein the step S3 specifically comprises: s301, inputting and outputting; inputting a geometric correction multi-layer feature map comprising the step S2, wherein the geometric correction multi-layer feature map corresponds to different downsampling operations and gesture or texture flow features from a gesture sensing branch of the step S1; outputting a multi-scale enhanced feature pyramid and focus detection result; S302, constructing a correction state feature pyramid; The aligned multilayer features are subjected to top-down and bottom-up information transmission through a feature pyramid fusion structure, and a fusion framework adopts PANet or BiFPN; A detail preserving fine tuning module is introduced for restoring high frequency textures: for the upper layer of characteristics Up-sampling to obtain ; With co-scale lateral features Fusion to obtain ; Detail restoration is performed through a lightweight residual convolution block: ; After top-down and bottom-up fusion and DPRM insertion, a three-layer correction state enhancement characteristic diagram is obtained; S303, constructing a texture-semantic dual-flow decoupling detection head; for each scale feature, a decoupling structure is adopted to respectively predict classification and regression: Regression branching, namely predicting boundary frame parameters by using only the geometrically corrected features; classifying branches by using bypass injection features concurrently with gesture or texture flow features; Injecting gesture or texture flow feature bypasses into the classification branches: characterizing the pose or texture stream from the step S1 pose aware branch By passing through Convolutions are used for channel dimension reduction and scale alignment to obtain injection characteristics : ; Wherein the method comprises the steps of Indicating interpolation or stride convolution alignment to Operations of the same spatial dimensions; The classification branch input adopts a fusion form: adding and fusing: ; Splicing type fusion: ; The final classification and regression outputs are respectively: ; ; Wherein the method comprises the steps of In order to classify the score of a score, Regression results for bounding boxes; s304, task-Aligned dynamic label distribution is applied; Defining alignment index of candidate points by adopting task alignment thought : ; Wherein, the Representing the predicted score of the candidate point for the target class, IoU representing the candidate point prediction box and the real box, Representing the super parameter.
- 8. The method for detecting the non-rigid body fish disease based on the alignment field of the posture guide features of claim 7, wherein the step S4 specifically comprises: The total loss is defined as: ; wherein the method comprises the steps of The loss weight coefficient is represented as a function of the loss weight coefficient, The optimized intensity of focus category identification is controlled for coping with focus appearance fluctuation and texture confusion caused by fish posture change, The optimized intensity of focus positioning is controlled for coping with boundary frame drift and scale change caused by C-shaped bending or S-shaped swinging, Controlling the constraint intensity of the availability or stability of the alignment field; representing the classification loss: ; Wherein the method comprises the steps of For a classification score corresponding to a candidate point or prediction box, Is the parameter of the ultrasonic wave to be used as the ultrasonic wave, For suppressing training bias from the number advantage of background or normal fish scale texture, For emphasizing difficult samples; Representing regression loss: ; Respectively predicting a focus frame and a real focus frame marked manually; representing alignment consistency loss: ; wherein the method comprises the steps of As the weight coefficient of the light-emitting diode, Is a total variation regularization term; introducing texture continuity constraints of the geometric correction feature: for the output of step S2 TV constraints are applied: ; Wherein the method comprises the steps of Is a spatial index, and reflects the continuous change of the surface of the fish body along the spatial position; Introducing a smoothness constraint of the attitude offset field: for the attitude offset field output in step S1 TV constraints are applied: ; Wherein the method comprises the steps of Expressed in space position Two-dimensional displacement vector at.
- 9. The method for detecting the non-rigid body fish disease based on the alignment field of the posture guide features of claim 7, wherein the step S5 specifically comprises: Adopting an end-to-end joint training mode to update all the trainable parameters of the steps S1 to S3 simultaneously; And (3) with The gradient of the (B) is transmitted back to the step S1 through the step S2, so that the PA-PConv and the displacement regression head are driven and optimized together under the detection availability target; After training, the parameter output obtained by training is directly used in the reasoning stage Geometric correction features and lesion detection results.
- 10. A non-rigid body fish disease detection system based on an attitude guidance feature alignment field for implementing the non-rigid body fish disease detection method based on an attitude guidance feature alignment field as claimed in any one of claims 1 to 9, characterized in that the detection system comprises: The attitude offset field generation module is used for constructing an attitude sensing branch comprising windmill convolution, extracting the direction field and curvature characteristics of fish body swimming and generating an attitude offset field; The geometric correction module is embedded in the focus detection main branch and drives the deformable convolution kernel to perform self-adaptive space sampling by utilizing the gesture offset field, so that geometric correction from bending to straightening is performed on the fish body characteristics subjected to geometric deformation in the characteristic space; the multi-scale texture enhancement detection module is used for multi-scale texture enhancement detection based on geometric correction characteristics; the loss function construction module is used for constructing a loss function; And the strategy training module is used for designing a training strategy and outputting a result.
Description
Non-rigid body fish disease detection method and system based on attitude guidance characteristic alignment field Technical Field The invention relates to the field of fish disease detection, in particular to a non-rigid body fish disease detection method and system based on an attitude guide characteristic alignment field. Background The traditional manual pond inspection method has the problems of low efficiency, strong subjectivity, easy stress reaction on fish bodies and the like. In recent years, computer vision technology (such as a YOLO series, a fast R-CNN and other target detection algorithms) based on deep learning is gradually applied to underwater fish disease detection, and a better effect is achieved on a standardized image dataset. However, in practical high-density cage culture or recirculating aquaculture scenarios, existing fish disease detection techniques still face significant challenges, mainly in the following aspects: Feature mismatch problems caused by non-rigid body deformation: Existing mainstream detection networks (e.g., YOLOv/v 8, resNet, etc.) rely primarily on standard square convolution kernels (Standard Square Convolution, e.g., 3×3 or 5×5) for feature extraction. This regular geometric sampling structure implies the assumption that the target object is mainly rigid. However, fish are typical non-rigid organisms, which frequently undergo severe deformations such as C-type bending, S-type swinging, twisting, etc. during swimming. When fish body is bent, the texture characteristics of the focus (such as ulceration erythema) can have serious nonlinear distortion in the image space. The traditional square convolution kernel cannot sample along with the curvature of the fish body, so that the extracted feature map and the true focus feature are geometrically misaligned, and the omission or confidence coefficient is greatly reduced. Texture aliasing by arbitrary rotation: The underwater fish presents 360-degree free swimming posture, which requires the detection algorithm to have extremely strong rotation invariance. The prior art generally employs data enhancement (e.g., randomly rotated pictures) to passively increase the robustness of the model, but this approach does not change the feature extraction mechanism inside the network. Fish scales have a regular texture structure, and lesions (such as ulcers) often appear as breaks in texture gradients. In the absence of directional perceptions, when the fish body tilts or rotates, the texture projection of normal scales may be compressed, easily confused with focal texture, resulting in a high false positive (false positive) rate. Feature coupling in a complex context: Under the conditions of underwater turbidity, uneven illumination and high-density shielding, background noise (such as pasture, bubbles and residual bait) is easy to interfere with a detection result. While the prior art deformable convolution (Deformable Convolution, DCN) attempts to adapt to the shape of an object by learning the offset, its learning of the offset is usually "blind" (based on image gradients only), and under weak texture or strong noise interference, the sampling points tend to drift to the background area, resulting in impure feature extraction and inability to focus precisely on the torso of the fish. In view of the foregoing, there is an urgent need for a fish disease detection method capable of actively sensing the swimming gesture of a fish body and dynamically adjusting the feature sampling position according to gesture information, so as to realize "de-deformation" and "normalization" on the feature level, so as to solve the problem of high-precision detection of non-rigid fish in complex dynamic scenes. Disclosure of Invention The invention aims to overcome the defects of the prior art, and provides a non-rigid body fish disease detection method and system based on an attitude guide characteristic alignment field, which can actively sense and offset the interference caused by the swimming deformation of a fish body, and remarkably improve the detection precision and robustness of fine focus such as fester, white spots and the like in a complex underwater environment. The invention adopts the following technical scheme to achieve the aim, and in a first aspect, the invention provides a non-rigid body fish disease detection method based on an attitude guide characteristic alignment field, which comprises the following steps: S1, constructing a gesture sensing branch comprising windmill convolution, extracting a direction field and curvature characteristics of fish body swimming, and generating a gesture offset field; s2, embedding a gesture guiding feature alignment module in a focus detection main branch, driving a deformable convolution kernel to perform self-adaptive space sampling by using the gesture offset field, and performing geometric correction from bending to straightening on fish body features subjected to geometric deformation