Fish weight non-contact measurement method and system based on ghost imaging

By combining ghost imaging technology and a pre-trained model, non-contact fish weight measurement in turbid water has been achieved, solving the problems of poor imaging quality and damage to fish in existing technologies, and providing a high-precision, low-cost measurement solution.

CN120807613APending Publication Date: 2025-10-17BEIJING ACADEMY OF AGRICULTURE & FORESTRY SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510747582.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing fish weight measurement methods have poor imaging quality in turbid water, making it difficult to achieve real-time, non-contact, low-power, high-precision measurement, and are harmful to the fish.

Method used

Ghost imaging technology is used to project a modulated structured light pattern onto a fish target. The intensity of the reflected light is obtained by a light intensity detector and the target image is reconstructed by discrete inverse transformation. The fish's body length and area are obtained by combining a pre-trained target detection model and the fish's weight value is generated by a weight prediction model.

Benefits of technology

It enables clear image reconstruction in turbid water, accurately obtaining fish length and weight without the need to catch fish, avoiding damage, and has the advantages of low cost, low power consumption, and easy deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807613A_ABST
    Figure CN120807613A_ABST
Patent Text Reader

Abstract

The invention provides a ghost imaging-based fish weight non-contact measurement method and system, and the method comprises the steps: projecting a modulated structured light pattern to a fish target, obtaining the light intensity reflected by the fish target through a preset light intensity detector, and reconstructing a target image through discrete inverse transformation based on the reflected light intensity; generating a fish body length and a fish area through a pre-trained target detection model based on the target image; generating a fish body weight value through a preset body weight prediction model based on the fish body length and the fish area; wherein the pre-trained target detection model is obtained by training a preset neural network model through a target image with annotation information, and the annotation information comprises the fish body length and the fish area. The problems that existing fish body weight measurement is high in dependence on the environment, and fish bodies are prone to being damaged are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of aquaculture, and in particular to a fish weight non-contact measurement method and system based on ghost imaging. BACKGROUND

[0002] As the most basic and key data in aquaculture, weight not only reflects the growth status of fish, but also directly affects multiple production links such as feeding, disease control, and fishing strategies.

[0003] Contact measurement methods have significant limitations. Such methods include manual weighing, periodic sampling and weighing, etc., which usually require fish to be taken out of the water, dehydrated for a short time, and then weighed. This method causes strong stress on the fish body, which can cause damage, infection, and even death, especially in high-density aquaculture or rare fish species. It is not feasible, and the manual cost is high, the efficiency is low, the data is subjective, and it cannot meet the real-time and precision requirements of modern aquaculture. Traditional manual weighing methods have the problems of complex operation, low efficiency, great damage to fish body, strong subjectivity of data, etc., especially in actual aquaculture environment, contact measurement can cause stress reaction or even death of fish.

[0004] Existing non-contact measurement methods based on machine vision have achieved automatic measurement to some extent, but in turbid water, there are problems such as image blurring, insufficient lighting, and noise interference, which limit the imaging quality and measurement accuracy. Traditional image enhancement and restoration algorithms, such as physical models, non-physical models, and deep learning, have improved image clarity to some extent, but have not fundamentally solved the problem of imaging through scattering media. And the non-contact imaging method based on machine vision has limited effect in the actual water environment. Traditional underwater imaging relies on CMOS or CCD image sensors, which works well in transparent media, but in actual aquaculture environment, water is often in high turbidity or low light conditions, which can cause the following problems: image blurring caused by forward scattering and back scattering; image dark and weak, low signal-to-noise ratio caused by light absorption; random noise caused by silt particles, affecting image fidelity; imaging relies on optical axis stability, and is easy to lose focus under water disturbance.

[0005] And algorithm optimization treats the symptoms and not the disease, it is difficult to fundamentally solve the imaging problem. In order to improve the image quality, the current common methods include: underwater image enhancement based on physical model or non-physical model; Image restoration based on deep learning; Using auxiliary imaging means such as polarization. Although these methods improve the image visual effect, they all depend on high-quality image input, and the calculation overhead is large, the real-time performance is poor, and it is difficult to promote in the low-cost, resource-limited aquaculture scene. In addition, these methods have not broken away from the essential limitation of traditional "two-dimensional imaging relying on spatial resolution", and are still limited in scenes with serious light scattering. Therefore, there is an urgent need for a new method of body weight measurement that can still work stably in turbid water, has small environmental dependence, strong real-time performance, is non-contact, low power consumption and can be integrated. SUMMARY

[0006] The application provides a fish body weight non-contact measurement method and system based on ghost imaging, to solve the problem that the existing fish body weight measurement has large environmental dependence and is easy to cause damage to the fish body.

[0007] The application provides a fish body weight non-contact measurement method based on ghost imaging, comprising: Projecting the modulated structured light pattern to the fish target, acquiring the light intensity reflected by the fish target through the preset light intensity detector, and reconstructing the target image through discrete inverse transformation based on the reflected light intensity; Generating the fish body length and the fish area based on the target image through the pre-trained target detection model; Generating the fish body weight value based on the fish body length and the fish area through the preset body weight prediction model; The pre-trained target detection model is obtained by training the preset neural network model with the target image with annotation information, and the annotation information includes the fish body length and the fish area.

[0008] According to the fish body weight non-contact measurement method based on ghost imaging provided by the application, the modulated structured light pattern is projected to the fish target, comprising: Projecting the light emitted by the preset light source to the spatial light modulator for modulation, obtaining the structured light pattern and projecting it to the fish target.

[0009] According to the fish body weight non-contact measurement method based on ghost imaging provided by the application, the pre-trained target detection model is obtained by training the preset neural network model with the target image with annotation information, comprising: Obtain the target image under different turbidity environments, label the fish body length and area on the target image, generate multiple target images by data enhancement on the target image with annotation information, and construct a data set based on the multiple target images; The preset neural network model is trained based on the data set and its performance is evaluated until the preset evaluation index is met and the training is stopped to obtain the target detection model.

[0010] According to a non-contact fish weight measurement method based on ghost imaging provided by the present invention, the method of obtaining the fish body length and fish area based on the target image through a pre-trained target detection model includes: Segmenting the fish body image in the target image using a target detection model to obtain an instance mask image of the fish body; Calculate the pixel area and diagonal length of the fish mask based on the fish mask instance image; Based on the pixel area of ​​the fish mask and the diagonal length of the fish mask, the fish area and fish body length are calculated using the pre-acquired size correction factor.

[0011] According to a non-contact fish weight measurement method based on ghost imaging provided by the present invention, the size correction factor acquisition method is: Setting a marker with a known size in the target image; Segmenting the marker in the target image using a target detection model to obtain an instance mask image of the marker; The pixel area of ​​the marker mask is calculated based on the instance mask image of the marker, and the ratio of the known marker area to the pixel area of ​​the marker mask is calculated to obtain the size correction factor.

[0012] According to a non-contact method for measuring fish weight based on ghost imaging provided by the present invention, the method generates a fish weight value based on the fish body length and fish area through a preset weight prediction model, comprising: The fish body length and fish area are input into a preset weight prediction model, and the fish body length and fish area are mapped to weight prediction values ​​through a multi-layer perceptron in the weight prediction model, and the predicted fish weight value is output.

[0013] The present invention also provides a non-contact fish weight measurement system based on ghost imaging, the system comprising: An imaging module is used to project a modulated structured light pattern onto a fish target, obtain the light pattern reflected by the fish target through a preset light intensity detector, and perform a discrete inverse transform to reconstruct the target image; A fish parameter acquisition module, configured to acquire fish body length and fish area based on the target image through a pre-trained target detection model; A weight prediction module, configured to generate a fish weight value based on the fish body length and fish area using a preset weight prediction model; The pre-trained target detection model is obtained by training a preset target detection model through a target image with label information, and the label information includes fish length and fish area.

[0014] The application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the fish weight non-contact measurement method based on ghost imaging when executing the computer program.

[0015] The application further provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executable on the processor to implement the fish weight non-contact measurement method based on ghost imaging.

[0016] The application further provides a computer program product, which includes a computer program, and the computer program is executable on the processor to implement the fish weight non-contact measurement method based on ghost imaging.

[0017] The fish weight non-contact measurement method and system based on ghost imaging provided by the application can realize clear image reconstruction, are not affected by external environment, and reduce the dependence on clear environment; the fish length and fish area can be obtained through the target detection model, accurate data basis is provided for subsequent fish weight prediction; the fish weight prediction model is used to realize fish weight prediction, the fish weight information can be obtained without fishing the fish, and damage to the fish body is avoided. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0019] Figure 1 is a flowchart of the fish weight non-contact measurement method based on ghost imaging provided by the application.

[0020] Figure 2 is a module architecture diagram of the ghost imaging system for underwater fish target measurement provided by the application.

[0021] Figure 3 is an imaging effect diagram of the ghost imaging system provided by the application.

[0022] Figure 4It is the ghost imaging effect diagram under different turbidity provided by the application.

[0023] Figure 5 It is the sturgeon weight measurement result schematic diagram provided by the application.

[0024] Figure 6 It is the module connection schematic diagram of the fish weight non-contact measurement system based on ghost imaging provided by the application.

[0025] Figure 7 It is the structural schematic diagram of the electronic equipment provided by the application.

[0026] Reference signs: 1: light source; 2: spatial light detector; 3: converging lens; 4: light intensity detector; 5: digital acquisition card; 6: computer; 110: imaging module; 120: fish parameter acquisition module; 130: weight prediction module; 710: processor; 720: communication interface; 730: memory; 740: communication bus. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0028] The present application will be described below in combination with Figure 1 A fish weight non-contact measurement method based on ghost imaging is described, comprising: Step 100, projecting the modulated structured light pattern to the fish target, acquiring the light intensity reflected by the fish target through the preset light intensity detector, and reconstructing the target image based on the reflected light intensity through discrete inverse transform.

[0029] Ghost Imaging (GI) is a technology that uses quantum or classical correlation properties of light field to achieve non-traditional imaging. Its core feature is that it does not need a detector to directly receive the light field reflected or transmitted by an object, but reconstructs the image by correlating the information of the reference light path and the object light path through correlation calculation. Through double-path detection, the reference light path: a high-resolution detector records the light field distribution (such as spatial mode, time evolution, etc.) without the object; the object light path: a low-resolution (even single-pixel) detector receives the light field intensity through or reflected by the object. Then, through correlation calculation, the two signals are correlated through mathematical methods (such as cross-correlation, second-order intensity correlation), and finally the object image is reconstructed. Through ghost imaging, the traditional limitations can be broken; low-resolution / single-pixel detector can be used for imaging, which is suitable for scenarios where it is difficult to arrange high-sensitivity detectors (such as long distance, extreme environment); strong anti-interference capability (such as penetrating scattering medium, atmospheric turbulence); super-resolution and non-visual imaging potential, which can combine with compression sensing algorithm to improve the imaging resolution or penetrate the barrier; low-light adaptability, which can still work under extremely weak light (single-photon level) conditions, reducing damage to the target (such as biological samples).

[0030] In the present application, referring to Figure 2 , the ghost imaging system comprises: a light source 1, a spatial light modulator 2, a light intensity detector 4, a digital acquisition card 5 and a computer 6.

[0031] Specifically, the light emitted by the light source 1 is projected to the spatial light modulator 2 for modulation to obtain a structured light pattern. The structured light pattern can be a random pattern and an orthogonal pattern, and the orthogonal pattern that can be used includes a Hadamard pattern, a Fourier pattern and a Zernike pattern.

[0032] The structured light pattern is projected to the fish target, and the reflected light is generated by reflection of the fish target. The reflected light is collected by the preset converging lens 3, and the collected reflected light is collected by the light intensity detector 4. The intensity of the reflected light is detected, and the intensity of the reflected light is converted into a voltage value. The voltage value is recorded by the digital acquisition card 5; the computer 6 performs discrete inverse transformation to reconstruct the target image based on the voltage value converted from the intensity of the reflected light. In addition, the computer 6 can also control the type and order of the structured light pattern.

[0033] In one specific example, Zernike ghost imaging is taken as an example to illustrate the fish image acquisition process based on the ghost imaging system.

[0034] The Zernike ghost imaging technology is based on the principle of Zernike transform. Zernike polynomials are used as structured light patterns to illuminate the scene, and a light intensity detector without spatial resolution is used to collect the light intensity reflected from the target. Finally, the discrete inverse Zernike transform is used to reconstruct the target image, wherein the light intensity detector uses a bucket detector.

[0035] In the image acquisition process, it is necessary to generate a structured light pattern first, i.e. Zernike base pattern is taken as an example, and the Zernike base pattern generation is defined in polar coordinates as follows: (1) wherein is the polar coordinate on the unit circle, is the order of the Zernike polynomial, denotes the angular frequency and satisfies , is an even and non-negative integer. denotes the Zernike polynomial of order .

[0036] is a radial polynomial derived from the Jacobi polynomial, and is defined as follows: (2).

[0037] According to the Zernike transformation theory, any two-dimensional image is the result of linear superposition of a series of Zernike base patterns. The weight corresponding to each Zernike base pattern is the Zernike moment. The Zernike moment of a two-dimensional image can be obtained by performing Zernike forward transformation on the image, and the image itself can be obtained by performing inverse transformation on the Zernike moment. Therefore, the process of using Zernike moment for sturgeon image acquisition is to obtain the weight corresponding to each Zernike base pattern corresponding to the image. These patterns are projected onto the sturgeon target and the reflected light intensity from the target is received by the bucket detector.

[0038] Assuming that the target is a reflective target, the reflected intensity of the target in the measurement direction of the bucket detector is , and therefore the relationship between the target image and the reflection intensity distribution of the object is .

[0039] Therefore, the reflected light intensity of the Zernike base pattern after being projected onto the target is : (3).

[0040] wherein D is the projection area of the Zernike base pattern. The light response value of the bucket detector is: (4).

[0041] wherein is the light response value (i.e. direct current component) caused by the background illumination at the detector position, is a factor related to the amplification multiple of the bucket detector and the spatial relationship between the detector and the object.

[0042] In addition, in order to obtain the Zernike moment corresponding to each pixel in the target image, a two-step phase shift method is used, that is, the order is The pattern and its phase shift The two Zernike patterns are projected onto the object respectively. The two Zernike basis patterns are respectively denoted as Z 1, Z 2: (5).

[0043] The bucket detector receives the reflected light from the fish targets of the two Zernike patterns in turn, and performs signal acquisition and analog / digital conversion, and then uses a computer to record the response values ​​T1 and T2 of the bucket detector in turn.

[0044] (6).

[0045] According to the two-step phase shift algorithm, the reflection intensity can be obtained The Zernike transform integral formula is: (7).

[0046] in, represents the Zernike transform. Since the relationship between the object image and the object's reflection intensity distribution is , that is, it satisfies the proportional relationship. Therefore, the Zernike moment in the ghost imaging process of underwater fish targets can be calculated as follows: (8).

[0047] Then, the discrete inverse transform is performed on the Zernike moment to obtain the image itself and realize the reconstruction of the target image. The fish target image thus obtained is not affected by the external environment, and clear fish target images can be obtained in water bodies with different turbidity. The image of underwater fish can be obtained in a non-contact manner. Here, sturgeon is used as the collection object, and reference is made to the Figure 3 The image is of a sturgeon. The resolution of the sturgeon image is 256 pixels (horizontal) × 256 pixels (vertical), and the image is saved in tiff format.

[0048] Step 200: Generate fish body length and fish area based on the target image using a pre-trained target detection model.

[0049] The pre-trained target detection model is obtained by training a preset neural network model using target images with labeled information, including: Acquire target images in different turbidity environments, label the body length and area of the fish on the target images, and generate multiple target images through data enhancement on the target images with labeled information, and construct a data set based on the multiple target images; Train a preset neural network model based on the data set and evaluate the performance until the preset evaluation index is met to stop training, and obtain a target detection model.

[0050] In the present application, in order to verify the applicability of ghost imaging technology in the task of sturgeon weight measurement in actual aquaculture water, the fish weight measurement accuracy under different turbidity is considered. A turbid water sturgeon ghost imaging data set for subsequent weight measurement analysis is constructed. Taking 10 NTU as a fixed step, the turbidity range from 0 NTU to 40 NTU is systematically covered. NTU is the abbreviation of Nephelometric Turbidity Unit, which is "scattering turbidity unit" or "turbidity unit by turbidity method" in Chinese. It is an international standard unit for measuring water turbidity, which is used to quantify the scattering and absorption ability of suspended particles (such as silt, microorganisms, organic matter, etc.) in water.

[0051] Under each specific turbidity condition, the advantages of the imaging system are fully utilized to efficiently acquire ghost imaging data of sturgeon, as shown in Figure 4 The data provides rich and valuable raw materials for subsequent in-depth analysis. Subsequently, based on the image quality evaluation standard, 30 high-definition and high-integrity images are strictly selected from a large number of reconstructed patterns. These selected images can accurately present the morphological characteristics of sturgeon under different turbidity environments, laying a solid and reliable foundation for constructing high-quality data sets.

[0052] For the 30 selected images, the lableme software is used to accurately label the sturgeon in the images, providing clear semantic guidance for subsequent analysis and model training. Finally, with the help of the powerful data enhancement function of the imgaug library, diversified data enhancement operations such as rotation, scaling, flipping, and adding noise are performed on the images while ensuring that the labeled information and key semantic features of the images are not damaged. Through this operation, 150 single-pixel images of sturgeon under different turbidity conditions are successfully obtained, which together constitute the final turbid water sturgeon single-pixel data set. This data set not only expands the number of samples, but also significantly improves the diversity of data, which can effectively meet the needs of various sturgeon weight data analysis and model training, and provide strong support for in-depth exploration of underwater sturgeon single-pixel imaging characteristics and related application research.

[0053] In the model training process, the network input image size of the target detection model is 480 pixels x 640 pixels, the stochastic gradient descent (SGD) optimizer is used, the learning rate of network training is initialized to 0.01, the momentum factor is set to 0.937, the weight decay is set to 0.000 5, the hyperparameter uses hyp.scratch-low, the batch-size is set to 4, and the total Epoch is set to 100 rounds.

[0054] In the present application, the target detection mode is based on the YOLOv5s model framework. In order to evaluate the accuracy of the YOLOv5s model in image recognition, the commonly used performance indicators in target detection are used to measure the proportion of correctly recognized samples in all recognized samples, namely precision (P); the proportion of correctly recognized samples in all real samples, namely recall (R); F1-score (F1) is the harmonic mean of accuracy and recall, which is used to comprehensively measure the performance of the model; mean average precision (mAP) measures the average detection precision of the model in the actual detection process; and the detection time (t) is the average processing time of a single sturgeon image.

[0055] The training results of the turbid water sturgeon ghost imaging data set are sorted, and the data in Table 1 is obtained by calculation. According to the data, the recall rate is 0.934, indicating that the model has strong detection ability for sturgeon targets and is not easy to miss detection; the accuracy is 0.976, indicating that the prediction result has high correctness. The F1-score is 0.985, which proves that the comprehensive performance is good. The mAP_50 reaches 0.988, indicating that the detection accuracy is high when the IoU threshold is 0.5. However, the mAP_50-95 is 0.816, which is relatively low, indicating that under more stringent threshold conditions, the detection accuracy of the model decreases.

[0056] Table 1 Turbid water sturgeon single-pixel data set segmentation results .

[0057] After obtaining the trained target detection model, the fish body length and fish area based on the target image are obtained by the pre-trained target detection model, including: segmenting the fish body picture in the target image by the target detection model to obtain the instance mask image of the fish body; calculating the pixel area of the fish body mask and the diagonal line length of the fish body mask based on the instance mask image of the fish body; The fish area and the fish body length are calculated by a size correction factor obtained in advance based on the pixel area of the fish mask and the diagonal length of the fish mask.

[0058] In the present application, the fish image in the target image is first segmented by a rectangular segmentation preselected frame to obtain an instance mask image of the fish. The area of the instance mask image of the fish corresponding to the segmentation preselected frame is calculated, and the area of the segmentation preselected frame is taken as the pixel area of the fish mask. The area of the segmentation preselected frame is calculated in the following manner: the pixel number of the length of the segmentation preselected frame is multiplied by the pixel number of the width to obtain the area of the segmentation preselected frame. The diagonal length of the segmentation preselected frame is calculated as the diagonal length of the fish mask, and the diagonal length of the segmentation preselected frame can be obtained based on the length and the width of the segmentation preselected frame by the Pythagorean theorem.

[0059] The size correction factor is obtained in the following manner: A marker with a known size area is set in the target image. The marker in the target image is segmented by a target detection model to obtain an instance mask image of the marker. The pixel area of the marker mask is calculated based on the instance mask image of the marker, and the size correction factor is obtained by taking the ratio of the known marker area and the pixel area of the marker mask.

[0060] Specifically, the size area of the marker can be measured in advance or the boundary of a fish tank with a known size is used as the marker. The pixel area of the marker mask is calculated in the same manner as the pixel area of the fish mask. After obtaining the pixel area of the marker mask, the size correction factor is obtained by taking the ratio of the known marker area and the pixel area of the marker mask.

[0061] The fish area is obtained by multiplying the pixel area of the fish mask and the size correction factor, and the fish body length is obtained by multiplying the diagonal length of the fish mask and the size correction factor.

[0062] In the present application, the target detection model obtained by training can accurately identify and segment the instance mask image of the fish based on the target image. The pixel area of the fish mask and the diagonal length of the fish mask are calculated, and the accurate fish area and fish body length are obtained through the size correction factor.

[0063] Step 300: generating a fish weight value based on the fish body length and the fish area by a preset weight prediction model.

[0064] Specifically, the fish body length and the fish area are input into the preset weight prediction model, and the fish body length and the fish area are mapped to a weight prediction value by a multilayer perceptron in the weight prediction model to output a predicted fish weight value.

[0065] In the present application, after obtaining the real body length and area data of sturgeon, a multilayer perceptron is used for weight prediction. The body length and area of sturgeon are selected as key input features. The MLP model constructs the internal relationship between the input features and the weight of sturgeon through deep mining and complex operation on these input features, thereby realizing accurate weight prediction. In terms of MLP model architecture design, the model constructed in this study contains four layers. The first layer is the input layer, responsible for receiving the two input features of body length and area and passing them to the subsequent hidden layers. The middle two layers are hidden layers, which gradually abstract and extract features from the input features through a series of nonlinear transformations. The number of neurons in the hidden layer is carefully debugged and optimized to ensure that the model can learn the key information in the data sufficiently, while avoiding overfitting or underfitting problems. In the hidden layer, the ReLU activation function is used. The ReLU activation function has the advantages of simple calculation, fast convergence speed and effective alleviation of the gradient vanishing problem. When the input value is greater than 0, the output is equal to the input value; when the input value is less than or equal to 0, the output is 0. This nonlinear characteristic enables the MLP model to learn more complex function relationships, enhancing the model's expressive power. Finally, the output layer is set with only one neuron, and the output of this neuron is the predicted weight value of the sturgeon. The present application uses a multilayer perceptron to measure the weight of sturgeon, and the measurement result is as shown in Figure 5 .

[0066] According to the scatter plot of Figure 5 , the relationship between the predicted weight and the actual weight is shown, with a correlation coefficient R of 0.814, indicating a strong positive correlation between the two. Most data points are clustered near the 45° ideal line, indicating that the weight segmentation result has a certain accuracy, and the predicted value is close to the actual value.

[0067] Based on the fish weight non-contact measurement method based on ghost imaging provided by the present application, by projecting the modulated structured light pattern to the fish target, collecting the reflected light intensity and performing discrete inverse transform to reconstruct the target image, clear image reconstruction can be realized, which is not affected by the external environment and reduces the dependence on clear environment; through the target detection model, the fish length and fish area can be obtained, providing accurate data basis for subsequent fish weight prediction; through the weight prediction model, the fish weight can be predicted, without the need to catch the fish to obtain the weight information of the fish, avoiding damage to the fish body. The present application realizes clear image reconstruction under different turbidity conditions of 0~40 NTU, with a target detection accuracy of 0.976, a recall rate of 0.994, an mAP_50 of 0.988, and a predicted weight R² of 0.814, which is significantly better than the traditional image method. It has the advantages of low cost, low power consumption, miniaturization, easy deployment, etc., and is especially suitable for non-contact aquaculture measurement in complex water environment.

[0068] Reference Figure 6The application further discloses a fish weight non-contact measurement system based on ghost imaging, which comprises the following: The imaging module 110 is used for projecting the modulated structured light pattern to the fish target, acquiring the light pattern reflected by the fish target through a preset light intensity detector, and performing discrete inverse transformation to reconstruct the target image. The fish parameter acquisition module 120 is used for acquiring the fish length and the fish area based on the target image through a pre-trained target detection model. The weight prediction module 130 is used for generating the fish weight value based on the fish length and the fish area through a preset weight prediction model. The pre-trained target detection model is obtained by training a preset target detection model through a target image with annotation information, and the annotation information comprises the fish length and the fish area.

[0069] The method for projecting the modulated structured light pattern to the fish target, acquiring the light intensity reflected by the fish target through a preset light intensity detector, and performing discrete inverse transformation to reconstruct the target image based on the reflected light intensity comprises the following steps. The light emitted by a preset light source is projected to a spatial light modulator for modulation, so as to obtain a structured light pattern and project the structured light pattern to the fish target. The structured light pattern is reflected by the fish target to generate reflected light, and the light intensity of the reflected light is acquired through a preset light intensity detector. The target image is reconstructed through discrete inverse transformation based on the reflected light intensity.

[0070] The pre-trained target detection model is obtained by training a preset neural network model through a target image with annotation information, and the method comprises the following steps. Target images under different turbidity environments are acquired, the fish length and the fish area are labeled on the target images, a plurality of target images are generated through data enhancement of the target images with the annotation information, and a data set is constructed based on the plurality of target images. The preset neural network model is trained based on the data set and the performance is evaluated until the preset evaluation index is met to stop the training, so as to obtain the target detection model.

[0071] The fish length and the fish area are acquired based on the target image through the pre-trained target detection model, and the method comprises the following steps. The fish body picture in the target image is segmented through the target detection model to obtain an instance mask image of the fish body. The pixel area of the fish body mask and the diagonal line length of the fish body mask are calculated based on the instance mask image of the fish body. The fish area and the fish length are calculated through a size correction factor acquired in advance based on the pixel area of the fish body mask and the diagonal line length of the fish body mask.

[0072] The size correction factor acquisition method is: setting a marker of a known size area in a target image; segmenting the marker in the target image through a target detection model to obtain an instance mask image of the marker; calculating a pixel area of a marker mask based on the instance mask image of the marker, and obtaining a size correction factor by calculating a ratio of a known marker area and the pixel area of the marker mask.

[0073] generate a fish weight value based on the fish length and the fish area through a preset weight prediction model, including: input the fish length and the fish area into the preset weight prediction model, calculate a nonlinear combination of weight parameters through forward propagation, and output a predicted fish weight value.

[0074] The fish weight non-contact measurement system based on ghost imaging provided by the application can realize clear image reconstruction, is not affected by the external environment, and reduces the dependence on a clear environment; the fish length and the fish area can be obtained through the target detection model, and accurate data basis is provided for subsequent fish weight prediction; the fish weight prediction model is used to realize fish weight prediction, the weight information of the fish can be obtained without catching the fish, and damage to the fish body is avoided. The application can realize clear image reconstruction under different turbidity conditions of 0~40 NTU, the target detection accuracy is 0.976, the recall rate is 0.994, the mAP_50 is 0.988, the prediction weight R² is 0.814, and the application is significantly better than the traditional image method. The application has the advantages of low cost, low power consumption, miniaturization, easy deployment and the like, and is particularly suitable for non-contact aquaculture measurement in a complex water environment.

[0075] Figure 7 An example of an entity structure diagram of an electronic device is shown in Figure 7As shown, the electronic device can include a processor 710, a communications interface 720, a memory 730, and a communications bus 740, wherein the processor 710, the communications interface 720, and the memory 730 complete mutual communication through the communications bus 740. The processor 710 can invoke a logic instruction in the memory 730 to execute a fish weight non-contact measurement method based on ghost imaging, which includes: projecting a modulated structured light pattern to a fish target, acquiring light intensity reflected by the fish target through a preset light intensity detector, and reconstructing a target image through a discrete inverse transform based on the reflected light intensity; generating a fish length and a fish area based on the target image through a pre-trained target detection model; and generating a fish weight value based on the fish length and the fish area through a preset weight prediction model; wherein the pre-trained target detection model is obtained by training a preset neural network model with a target image with labeled information, and the labeled information includes the fish length and the fish area.

[0076] In addition, the logic instruction in the memory 730 described above can be implemented in the form of a software functional unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.

[0077] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program being stored in a non-transitory computer readable storage medium, and the computer program being executable by a processor to enable a computer to perform the ghost imaging based non-contact fish weight measurement method provided by the above method, the method comprising: projecting a modulated structured light pattern to a fish target, obtaining light intensity reflected by the fish target through a preset light intensity detector, reconstructing a target image through discrete inverse transform based on the reflected light intensity; generating a fish length and a fish area based on the target image through a pre-trained target detection model; and generating a fish weight value based on the fish length and the fish area through a preset weight prediction model; wherein the pre-trained target detection model is obtained by training a preset neural network model with target images with annotation information, and the annotation information comprises the fish length and the fish area.

[0078] In yet another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, the computer program being executable by a processor to implement the ghost imaging based non-contact fish weight measurement method provided by the above method, the method comprising: projecting a modulated structured light pattern to a fish target, obtaining light intensity reflected by the fish target through a preset light intensity detector, reconstructing a target image through discrete inverse transform based on the reflected light intensity; generating a fish length and a fish area based on the target image through a pre-trained target detection model; and generating a fish weight value based on the fish length and the fish area through a preset weight prediction model; wherein the pre-trained target detection model is obtained by training a preset neural network model with target images with annotation information, and the annotation information comprises the fish length and the fish area.

[0079] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the present embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0080] Those skilled in the art can clearly understand the technical solutions of the various embodiments from the above description of the embodiments, and the various embodiments can be implemented by means of software with the necessary general hardware platforms, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that makes a contribution, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0081] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A non-contact measurement method for fish weight based on ghost imaging, characterized in that: include: The modulated structured light pattern is projected onto the fish target, the intensity of the light reflected by the fish target is obtained through a preset light intensity detector, and the target image is reconstructed through discrete inverse transform based on the reflected light intensity; Generate fish body length and fish area based on the target image through a pre-trained target detection model; Generating a fish weight value based on the fish body length and fish area through a preset weight prediction model; The pre-trained target detection model is obtained by training a preset neural network model with target images with labeled information, and the labeled information includes fish body length and fish area.

2. The method for non-contact measurement of fish weight based on ghost imaging according to claim 1, characterized in that: The method of projecting a modulated structured light pattern onto a fish target includes: The light emitted by the preset light source is projected onto the spatial light modulator for modulation to obtain a structured light pattern and projected onto the fish target.

3. The method for non-contact measurement of fish weight based on ghost imaging according to claim 1, characterized in that: The pre-trained target detection model is obtained by training a preset neural network model using target images with labeled information, including: Obtain target images in different turbidity environments, annotate the body length and area of ​​fish on the target images, perform data augmentation on the target images with annotated information to generate multiple target images, and construct a dataset based on the multiple target images; The preset neural network model is trained based on the data set and its performance is evaluated until the preset evaluation index is met and the training is stopped to obtain the target detection model.

4. The method for non-contact measurement of fish weight based on ghost imaging according to claim 1, characterized in that: The obtaining of the fish body length and fish area based on the target image by using a pre-trained target detection model includes: Segmenting the fish body image in the target image using a target detection model to obtain an instance mask image of the fish body; Calculate the pixel area and diagonal length of the fish mask based on the fish mask instance image; Based on the pixel area of ​​the fish mask and the diagonal length of the fish mask, the fish area and fish body length are calculated using the pre-acquired size correction factor.

5. The method for non-contact measurement of fish weight based on ghost imaging according to claim 4, characterized in that: The method for obtaining the size correction factor is: Setting a marker with a known size in the target image; Segmenting the marker in the target image using a target detection model to obtain an instance mask image of the marker; The pixel area of ​​the marker mask is calculated based on the instance mask image of the marker, and the ratio of the known marker area to the pixel area of ​​the marker mask is calculated to obtain the size correction factor.

6. The method for non-contact measurement of fish weight based on ghost imaging according to claim 1, characterized in that: The method of generating the fish weight value based on the fish body length and fish area by using a preset weight prediction model includes: The fish body length and fish area are input into a preset weight prediction model, and the fish body length and fish area are mapped to weight prediction values ​​through a multi-layer perceptron in the weight prediction model, and the predicted fish weight value is output.

7. A non-contact fish weight measurement system based on ghost imaging, characterized in that: The system comprises: An imaging module is used to project a modulated structured light pattern onto a fish target, obtain the light pattern reflected by the fish target through a preset light intensity detector, and perform a discrete inverse transform to reconstruct the target image; A fish parameter acquisition module, configured to acquire fish body length and fish area based on the target image through a pre-trained target detection model; A weight prediction module, configured to generate a fish weight value based on the fish body length and fish area using a preset weight prediction model; The pre-trained target detection model is obtained by training a preset target detection model with a target image having labeled information, and the labeled information includes the body length and area of ​​the fish.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the non-contact measurement method of fish weight using ghost imaging as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the non-contact measurement method of fish weight using ghost imaging as described in any one of claims 1 to 6 is implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the non-contact measurement method of fish weight using ghost imaging as described in any one of claims 1 to 6 is implemented.