A fish body length detection method and system based on monocular vision and fish eye scale structure constraint

By combining a fish length detection method based on monocular vision and fish-eye scale structural constraints with brightness correction and fish-eye scale constraints, the accuracy and robustness issues of underwater fish length measurement are solved, achieving low-cost, high-precision fish length estimation, which is suitable for online monitoring of factory-scale recirculating aquaculture systems.

CN122492787APending Publication Date: 2026-07-31ZHEJIANG SCI-TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG SCI-TECH UNIV
Filing Date
2026-04-30
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Traditional manual measurement of fish length is labor-intensive and stress-prone. Monocular vision lacks absolute depth information in the underwater environment, and fish deformation leads to inaccurate measurements. Existing binocular vision systems are costly and complex to deploy, making it difficult to meet actual production needs.

Method used

A fish body length detection method based on monocular vision and fish-eye scale structural constraints is adopted. The fish body region and fish-eye region are obtained through target detection model. The length is estimated by combining the brightness-driven depth correction factor and the fish-eye pixel diameter, using the allometric growth ratio, and finally obtaining the fish body length through multi-constraint fusion and temporal smoothing correction.

Benefits of technology

It achieves high-precision and low-cost fish length estimation in complex underwater environments, improving robustness and real-time performance, and is suitable for online monitoring of factory-scale recirculating aquaculture systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492787A_ABST
    Figure CN122492787A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for fish body length detection based on monocular vision and fisheye-scale structural constraints. The method first uses a lightweight YOLOv11n model to jointly detect the fish body region and fisheye region in the tested image, and obtains the initial physical length of the fish based on the basic mapping between pixel scale and physical length, as well as the pixel body length. Second, a depth approximation correction based on brightness attenuation characteristics is introduced to compensate for the depth information lost in monocular vision. Third, structural constraints are constructed using the biological ratio of fisheye diameter to body length, providing stable length estimation even with pose deformation or incomplete contours. Finally, multiple constraint information is adaptively fused based on pose confidence, and temporal consistency constraints are introduced through a sliding time window to suppress noise. The final length is output after global linear calibration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and smart aquaculture technology, specifically relating to a method and system for detecting fish body length based on monocular vision and fish eye-scale structural constraints. Background Technology

[0002] Fish length is an important indicator for assessing fish growth status, optimizing feeding strategies, and monitoring health in factory-scale recirculating aquaculture systems. Traditional manual measurement methods are labor-intensive and prone to causing stress to fish, affecting economic benefits. With the development of artificial intelligence technology, non-contact measurement based on computer vision has become a trend. However, in real underwater environments, monocular vision measurement faces many challenges: (1) monocular imaging lacks absolute depth information, leading to scale ambiguity; (2) fish are non-rigid targets, and deformation and posture changes during swimming cause fluctuations in projected length; (3) underwater light attenuation and turbidity interfere with image quality. Existing binocular vision systems are costly and complex to deploy, while traditional monocular methods mostly rely on manual calibration or ideal posture assumptions, making it difficult to meet actual production needs. How to improve the stability and accuracy of fish length estimation under monocular conditions is a technical problem that urgently needs to be solved. Summary of the Invention

[0003] The purpose of this invention is to provide a method and system for detecting fish body length based on monocular vision and fish-eye scale structural constraints.

[0004] In a first aspect, the present invention provides a method for detecting the body length of fish based on monocular vision and fish-eye-scale structural constraints, the method comprising:

[0005] The target detection model is used to detect the target image containing the target fish, and the fish body region and fish eye region of the target fish are obtained.

[0006] After preprocessing the fish body region, the pixel body length and pixel body width of the fish under test are extracted; the initial physical length of the fish under test is obtained based on the pixel body length and the reference mapping coefficient.

[0007] The initial physical length is corrected by using a brightness-driven depth correction factor to obtain the corrected length, thereby compensating for the depth information lost by monocular vision.

[0008] The allometric growth ratio is constructed based on the ratio of the total length of the fish to the eye diameter, and the estimated length is obtained by multiplying the allometric growth ratio by the fish eye pixel diameter and the conversion coefficient.

[0009] The final body length of the fish being tested is obtained by fusing the estimated length and the corrected length.

[0010] Preferably, the method for obtaining the reference mapping coefficient is as follows: obtain the actual body length of the reference fish and the pixel body length in the reference image, and use the ratio of the pixel body length to the actual body length as the reference mapping coefficient.

[0011] Preferably, the depth correction factor is obtained based on the ratio of the average brightness of the fish body region in the reference image and the test image, as well as the brightness sensitivity coefficient.

[0012] Preferably, the weighting coefficients in the fusion of the estimated length and the corrected length are dynamically adjusted according to the attitude confidence score and the fisheye detection confidence.

[0013] Preferably, the method for obtaining the attitude confidence score is as follows: obtain the ratio of the pixel body length to the pixel body width of the fish under test, and obtain the attitude confidence score based on the ratio, the difference between the reference width and length ratio and the scale parameter.

[0014] Preferably, before obtaining the final fish length, a time-series smoothing factor is introduced to further fuse the fusion results of the estimated length and the corrected length with the historical mean; the time-series smoothing factor is adjusted according to the relative deviation.

[0015] Preferably, before obtaining the final fish length, the fish length is globally linearly calibrated using a deviation calibration factor obtained from a preliminary experiment; the deviation calibration factor is the difference between the measured mean and the predicted mean in the preliminary experiment.

[0016] Preferably, the preprocessing method is as follows: first, the detected fish body region is subjected to Gamma correction; then, the corrected image is mapped to the grayscale domain through weighted linear transformation; next, a binary mask is constructed using an adaptive thresholding algorithm, and morphological closing operation is performed using structuring elements; finally, holes are filled to extract a continuous and complete fish body contour.

[0017] Preferably, the target detection model adopts the YOLOv11n model.

[0018] Secondly, the present invention provides a fish body length detection system based on monocular vision and fish-eye scale structural constraints, which is used to execute the above-described fish body length detection method. The fish body length detection system includes an image acquisition module, a target detection module, a preprocessing module, a brightness correction module, a fish-eye scale structural constraint module, a temporal smoothing module, and a priori information correction module. The image acquisition module is used to acquire a test image containing the fish being tested. The target detection module is used to detect the fish body region and fish-eye region of the fish being tested from the test image. The preprocessing module is used to process the detected fish body region and extract the pixel length and pixel width. The brightness correction module is used to correct the brightness of the initial physical length. The fish-eye scale structural constraint module is used to further adjust the length corrected by the brightness correction module according to the allometric growth ratio. The temporal smoothing module is used to correct the fish body length according to the historical mean and relative deviation. The priori information correction module is used to correct the fish body length according to a deviation calibration factor.

[0019] The beneficial effects of this invention are:

[0020] 1. This invention introduces fisheye-scale structural constraints in body length detection, which do not rely on the integrity of the body boundary or the brightness attenuation model. This solves the problem of poor accuracy of existing body length detection methods in scenarios involving abnormal postures or unstable contours, and greatly improves the robustness under fish posture deformation or occlusion conditions.

[0021] 2. This invention effectively solves the scale drift problem caused by changes in object distance in monocular vision by introducing a depth correction based on brightness attenuation. Without the need for expensive binocular cameras or depth sensors, it can achieve high-precision fish length estimation using only monocular vision. It has extremely high robustness and accuracy in estimating the length of freely swimming fish in complex underwater environments, significantly reducing hardware costs and deployment difficulty.

[0022] 3. This invention employs a multi-constraint fusion strategy, combining physical imaging models with biological features, to achieve high-precision detection of underwater fish length. Simultaneously, this invention utilizes a lightweight YOLOv11n model and a sliding window temporal smoothing mechanism to ensure the real-time performance and continuity of the algorithm, making it suitable for long-term online monitoring of factory-scale recirculating aquaculture systems.

[0023] 4. This invention organically combines deep learning detection, physical imaging priors, and biological morphological constraints, effectively solving the measurement problems caused by depth loss and non-rigid fish movement in monocular vision, and realizing low-cost, highly robust automated monitoring of underwater fish length. Attached Figure Description

[0024] Figure 1 This is the overall flowchart of the present invention.

[0025] Figure 2 This is a diagram showing the image preprocessing and contour extraction results of the present invention.

[0026] Figure 3 This is a schematic diagram of the multi-constraint fusion and timing smoothing logic of the present invention. Detailed Implementation

[0027] The present invention will be further described below with reference to the accompanying drawings.

[0028] A method for fish body length detection based on monocular vision and fish-eye-scale structural constraints is presented. The fish body length detection system includes an image acquisition module, a target detection module, a preprocessing module, a brightness correction module, a fish-eye-scale structural constraint module, a temporal smoothing module, and a prior information correction module. The image acquisition module acquires images containing the fish to be tested. The target detection module detects the fish body region and fish-eye region from the images. The preprocessing module processes the detected fish body region and extracts the pixel length and pixel width. The brightness correction module corrects the initial physical length for brightness. The fish-eye-scale structural constraint module further adjusts the length corrected by the brightness correction module according to the allometric growth ratio. The temporal smoothing module corrects the fish body length based on historical mean and relative deviation. The prior information correction module corrects the fish body length based on a deviation calibration factor.

[0029] In this embodiment, the image acquisition module is a monocular camera.

[0030] like Figure 1 As shown, the method for detecting the body length of this fish includes the following steps:

[0031] Step S1: Construct and preprocess an underwater fish image dataset and establish mapping relationships.

[0032] For specific aquaculture environments, images containing reference fish are collected as reference images. The actual body length of the reference fish is then obtained. And the pixel body length of the reference fish in the reference image Based on the actual body length of the reference fish. and pixel volume length Obtain the baseline mapping coefficients (reference scale calibration coefficients). Its expression is:

[0033]

[0034] Step S2: Perform joint detection using YOLOv11n

[0035] The lightweight YOLOv11n model was selected as the front-end detector. This model has a small number of parameters and is suitable for deployment on edge devices. Images containing the fish being tested were acquired, and the front-end detector was used to detect the images, simultaneously outputting the fish's body region and eye region.

[0036] Step S3: Image preprocessing and contour extraction

[0037] To eliminate color distortion in underwater imaging, the detected fish area is first subjected to Gamma correction, which is expressed as:

[0038]

[0039] in, The corrected image; Original image; This is the gamma value, used to control the brightness and contrast of an image.

[0040] The corrected image is then mapped to the grayscale domain using a weighted linear transformation, which is represented as follows:

[0041]

[0042] in, Grayscale value; The pixel value for the red channel; The pixel value is for the green channel. This represents the pixel value of the blue channel.

[0043] A binary mask is constructed using an adaptive thresholding algorithm, and morphological closing operations are performed using the structuring element K to obtain the final binary mask. It is represented as:

[0044]

[0045] in, The original binary mask is the fish image initially generated using an adaptive thresholding algorithm; The rectangular operator, acting as a structuring element, determines how the image is processed. This indicates an expansion operation, which expands the target area outward to fill small holes inside the target and connect disconnected adjacent areas; This indicates an erosion operation that shrinks the boundary of the target area inward to eliminate small noise points.

[0046] Fill in the holes, extract the continuous and complete fish body outline, and obtain the pixel length of the fish being tested. and pixel width Based on pixel volume length Obtain the initial physical length of the fish being tested. Its expression is:

[0047]

[0048] Step S4: Depth approximation correction based on brightness attenuation

[0049] Based on the Beer-Lambert law of underwater illumination decay with distance, brightness can serve as a weakly supervised feature for relative depth. A brightness-driven depth correction factor is then obtained. Its expression is:

[0050]

[0051] in, The average brightness of the fish body area in the reference image; The average brightness of the fish body region in the measured image; This is the brightness sensitivity coefficient.

[0052] When calculating the average brightness, the top 5% of the bright areas in the histogram are removed to eliminate specular reflection interference.

[0053] Use depth correction factor For the initial physical length Perform brightness correction to obtain the correction length. Its expression is:

[0054]

[0055] This step uses optical energy to compensate for the depth information lost in monocular vision.

[0056] Step S5: Fisheye Structure Constraints and Posture Scoring

[0057] In the monocular vision paradigm, the fundamental uncertainty in fish body length estimation stems from the inherent unobservability of the scale factor. Although the aforementioned brightness correction strategies partially compensate for scale variations caused by depth, relying solely on the global contour is still prone to significant biases in cases of non-rigid body deformations (such as sharp turns), local occlusion, or incomplete segmentation. To mitigate these limitations, this invention introduces a structural consistency constraint based on the fisheye scale to implement internal corrections for body length estimation.

[0058] Because the ratio of eye diameter (ED) to total length (TL) in fish exhibits significant phenotypic stability within the same species and at similar growth stages, allometric growth ratios were constructed using total length and eye diameter in fish. An independent estimation path is constructed that does not depend on the integrity of the body contour, that is, the estimated length at the fish eye scale is obtained based on the fish eye pixel diameter and allometric growth ratio of the fish being tested. Its expression is:

[0059]

[0060] in, The diameter of a fisheye pixel; This is the conversion factor from pixel to physical actual size in the current frame, which is obtained based on preset brightness and depth correction factors.

[0061] Based on the pixel length of the fish being tested and pixel width Obtain the width-to-length ratio of the fish being tested. Attitude confidence scores were calculated using the Gaussian kernel function. The pose confidence score is used to quantify whether the fish pose in the tested image is close to the ideal side view state. Its expression is:

[0062]

[0063] in, The reference width-to-length ratio under ideal side-view posture; This is the scale parameter.

[0064] Step S6: Obtain the final fish length

[0065] To combine global geometric information with prior local structural information, an adaptive weighted fusion strategy is adopted to modify the length obtained in step S4. and the estimated length obtained in step S5 The fusion is performed to obtain the length of the fused body. Its expression is:

[0066]

[0067] in, These are the weighting coefficients.

[0068] Weighting coefficients Based on attitude confidence score and fisheye detection confidence (Obtained via YOLOv11n model when detecting fisheye regions) Dynamically adjusted; weighting coefficients Posture confidence score Positively correlated with fisheye detection confidence level Negative correlation.

[0069] From an optimization perspective, this fusion process is equivalent to solving a minimization problem. Let... This represents the body length estimation variable to be optimized. The process can be viewed as applying a structure consistency regularization term to the objective function:

[0070]

[0071] The introduction of this constraint effectively suppresses irrational estimations caused by monocular scale drift and non-rigid biological motion, significantly improving measurement stability.

[0072] Introducing the sliding time window length Calculate the historical average and relative deviation If the relative deviation If the threshold is exceeded, it is considered abnormal, and the time-series smoothing factor is reduced. To suppress noise; otherwise, maintain a high time-series smoothing factor. .

[0073] Based on historical averages and time series smoothing factor Get the final smooth length Its expression is:

[0074]

[0075] Global linear calibration was performed by calculating the systematic deviation calibration factor through preliminary experiments to obtain the final fish length. Its expression is:

[0076]

[0077] in, The deviation calibration factor is expressed as follows:

[0078]

[0079] in, This is the average value measured manually. This is for predicting the mean.

[0080] Step S7, Method Evaluation

[0081] By comparing this invention with existing body length detection methods (which rely solely on baseline models of geometric contours), this invention controls the mean relative error to 5.88%. Furthermore, this invention uses the lightweight YOLOv11n with only 2.6M parameters as the basic detection model, significantly reducing computational load and inference time while maintaining a detection accuracy as high as 0.936 mAP50. In addition, this invention organically combines computer vision technology, deep learning, and traditional image processing techniques to achieve high-precision, automated monitoring of pond-level fish school lengths in complex underwater environments, with extremely low storage space and computing power costs.

[0082] The above provides a detailed description of a monocular fish length estimation method based on brightness attenuation and fisheye-scale structural constraints provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are merely for the purpose of helping to understand the method and core ideas of this invention. The above embodiments are only used to illustrate the technical solutions of this invention and are not intended to limit it. Although this invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this invention.

Claims

1. A method for detecting fish body length based on monocular vision and fisheye scale structure constraint, characterized in that: The method includes: The target detection model is used to detect the target image containing the target fish, and the fish body region and fish eye region of the target fish are obtained. After preprocessing the fish body region, the pixel body length and pixel body width of the fish under test are extracted; the initial physical length of the fish under test is obtained based on the pixel body length and the reference mapping coefficient. The initial physical length is corrected using a luminance-driven depth correction factor to obtain the corrected length; The allometric growth ratio is constructed based on the ratio of the total length of the fish to the eye diameter, and the estimated length is obtained by multiplying the allometric growth ratio by the fish eye pixel diameter and the conversion coefficient. The final body length of the tested fish is obtained by fusing the estimated length and the corrected length.

2. The fish body length detection method based on monocular vision and fish eye scale structure constraint according to claim 1, characterized in that: The method for obtaining the reference mapping coefficient is as follows: obtain the actual body length of the reference fish and the pixel body length in the reference image, and use the ratio of the pixel body length to the actual body length as the reference mapping coefficient.

3. The fish body length detection method based on monocular vision and fish-eye-scale structural constraints according to claim 2, characterized in that: The depth correction factor is obtained based on the ratio of the average brightness of the fish body region in the reference image and the test image, as well as the brightness sensitivity coefficient.

4. The method for detecting fish body length based on monocular vision and fish-eye-scale structural constraints according to claim 1, characterized in that: The weighting coefficients used in the fusion of the estimated length and the corrected length are dynamically adjusted based on the attitude confidence score and the fisheye detection confidence.

5. The fish body length detection method based on monocular vision and fish-eye-scale structural constraints according to claim 4, characterized in that: The method for obtaining the attitude confidence score is as follows: obtain the ratio of the pixel body length to the pixel body width of the fish under test, and obtain the attitude confidence score based on the ratio, the difference between the reference width and length ratio and the scale parameter.

6. The fish body length detection method based on monocular vision and fish-eye-scale structural constraints according to claim 1, characterized in that: Before obtaining the final fish length, a time-series smoothing factor is introduced to further fuse the estimated length and the corrected length with the historical mean; the time-series smoothing factor is adjusted according to the relative deviation.

7. The method for detecting fish body length based on monocular vision and fish-eye-scale structural constraints according to claim 1, characterized in that: Before obtaining the final fish length, the fish length is globally linearly calibrated using a deviation calibration factor obtained from the preliminary experiment; the deviation calibration factor is the difference between the measured mean and the predicted mean in the preliminary experiment.

8. The method for detecting fish body length based on monocular vision and fish-eye-scale structural constraints according to claim 1, characterized in that: The preprocessing method is as follows: first, the detected fish body region is subjected to Gamma correction; then, the corrected image is mapped to the grayscale domain through weighted linear transformation; next, a binary mask is constructed using an adaptive threshold algorithm, and morphological closing operation is performed using structuring elements; finally, holes are filled to extract continuous and complete fish body contours.

9. The method for detecting fish body length based on monocular vision and fish-eye-scale structural constraints according to claim 1, characterized in that: The target detection model used is the YOLOv11n model.

10. A fish body length detection system based on monocular vision and fish-eye-scale structural constraints, characterized in that: This system is used to execute the fish body length detection method based on monocular vision and fish-eye scale structural constraints as described in claim 1. The fish body length detection system includes an image acquisition module, a target detection module, a preprocessing module, a brightness correction module, a fish-eye scale structural constraint module, a temporal smoothing module, and a priori information correction module. The image acquisition module acquires a test image containing the fish being tested. The target detection module detects the fish body region and fish-eye region from the test image. The preprocessing module processes the detected fish body region and extracts the pixel length and pixel width. The brightness correction module corrects the initial physical length for brightness. The fish-eye scale structural constraint module further adjusts the length corrected by the brightness correction module according to the allometric growth ratio. The temporal smoothing module corrects the fish body length based on historical mean and relative deviation. The priori information correction module corrects the fish body length based on a deviation calibration factor.