Fish body weight estimation method and system
By using ordinary cameras in the fish pond to obtain pictures and adopt a two-stage recognition method, including category recognition and length recognition, the problem of fish weight estimation is solved, and high accuracy and high efficiency fish weight estimation is achieved.
Patent Information
- Application Number
- CN202411464248.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art is difficult to effectively estimate the weight of fish in a fish pond through pictures obtained by ordinary cameras, especially when fish are dense and irregular.
The two-stage recognition method is adopted. First, the fish body is identified through the preset category recognition model, the pictures are cropped and binarized, and the fish body outline data is calculated to judge the standardity of the picture; then, the standard picture is identified using the preset length recognition model, and the fish body weight is estimated based on the length.
It improves the accuracy and efficiency of fish weight estimation, reduces the impact of noise, and can effectively process pictures obtained by ordinary cameras, and is suitable for scenes with dense fish and irregular postures.
Smart Images

Figure CN119516301A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method and system for estimating fish weight. Background Art
[0002] In the scenario of smart fisheries, it is necessary to keep an eye on the growth status of fish, that is, the weight measurement of fish at different stages is particularly important. However, the current fish farming is intensive farming, that is, the pictures taken by underwater cameras contain a lot of fish, most of which only show part of the fish body, and most of the fish have irregular postures, which makes weight estimation more difficult.
[0003] In the existing technology, laser ranging and binocular cameras are often used for monitoring, which will increase the cost. In the existing technology, it is difficult to estimate the weight of fish in the fish pond through pictures obtained by ordinary cameras.
[0004] There is currently no effective solution to the above problems in the prior art. Summary of the invention
[0005] To solve the above problems, the present invention provides a method and system for estimating the weight of fish. By performing two-stage recognition on pictures obtained by an ordinary camera, the length of the fish is obtained, and the weight of the fish is estimated based on the length of the fish. This can accurately predict the growth of fish in the fish pond, thereby solving the problem of how to estimate the weight of fish in a fish pond using pictures obtained by an ordinary camera.
[0006] To achieve the above-mentioned purpose, the present invention provides a method for estimating fish weight, comprising: obtaining an original picture, and performing image preprocessing on the original picture to obtain a first picture to be identified; using a preset category recognition model to identify the first picture to be identified, and obtaining a hit area of a target category fish body; wherein the preset category recognition model is obtained in advance through model training; cropping the hit area from the first picture to be identified, and binarizing it to obtain a second picture to be identified; calculating the contour data of the fish body in the second picture to be identified, and judging whether the second picture to be identified is a standard picture based on the contour data; when the second picture to be identified is a standard picture, using a preset length recognition model to identify the second picture to be identified, and obtaining the fish body length; wherein the preset length recognition model is obtained in advance through model training; and calculating the fish body weight based on the fish body length.
[0007] Further optionally, the preset length recognition model is obtained through model training, including: binarizing each training image in the original training set to obtain a processed training set; wherein each training image is an image of only a single target category fish; adding a fully connected layer with an output dimension of 1 to the model output of the encoder-only model to obtain a neural network to be trained, and training the neural network to be trained according to the processed training set to obtain the preset length recognition model.
[0008] Further optionally, performing image preprocessing on the original image to obtain the first image to be identified includes: cropping the original image to predetermined sizes in four directions respectively; and filling the cropped portion of the original image with black to obtain the first image to be identified.
[0009] Further optionally, judging whether the second picture to be identified is a standard picture based on the contour data includes: calculating the aspect ratio of the fish body based on the vertex coordinates in the second picture to be identified; when the aspect ratio falls within a preset aspect ratio range, judging that the second picture to be identified is a standard picture; otherwise, the second picture to be identified is a non-standard picture.
[0010] Further optionally, the fish weight is calculated according to the fish length by the following formula:
[0011] weight=alen b
[0012] Among them, weight represents the weight of the fish, a and b are constants, and len represents the length of the fish.
[0013] On the other hand, the present invention also provides a fish weight estimation system, comprising: a preprocessing module, used to obtain an original picture, and perform image preprocessing on the original picture to obtain a first picture to be identified; a target recognition module, used to use a preset category recognition model to identify the first picture to be identified, and obtain a hit area of a target category fish body; wherein the preset category recognition model is obtained in advance through model training; a binarization module, used to crop the hit area from the first picture to be identified, and perform binarization to obtain a second picture to be identified; a picture selection module, used to calculate the contour data of the fish body in the second picture to be identified, and determine whether the second picture to be identified is a standard picture based on the contour data; a length recognition module, used to use a preset length recognition model to identify the second picture to be identified when the second picture to be identified is a standard picture, and obtain the fish length; wherein the preset length recognition model is obtained in advance through model training; a weight calculation module, used to calculate the fish weight based on the fish length.
[0014] Further optional, it includes: a training set processing module, used to binarize each training image in the original training set to obtain a processed training set; wherein each training image is a picture of only a single target category fish; a model training module, used to add a fully connected layer with an output dimension of 1 to the model output of the encoder-only model to obtain a neural network to be trained, and train the neural network to be trained according to the processed training set to obtain a preset length recognition model.
[0015] Further optionally, the preprocessing module includes: a cropping submodule, used to crop predetermined sizes from four directions of the original image respectively; and a filling submodule, used to fill the cropped part of the original image with black to obtain a first image to be identified.
[0016] Further optionally, the image selection module includes: an aspect ratio calculation submodule, used to calculate the aspect ratio of the fish body according to the vertex coordinates in the second image to be identified; a judgment submodule, used to judge that the second image to be identified is a standard image when the aspect ratio falls within a preset aspect ratio range; otherwise, the second image to be identified is a non-standard image.
[0017] Further optionally, the fish weight is calculated according to the fish length by the following formula:
[0018] weight=alen b
[0019] Among them, weight represents the weight of the fish, a and b are constants, and len represents the length of the fish.
[0020] The above technical scheme has the following beneficial effects: before target recognition, the image is preprocessed to reduce the influence of noise and improve the accuracy of the final estimation result; the fish of the target category is firstly identified through a preset category recognition model to determine the hit area, and then the fish body length is identified for the picture belonging to the hit area through a preset length recognition model, and finally the fish body weight is estimated by the length to improve the accuracy of the estimation result; before length recognition, unreasonable photos are filtered according to contour data to improve the estimation accuracy; before length recognition, the picture is binarized to reduce the data volume and improve the data processing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 is a flow chart of a fish weight estimation method provided by an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of a binarized picture provided by an embodiment of the present invention;
[0024] Figure 3 is a flow chart of a preset length recognition model training method provided by an embodiment of the present invention;
[0025] Figure 4 is a flow chart of an image preprocessing method provided by an embodiment of the present invention;
[0026] Figure 5 is a flow chart of a standard image screening method provided by an embodiment of the present invention;
[0027] Figure 6 is a schematic diagram of the structure of a fish weight estimation system provided by an embodiment of the present invention;
[0028] Figure 7 It is a structural schematic diagram of a module for training a preset length recognition model provided by an embodiment of the present invention;
[0029] Figure 8 is a schematic diagram of the structure of a preprocessing module provided in an embodiment of the present invention;
[0030] Fig. 9 It is a structural diagram of a picture selection module provided in an embodiment of the present invention.
[0031] Figure numerals: 100-preprocessing module; 1001-cropping submodule; 1002-filling submodule; 200-target recognition module; 300-binarization module; 400-image selection module; 4001-aspect ratio calculation submodule; 4002-judgment submodule; 500-length recognition module; 600-weight calculation module; 700-training set processing module; 800-model training module. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] In order to solve the problem in the prior art that it is difficult to estimate the weight of a fish using pictures obtained by an ordinary camera, an embodiment of the present invention provides a method for estimating the weight of a fish. Figure 1 is a flow chart of a fish weight estimation method provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0034] S1, obtaining an original image, and performing image preprocessing on the original image to obtain a first image to be identified;
[0035] An ordinary camera is placed in the breeding pond, and the shooting frequency can be set so that the ordinary camera can take pictures at a fixed time to obtain a series of original pictures.
[0036] Each original image is preprocessed to remove noise from the image and obtain a first image to be identified to ensure subsequent identification accuracy.
[0037] S2, using a preset category recognition model to recognize the first image to be recognized, and obtaining a hit area of the target category fish body; wherein the preset category recognition model is obtained in advance through model training;
[0038] The pre-trained preset category recognition model is used to perform target recognition on the first image to be recognized. If a target category fish exists in the first image to be recognized, the preset category recognition model can output a target frame of the target category fish, i.e., a hit area, and annotate the category of the fish. The preset category recognition model is pre-trained using a data set of the target category fish.
[0039] As an optional implementation, the yolov8 neural network is used to perform target detection training on the data set to obtain a preset category recognition model.
[0040] Different category recognition models need to be trained for different categories of fish. For example, when the target category is sea bass, during the model training phase, the images captured by the ordinary camera can be labeled as sea bass, and the labeled images can be used as data sets for model training to obtain a preset category recognition model. During the target recognition phase, the first image to be recognized is input into the preset category recognition model. If the first image to be recognized contains sea bass, the preset category recognition model will output the hit area with sea bass selected.
[0041] S3, cutting out a hit area from the first image to be identified, and performing binarization to obtain a second image to be identified;
[0042] According to the frame coordinates of the hit area, the area can be cropped from the first image to be identified to obtain a cropped image, which only includes one fish of the target category. Afterwards, the cropped image is binarized to obtain a second image to be identified. Figure 2 is a schematic diagram of a binarized picture provided by an embodiment of the present invention, such as Figure 2 As shown, in the second picture to be identified, the fish body part is white and the background part is black.
[0043] S4, calculating the contour data of the fish body in the second picture to be identified, and judging whether the second picture to be identified is a standard picture according to the contour data;
[0044] Since the second image to be identified is a binary image, each pixel corresponds to a coordinate, so the contour data can be calculated by the coordinates of the fish body part. For fish of different cycles, their contour data should be within a normal range. Whether the fish body in the image is a standard fish body is determined based on whether the contour data is within the normal range, so as to perform image screening. The image within the normal range obtained by screening is the standard image, which is used to represent the general level of fish in the breeding pond.
[0045] S5. When the second picture to be identified is a standard picture, the second picture to be identified is identified using a preset length recognition model to obtain the length of the fish body; wherein the preset length recognition model is obtained in advance through model training;
[0046] The length of the standard image is recognized, specifically, the length of the second image to be recognized is recognized through a preset length recognition model, and the length of the fish body is output.
[0047] The preset length recognition model can be trained in advance through a picture of a single target type of fish. The original training set used to train the preset length recognition model needs to include: side photos of the target type of fish from different angles; pictures of the target type of fish at different growth periods (such as pictures of the target type of fish that have been farmed for 1, 2, 3, ..., 12 months).
[0048] S6. Calculate the weight of the fish according to its length.
[0049] The relationship between the length of the fish and the weight of the fish is pre-constructed. For example, the relationship formula between the length of the fish and the weight of the fish can be constructed by fitting the actual data of the length of the fish and the weight of the fish. The weight of the fish is estimated by the formula. The weight of the fish represents the growth of all the same fish in the current fish pond.
[0050] As an optional implementation, Figure 3 is a flow chart of a preset length recognition model training method provided by an embodiment of the present invention. Figure 3 As shown, a preset length recognition model is obtained through model training, including:
[0051] S7, performing binarization processing on each training image in the original training set to obtain a processed training set; wherein each training image is an image of only a single target fish;
[0052] S8. Add a fully connected layer with an output dimension of 1 to the model output of the encoder-only model to obtain a neural network to be trained. Train the neural network to be trained according to the processed training set to obtain a preset length recognition model.
[0053] The original training set includes multiple training images, each of which contains only a single target fish. Each training image is binarized to obtain a processed training set.
[0054] Use the encoder-only model, add an fc layer (fully connected layer) to the model output, and the output dimension is 1. Use the processed training set to train the neural network, where the output of the fc layer and the length of the perch are used. Use the mse loss to train the encoder-only model until the model converges and obtains the preset length recognition model.
[0055] The encoder-only model mainly uses the model to learn the contours of different growth cycles, such as: the ratio of head circumference and width to body length, the size of fish fins, the size of fish tail and the ratio of fish head. These size and proportion information are different in different growth cycles, so the model can be used to learn this information to achieve the purpose of identifying the true length of the fish body.
[0056] In addition, different length recognition models need to be trained for different types of fish.
[0057] As an optional implementation, Figure 4 is a flow chart of an image preprocessing method provided by an embodiment of the present invention. Figure 4 As shown, the original image is preprocessed to obtain a first image to be identified, including:
[0058] S101, cropping the original image into predetermined sizes in four directions respectively;
[0059] S102: Fill the cropped portion of the original image with black to obtain a first image to be recognized.
[0060] Since the density of fish in the breeding pond is very high, the periphery of the captured picture is most likely fish in the distance, and they are all crowded together, which cannot be considered a good side view. These peripheral parts are noise data for our scene and need to be eliminated. In addition, it takes a long time to determine the growth cycle of fish, and the time consumed by pre-screening most of the invalid data by cropping is acceptable.
[0061] As an optional implementation, the four sides of the original image are cropped to predetermined sizes respectively, and the cropping can be performed at one quarter of the top, bottom, left, and right of the original image, and the cropped parts are filled with black to obtain the first image to be identified.
[0062] As an optional implementation, Figure 5 is a flow chart of a standard image screening method provided by an embodiment of the present invention. Figure 5 As shown, judging whether the second picture to be identified is a standard picture according to the outline data includes:
[0063] S401, calculating the aspect ratio of the fish body according to the vertex coordinates in the second picture to be identified;
[0064] S402: When the aspect ratio falls within a preset aspect ratio range, determine that the second picture to be identified is a standard picture; otherwise, determine that the second picture to be identified is a non-standard picture.
[0065] Each pixel in the second image to be identified after binarization has corresponding coordinates, and the length and width of the fish body can be calculated by fuzzy vertex coordinates. For example, the distance between the two vertices of the longest line in the length direction of the fish body is the length, and the distance between the two vertices of the longest line in the width direction is the width.
[0066] As an optional implementation, the fish weight is calculated according to the fish length by the following formula:
[0067] weight=alen b
[0068] Among them, weight represents the weight of the fish, a and b are constants, and len represents the length of the fish.
[0069] By actually measuring the length and corresponding weight of a batch of fish of the same category, and collecting the length and weight data at different growth stages, a data set can be formed. The collected data set can be used to fit the constants a and b in the formula using statistical or machine learning methods, so that the length can be converted into weight more accurately.
[0070] The embodiment of the present invention also provides a fish weight estimation system. Figure 6 FIG. 1 is a schematic diagram of the structure of a fish weight estimation system provided by an embodiment of the present invention. Figure 6 As shown, the system includes:
[0071] The preprocessing module 100 is used to obtain an original image and perform image preprocessing on the original image to obtain a first image to be identified;
[0072] An ordinary camera is placed in the breeding pond, and the shooting frequency can be set so that the ordinary camera can take pictures at a fixed time to obtain a series of original pictures.
[0073] Each original image is preprocessed to remove noise from the image and obtain a first image to be identified to ensure subsequent identification accuracy.
[0074] The target recognition module 200 is used to recognize the first image to be recognized by using a preset category recognition model to obtain a hit area of a target category fish; wherein the preset category recognition model is obtained in advance by model training;
[0075] The pre-trained preset category recognition model is used to perform target recognition on the first image to be recognized. If a target category fish exists in the first image to be recognized, the preset category recognition model can output a target frame of the target category fish, i.e., a hit area, and annotate the category of the fish. The preset category recognition model is pre-trained using a data set of the target category fish.
[0076] As an optional implementation, the yolov8 neural network is used to perform target detection training on the data set to obtain a preset category recognition model.
[0077] Different category recognition models need to be trained for different categories of fish. For example, when the target category is sea bass, during the model training phase, the images captured by the ordinary camera can be labeled as sea bass, and the labeled images can be used as data sets for model training to obtain a preset category recognition model. During the target recognition phase, the first image to be recognized is input into the preset category recognition model. If the first image to be recognized contains sea bass, the preset category recognition model will output the hit area with sea bass selected.
[0078] A binarization module 300 is used to cut out a hit area from the first image to be identified and perform binarization to obtain a second image to be identified;
[0079] According to the coordinates of the bounding box of the hit area, the area can be cropped from the first image to be identified to obtain a cropped image, which only includes one fish of the target category. Then, the cropped image is binarized to obtain a second image to be identified. Figure 2 As shown, in the second picture to be identified, the fish body part is white and the background part is black.
[0080] The picture selection module 400 is used to calculate the contour data of the fish body in the second picture to be identified, and determine whether the second picture to be identified is a standard picture according to the contour data;
[0081] Since the second image to be identified is a binary image, each pixel corresponds to a coordinate, so the contour data can be calculated by the coordinates of the fish body part. For fish of different cycles, their contour data should be within a normal range. Whether the fish body in the image is a standard fish body is determined based on whether the contour data is within the normal range, so as to perform image screening. The image within the normal range obtained by screening is the standard image, which is used to represent the general level of fish in the breeding pond.
[0082] The length recognition module 500 is used to recognize the second picture to be recognized by using a preset length recognition model to obtain the length of the fish body when the second picture to be recognized is a standard picture; wherein the preset length recognition model is obtained in advance by model training;
[0083] The length of the standard image is recognized, specifically, the length of the second image to be recognized is recognized through a preset length recognition model, and the length of the fish body is output.
[0084] The preset length recognition model can be trained in advance through a picture of a single target type of fish. The original training set used to train the preset length recognition model needs to include: side photos of the target type of fish from different angles; pictures of the target type of fish at different growth periods (such as pictures of the target type of fish that have been farmed for 1, 2, 3, ..., 12 months).
[0085] The weight calculation module 600 is used to calculate the weight of the fish body according to the length of the fish body.
[0086] The relationship between the length of the fish and the weight of the fish is pre-constructed. For example, the relationship formula between the length of the fish and the weight of the fish can be constructed by fitting the actual data of the length of the fish and the weight of the fish. The weight of the fish is estimated by the formula. The weight of the fish represents the growth of all the same fish in the current fish pond.
[0087] As an optional implementation, Figure 7 is a schematic diagram of the structure of a module for training a preset length recognition model provided by an embodiment of the present invention, such as Figure 7 As shown, the system also includes:
[0088] The training set processing module 700 is used to perform binarization processing on each training image in the original training set to obtain a processed training set; wherein each training image is an image of only a single target fish;
[0089] The model training module 800 is used to add a fully connected layer with an output dimension of 1 to the model output of the encoder-only model to obtain a neural network to be trained, and train the neural network to be trained according to the processed training set to obtain a preset length recognition model.
[0090] The original training set includes multiple training images, each of which contains only a single target fish. Each training image is binarized to obtain a processed training set.
[0091] Use the encoder-only model, add an fc layer (fully connected layer) to the model output, and the output dimension is 1. Use the processed training set to train the neural network, where the output of the fc layer and the length of the perch are used. Use the mse loss to train the encoder-only model until the model converges and obtains the preset length recognition model.
[0092] The encoder-only model mainly uses the model to learn the contours of different growth cycles, such as: the ratio of head circumference and width to body length, the size of fish fins, the size of fish tail and the ratio of fish head. These size and proportion information are different in different growth cycles, so the model can be used to learn this information to achieve the purpose of identifying the true length of the fish body.
[0093] In addition, different length recognition models need to be trained for different types of fish.
[0094] As an optional implementation, Figure 8 1 is a schematic diagram of the structure of a preprocessing module provided in an embodiment of the present invention. The preprocessing module 100 includes:
[0095] The cropping submodule 1001 is used to crop the original image into predetermined sizes in four directions respectively;
[0096] The filling submodule 1002 is used to fill the cropped part of the original image with black to obtain a first image to be recognized.
[0097] Since the density of fish in the breeding pond is very high, the periphery of the captured picture is most likely fish in the distance, and they are all crowded together, which cannot be considered a good side view. These peripheral parts are noise data for our scene and need to be eliminated. In addition, it takes a long time to determine the growth cycle of fish, and the time consumed by pre-screening most of the invalid data by cropping is acceptable.
[0098] As an optional implementation, the four sides of the original image are cropped to predetermined sizes respectively, and the cropping can be performed at one quarter of the top, bottom, left, and right of the original image, and the cropped parts are filled with black to obtain the first image to be identified.
[0099] As an optional implementation, Fig. 9 is a structural diagram of a picture selection module provided by an embodiment of the present invention, such as Fig. 9 As shown, the picture selection module 400 includes:
[0100] Aspect ratio calculation submodule 4001, used to calculate the aspect ratio of the fish body according to the vertex coordinates in the second image to be identified;
[0101] The judgment submodule 4002 is used to judge that the second picture to be identified is a standard picture when the aspect ratio falls within a preset aspect ratio range; otherwise, the second picture to be identified is a non-standard picture.
[0102] Each pixel in the second image to be identified after binarization has corresponding coordinates, and the length and width of the fish body can be calculated by fuzzy vertex coordinates. For example, the distance between the two vertices of the longest line in the length direction of the fish body is the length, and the distance between the two vertices of the longest line in the width direction is the width.
[0103] As an optional implementation, the fish weight is calculated according to the fish length by the following formula:
[0104] weight=alen b
[0105] Among them, weight represents the weight of the fish, a and b are constants, and len represents the length of the fish.
[0106] By actually measuring the length and corresponding weight of a batch of fish of the same category, and collecting the length and weight data at different growth stages, a data set can be formed. The collected data set can be used to fit the constants a and b in the formula using statistical or machine learning methods, so that the length can be converted into weight more accurately.
[0107] The above technical scheme has the following beneficial effects: before target recognition, the image is preprocessed to reduce the influence of noise and improve the accuracy of the final estimation result; the fish of the target category is firstly identified through a preset category recognition model to determine the hit area, and then the fish body length is identified for the picture belonging to the hit area through a preset length recognition model, and finally the fish body weight is estimated by the length to improve the accuracy of the estimation result; before length recognition, unreasonable photos are filtered according to contour data to improve the estimation accuracy; before length recognition, the picture is binarized to reduce the data volume and improve the data processing speed.
[0108] The specific implementation methods of the above invention further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above content is only the specific implementation methods of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for estimating fish weight, characterized in that: include: Acquire an original image, and perform image preprocessing on the original image to obtain a first image to be identified; Using a preset category recognition model to recognize the first image to be recognized, and obtaining a hit area of a target category fish; wherein the preset category recognition model is obtained in advance through model training; Cutting out the hit area from the first picture to be identified and performing binarization to obtain a second picture to be identified; Calculating the contour data of the fish body in the second picture to be identified, and judging whether the second picture to be identified is a standard picture according to the contour data; When the second image to be identified is a standard image, a preset length recognition model is used to identify the second image to be identified to obtain the length of the fish body; wherein the preset length recognition model is obtained in advance through model training; The fish weight is calculated according to the fish length.
2. The method for estimating fish weight according to claim 1, characterized in that: The step of obtaining the preset length recognition model through model training includes: Binarization is performed on each training image in the original training set to obtain a processed training set; wherein each training image is an image of only a single target fish; A fully connected layer with an output dimension of 1 is added to the model output of the encoder-only model to obtain a neural network to be trained, and the neural network to be trained is trained according to the processed training set to obtain a preset length recognition model.
3. The method for estimating fish weight according to claim 1, characterized in that: The performing image preprocessing on the original image to obtain a first image to be identified includes: Cutting the original image into predetermined sizes in four directions respectively; The cropped portion of the original image is filled with black to obtain a first image to be recognized.
4. The method for estimating fish weight according to claim 1, characterized in that: The determining, according to the outline data, whether the second picture to be identified is a standard picture includes: Calculate the aspect ratio of the fish body according to the vertex coordinates in the second picture to be identified; When the aspect ratio falls within a preset aspect ratio range, the second picture to be identified is determined to be a standard picture; otherwise, the second picture to be identified is a non-standard picture.
5. The method for estimating fish weight according to claim 1, characterized in that: The fish weight is calculated according to the fish length by the following formula: weight=alen b Among them, weight represents the weight of the fish, a and b are constants, and len represents the length of the fish.
6. A fish weight estimation system, characterized in that: include: A preprocessing module, used to obtain an original image and perform image preprocessing on the original image to obtain a first image to be identified; A target recognition module, used to recognize the first image to be recognized by using a preset category recognition model to obtain a hit area of a target category fish; wherein the preset category recognition model is obtained in advance by model training; A binarization module, used for cutting out the hit area from the first picture to be identified, and performing binarization to obtain a second picture to be identified; A picture selection module, used for calculating the contour data of the fish body in the second picture to be identified, and judging whether the second picture to be identified is a standard picture according to the contour data; A length recognition module, used for, when the second picture to be recognized is a standard picture, using a preset length recognition model to recognize the second picture to be recognized, so as to obtain the length of the fish body; wherein the preset length recognition model is obtained in advance through model training; The weight calculation module is used to calculate the weight of the fish body according to the length of the fish body.
7. The fish weight estimation system according to claim 6, characterized in that: include: A training set processing module is used to perform binarization processing on each training image in the original training set to obtain a processed training set; wherein each training image is an image of only a single target fish; The model training module is used to add a fully connected layer with an output dimension of 1 to the model output of the encoder-only model to obtain a neural network to be trained, and train the neural network to be trained according to the processed training set to obtain a preset length recognition model.
8. The fish weight estimation system according to claim 6, characterized in that: The preprocessing module comprises: A cropping submodule, used for cropping the original image into predetermined sizes in four directions respectively; The filling submodule is used to fill the cropped part of the original image with black to obtain a first image to be recognized.
9. The fish weight estimation system according to claim 6, characterized in that: The picture selection module includes: An aspect ratio calculation submodule, used to calculate the aspect ratio of the fish body according to the vertex coordinates in the second image to be identified; The judging submodule is used to judge that the second picture to be identified is a standard picture when the aspect ratio falls within a preset aspect ratio interval; otherwise, the second picture to be identified is a non-standard picture.
10. The fish weight estimation system according to claim 6, characterized in that: The fish weight is calculated according to the fish length by the following formula: weight=alen b Among them, weight represents the weight of the fish, a and b are constants, and len represents the length of the fish.