An intelligent fish fry size, color, and sex selection system based on morphological feature recognition
By combining the improved YOLO algorithm and OpenCV with X-ray imaging technology, intelligent screening of fish fry size, color, and sex has been achieved, solving the identification problem in the seedling raising process, improving screening efficiency and accuracy, and making it suitable for microcontroller deployment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO AGRI UNIV
- Filing Date
- 2024-12-20
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies are insufficient for efficiently identifying and screening fish fry by size, color, and sex, leading to problems such as cannibalism between fish of different sizes, difficulty in selecting ornamental fish, and low efficiency in sex selection during the fry rearing process.
An intelligent fish fry size, color, and sex selection system based on morphometric feature recognition is adopted. It utilizes an improved YOLO algorithm and OpenCV combined with X-ray imaging, and identifies the morphology, color, and sex characteristics of fish fry through an image adaptive enhancement algorithm and CA attention mechanism. Combined with baffle control, automatic sorting is achieved.
It improves the accuracy of fish fry identification and screening efficiency, reduces the time and cost of manual operation, and achieves fast and accurate fish fry sorting, which is suitable for single-chip microcomputer deployment.
Smart Images

Figure CN119422988B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fish fry screening technology, and more specifically, to an intelligent fish fry size, color, and sex screening system based on morphological measurement feature recognition. Background Technology
[0002] "Grain production begins with seed industry," and the development of the aquaculture industry also revolves around artificial breeding. In aquaculture seedling enterprises, due to individual differences in fry, significant size variations often occur as the fry grow to a certain stage. If feeding is not timely, larger fish often eat smaller ones, leading to cannibalism and losses. Furthermore, injured fry are more susceptible to infections and parasites, posing a significant risk to the fry. Therefore, fry separation is necessary in the production process to prevent cannibalism. However, manual separation is time-consuming, labor-intensive, and prone to errors. After a period of time, the significant size variation in fry recurs, and the risk remains.
[0003] Meanwhile, with the improvement of living standards, people's demand for ornamental fish is increasing, and the ornamental fish industry is developing rapidly. The value of ornamental fish is extremely related to their appearance. A koi carp of excellent quality can often fetch thousands, tens of thousands, or even hundreds of thousands of yuan, while a poorly shaped one may only be worth a few yuan. Therefore, for the ornamental fish industry, the selection of fry is particularly important. During the breeding process, the fry's body shape, color, and patterns must be assessed and selected. This work is crucial but can only be carried out during specific breeding periods, subject to time constraints. It also depends on the experience and judgment of technicians. Limited by the technicians' eyesight and workload, the intensity of selection is often unsatisfactory, negatively impacting the improvement of the ornamental fish's breed quality and overall quality.
[0004] Fish generally exhibit strong sex differences during growth. For example, female tongue sole can grow to over 3 kg, while males stop growing at a maximum of 0.4 kg. In most fish, such as turbot, goldfish, and koi, females grow significantly faster and reach a larger final size than males. However, in yellow catfish and tilapia, males grow significantly faster and reach a larger final size than females. Therefore, in order to improve economic efficiency, fish production often focuses on solving the problem of all-feminization or all-maleization of fish. Sex selection not only improves economic efficiency in production but also plays an auxiliary role in fish germplasm selection. However, it is difficult to distinguish between males and females in the juvenile stage. Molecular marker technology is often used, which requires collecting organ tissues from the fish, causing damage to the fish and making it difficult to guarantee selection efficiency.
[0005] Machine vision is widely used in aquaculture. Common and open-source feature detection algorithms include SSD and YOLO. While YOLO boasts extremely fast detection speeds, there are currently no examples of its application to fish fry feature detection. It is primarily used for pathological monitoring, assessing feeding intensity, and identifying abnormal fish behavior. However, identifying fish fry features and sizes is difficult due to their fragility, the refraction of light above the water surface, and other factors. Even when identified, the small size of the fry leads to poor feature extraction, resulting in unsatisfactory accuracy. Furthermore, common machine vision programs require significant storage space, making them difficult to deploy on microcontrollers. They are typically deployed on PCs and mobile devices, requiring internet access via a mobile phone or PC for operation, hindering on-demand use and causing inconvenience. Summary of the Invention
[0006] To address the aforementioned problems, the present invention aims to provide an intelligent fish fry size, color, and sex screening system based on morphological measurement feature recognition, for multi-condition fish fry identification and sorting, thereby improving the accuracy of fish fry identification and screening efficiency.
[0007] To achieve the above technical objectives and address the shortcomings of the aforementioned technologies, this application provides an intelligent fish fry specification, color, and sex screening system based on morphometric feature recognition. The system includes a fish fry batching module, a diversion and transmission module for processing the fish fry fed through the batching module, and a fish fry feature specification discrimination module located above the diversion and transmission module. The fish fry feature specification discrimination module is a specialized improvement of the general feature recognition models YOLO and OpenCV, specifically designed for feature extraction from extremely small fish fry images. This results in a more accurate recognition model, which then provides the diversion criteria based on the fish fry images.
[0008] In one embodiment, the fish fry sequencing module includes a fish-pouring box, a deceleration slide, and a dense multi-pipe fitting for transferring fish fry from the fish-pouring box to the deceleration slide; several sets of deceleration plates are fixedly installed on the deceleration slide, and the several sets of deceleration plates are arranged in a staggered interval; the dense multi-pipe fitting is composed of multiple pipes arranged densely, wherein one end of the pipe is arranged in the fish-pouring box, and the other end extends outward into the deceleration slide.
[0009] Furthermore, the number of deceleration slides can vary from one to more depending on the efficiency of the fish fry batching; the dense multi-tube fittings can be configured with different inner diameters to match different fish fry sizes as needed.
[0010] Furthermore, the diversion conveying module includes at least three diversion slides installed at the outlet of the deceleration slide, a conveyor belt and a partition installed on the corresponding diversion slide, and two sets of baffles installed in a V-shape on the partition facing the corresponding conveyor belt; the at least three sets of diversion slides are arranged laterally and the diversion slides are inclined downwards; the partitions are vertically fixed on the sliding surface of the corresponding diversion slides, and the partitions are located on the opposite side of the conveyor belt facing away from the deceleration slide; the conveyor belt is made of rubber, and a matching cavity is opened through the diversion slide for the corresponding conveyor belt to pass through.
[0011] Furthermore, the number of the diversion slides and conveyor belts can vary from one to more depending on the diversion efficiency requirements.
[0012] Furthermore, the partition divides the corresponding diversion slide into qualified channels and unqualified channels, and the two sets of baffles are used to control the opening and closing of the qualified channels and unqualified channels respectively; the diversion slide is equipped with a rotating structure for driving the baffles, and the baffles perform unidirectional opening and closing movements under the action of the rotating structure.
[0013] In one embodiment, the fish fry characteristic specification discrimination module includes a housing mounted on the side of the diversion and conveying module via a hinge, a high-definition camera and a lighting lamp embedded in the housing facing the diversion slide, an image processing component installed inside the housing, and an X-ray imaging component; the X-ray imaging component includes an X-ray transmitter placed below the diversion and conveying module and an X-ray receiver embedded in the housing facing the diversion and conveying module.
[0014] Furthermore, the fish fry discrimination module also includes a fish feature training module, an image information processing module, a fish feature and size recognition and comparison module, a baffle control module, a fish fry counting module, and a human-computer interaction module installed inside the outer shell.
[0015] Furthermore, the improved feature recognition model is based on the YOLO algorithm, incorporating an adaptive image enhancement algorithm. The C3 module integrates a CA attention mechanism and replaces the original feature extraction network with a ResNet feature extraction network, while also incorporating maximum suppression. The specification recognition and comparison module uses Python, integrates the adaptive image enhancement MSRCR algorithm, and employs a pre-set calibration mark method. By recognizing the calibration marks, it achieves the conversion between actual specifications and pixels.
[0016] In one embodiment, the specific discrimination process for comparing fish characteristics with size identification is as follows:
[0017] S1 acquires color image data of fish fry;
[0018] S2 uses an image enhancement algorithm to remove the refraction interference of light in shallow water before proceeding to the next step. In this embodiment, the MSRCR algorithm is used to enhance the image and obtain clearer color fish fry feature information.
[0019] The MSRCR image enhancement algorithm is added to the image preprocessing stage of the target detection process as a means of enhancing the input image to the YOLO network, in order to eliminate the image impact caused by water surface reflection after fish fry enter the water. The formula is as follows:
[0020] S11 Color Reflectance: R MSRCR (x,y)=C(x,y)·R MSR (x,y), where: R MSRCR denoted as Retinex reflectance after multi-scale processing, and C(x,y) as the color restoration factor.
[0021] S12 Color Restoration Factor: Where I(x,y) represents the image of a certain channel. A mapping function for a color space.
[0022] S13 Logarithmic Transformation and Linear Stretching, along with Pixel Value Correction: The original image undergoes a logarithmic transformation to compress its dynamic range. The processed image is then linearly stretched to map it to the desired output range. Finally, it is transformed from the logarithmic domain to the real domain, and the image is corrected by changing the gain and offset.
[0023] The C3_CA module is added to the C3 module of the YOLOv5s Backbone structure to achieve better extraction of multi-level and multi-scale features from images, thereby improving the average accuracy of the feature training model. The implementation of the C3_CA module is as follows: The input feature map is processed by the C3 module to obtain an intermediate feature map. The CA attention mechanism is applied to the intermediate feature map to obtain a weighted feature map. The weighted feature map is used as the output of the C3_CA module for subsequent network layer processing. The formula is as follows:
[0024] S21 Global Average Pooling: Where x c (i,j) represents the pixel value at position (i,j) in the c-th channel, and H and W represent the height and width of the feature map, respectively.
[0025] S22 splicing feature map: f = [y1, y2, ..., y C ], where C represents the number of channels.
[0026] S23 Convolution operation: g = σ(Conv(f)), where Conv represents the convolution operation and σ represents the activation function.
[0027] S24 weighted operation: in This represents the element-wise multiplication operation, where x represents the original feature map and g represents the attention weight.
[0028] The ResNet feature extraction network replaces the CSP feature extraction network in YOLOv5s by introducing residual blocks, which directly add the input feature map to the output feature map. The formula is as follows:
[0029] S31 Core Formula
[0030] Residual learning: H(x) = F(x) + x, where H(x) is the expected output, F(x) is the residual part, and x is the input.
[0031] S32 Residual Block: F(x) is typically obtained through a series of convolutional layers, batch normalization layers, and activation function layers. Specifically, suppose there is a residual block containing two convolutional layers (conv1 and conv2): F(x) = conv2(BN2(ReLU(conv1(BN1(x))))).
[0032] S33 Jump Connection: H(x) = F(x) + W_s(x), assuming the dimensions of the input x and the output F(x) are inconsistent, a dimension transformation of x is needed to match the dimension of F(x). The dimension transformation function is W_s(x), and the final output is H(x).
[0033] Maximum Suppression (NMS) is a method used in detection to suppress overlapping bounding boxes, retaining only the bounding box with the highest confidence score. When multiple overlapping bounding boxes exist, the bounding box with the highest confidence score is retained, while other bounding boxes with lower confidence scores are suppressed, resulting in more accurate object detection results. Specifically, NMS sorts the bounding boxes according to their confidence scores and then iterates through these bounding boxes sequentially. If the overlap between the current bounding box and the retained bounding boxes (usually measured by the Intersection over Union (IOU)) exceeds a certain preset threshold (e.g., 0.5), the current bounding box is suppressed and not retained as part of the final detection result. The formula is implemented as follows:
[0034]
[0035] The intersection area (inter_area) is the area of the overlapping portion of the two bounding boxes, where area1 and area2 are the areas of the two bounding boxes, respectively.
[0036] Specification Determination: The length and width model from the OpenCV library is introduced and improved. Specifically, by calibrating the length and width of the marker, the length of other objects in the image is estimated using the calibrated object, and a scaling method is employed. The specific formula is:
[0037]
[0038] The real-world size is W real Width and H real Height. In the image, the size of this rectangle is W. img Pixel width and H img Pixel height. After traversing the outline of the fish fry, the real-world size represented by each pixel in the image is calculated, and the specifications of the fish fry are output. Because the camera is vertically placed in this invention, the scaling factor is ignored.
[0039] S3 determines whether the body color of the fish fry meets the requirements based on the body color characteristics, and performs convolution calculations based on the feature image recognition system improved by the C3_CA attention mechanism and the ResNet feature extraction network to determine whether the body color characteristics meet the screening requirements.
[0040] If yes, execute S4; otherwise, execute S9.
[0041] S4 determines whether the fish fry meet the desired fish species based on the overall characteristics of the fish fry, and performs convolution calculations based on the feature image recognition system improved by the C3_CA attention mechanism and the ResNet feature extraction network to determine whether the body color features meet the screening requirements.
[0042] If yes, execute S5; otherwise, execute S9.
[0043] S5 acquires X-ray images of the gonads of fish fry, and the feature image recognition system determines whether the sex of the fish fry matches the expected sex based on the gonadal features.
[0044] If yes, execute S6; otherwise, execute S9.
[0045] S6 performs grayscale processing on the image and traverses the edges to obtain morphological data, and then executes operation S7;
[0046] S7 extracts morphological data and uses the fish body length and weight prediction model to calculate whether the weight is within the preset fry specifications based on the body length.
[0047] If yes, execute S8; otherwise, execute S9.
[0048] S8 opens the qualified channel, and the qualified fish fry count increases by 1;
[0049] S9 opens the non-compliant channel, and the count of non-compliant fish fry increases by 1.
[0050] Furthermore, the method for obtaining morphological data through processing is specifically implemented as follows:
[0051] S31 uses an image enhancement adaptive algorithm to preprocess the image, and then extracts the feature points of the fish fry color image after obtaining a clear image.
[0052] S32 performs grayscale and binarization processing on the fish fry image;
[0053] S33 extracts the outline of the grayscale image of the fish fry by traversing all points;
[0054] S34 was used to extract fish fry characteristics and obtain morphometric data.
[0055] The present invention also provides a method for screening fish fry performed by the above system, comprising the following steps:
[0056] S1 provides a fish feature dataset and a database of body length and weight relationship coefficients, and provides the aforementioned screening system;
[0057] The S2 screening system sorts the batches of fish fry that are poured in.
[0058] The S3 screening system captures and extracts image information of fish fry;
[0059] The improved S4 fish feature image recognition algorithm analyzes fish fry image information and extracts morphological, color, and sex features of the fish fry.
[0060] S5 performs convolution calculations and outputs confidence scores using a fish fry feature recognition algorithm. Based on whether the confidence score is higher than the confidence threshold, it determines whether to open a qualified or unqualified channel and counts the fish fry.
[0061] In one embodiment, the method for analyzing fish fry image information and extracting morphological, color, and sex characteristics of the fish fry is specifically operated as follows:
[0062] The S41 image information processing module analyzes the captured image information to obtain fish fry color feature data;
[0063] Fish fry images captured using S42 grayscale processing;
[0064] S43 performs edge extraction on grayscale fish fry images;
[0065] S44 calculates the morphometric data of the fish fry image information after edge extraction, and obtains the morphometric feature data of the fish fry size.
[0066] The image information extracted by S45 X-ray imaging or CT imaging is enhanced by a pre-image adaptive enhancement algorithm, and then the information on the development of the gonads inside the fish fry is extracted by an improved image feature recognition algorithm to obtain the sex characteristic data of the fish fry.
[0067] The present invention discloses the following technical effects:
[0068] This invention relates to a fish fry screening system that employs a multi-faceted screening approach based on fry size, body color, and sex. Utilizing an improved fish feature and size recognition model incorporating morphological, color, and sex characteristics of different fish species, combined with machine vision recognition and intelligent computational screening, it overcomes three key challenges in fish fry selection: size, color, and sex. This effectively addresses issues such as cannibalism between larger and smaller fish, selection of ornamental fish, and sex selection during the fry stage. The system focuses on improving the speed and accuracy of screening small fry by specifically modifying commonly used image recognition models. Improvements are made to the attention mechanism, feature extraction network, and maximum suppression. An adaptive image enhancement algorithm (MSRCR) is nested in the outer layer to reduce the risk of misjudgment and improve feature recognition accuracy. Actual testing shows that the recognition speed for 100 fry is approximately 50ms, significantly slower than manual judgment. Furthermore, the trained model is only a few tens of MB in size, making it easy to deploy on terminals with limited storage space. It is easy to operate and highly portable. This system fills a domestic gap, significantly saves labor, accelerates the artificial breeding process, and improves production efficiency. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 The diagram shows a structural schematic of an intelligent fish fry size, color, and sex screening system based on morphological measurement feature recognition provided by the present invention.
[0071] Figure 2 As shown Figure 1 Exploded view of the fish fry sequencing module.
[0072] Figure 3 As shown Figure 1 A schematic diagram of the structure of the split-transmission module.
[0073] Figure 4 As shown Figure 1 Exploded view of the fish fry characteristic specification discrimination module.
[0074] Figure 5 The image shown is a grayscale processing diagram of the screening system in this invention.
[0075] Figure 6 The image shown is an edge detection diagram of the screening system in this invention.
[0076] Figure 7The image shown is a diagram of morphological data extraction from the screening system in this invention.
[0077] Figure 8 The diagram shown is a flowchart of the operation of the fish fry characteristic specification discrimination module in this invention.
[0078] Figure 9 The diagram shown is a flowchart of the improved fish fry treatment process in this invention (abcd represents the treatment order).
[0079] Figure 10 The image shown is the final result achieved through our improved image recognition accuracy.
[0080] Figure 11 The image shows the final implementation of the C3_CA attention mechanism and the ResNet feature extraction network in the code.
[0081] Figure 12 The figure shows the fish length predicted by the discrimination module.
[0082] Figure 13 The image shown is the C3_CA attention mechanism added to the fish fry image feature recognition module.
[0083] Figure 14 The improved feature recognition model structure (data inflow is enhanced by MSRCR) and improvements have been made to the backbone and head;
[0084] Figure 15 , Figure 16 The image shows a comparison of the confidence levels of the final recognition results before and after the improvement, as well as a comparison of the predicted bounding boxes.
[0085] Figure 17 The image shows the machine screening process;
[0086] Figure 18 The diagram shows the process of establishing a feature recognition model.
[0087] Among them, 1. Fish inlet box; 2. Deceleration slide; 3. Dense multi-pipe fittings; 4. Diversion slide; 5. Conveyor belt; 6. Partition; 7. Baffle; 8. Outer shell; 9. X-ray receiver; 10. X-ray transmitter. Detailed Implementation
[0088] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0089] Example 1: Please refer to Figure 1-4 This embodiment provides an intelligent fish fry specification, color, and sex screening system based on morphological measurement feature recognition. It includes a fish fry batching module, a diversion and conveying module for processing the fish fry sent in by the fish fry batching module, and a fish fry feature specification discrimination module located above the diversion and conveying module.
[0090] The fish fry batching module includes a fish-pouring box 1, a deceleration slide 2, and a dense multi-tube fitting 3 for transferring fish fry from the fish-pouring box 1 to the deceleration slide 2. Several sets of deceleration plates are fixedly installed on the deceleration slide 2, and these sets of deceleration plates are arranged in a staggered pattern. It should be noted that in this embodiment, the deceleration plates should be slightly inclined towards the bottom of the deceleration slide 2 to ensure that the fish fry can pass through without causing blockage.
[0091] The dense multi-pipe fitting 3 consists of multiple pipes arranged in a dense pattern. One end of each pipe is placed inside the fish-pouring box 1, and the other end extends outward into the deceleration slide 2. It should be noted that the inner diameter of the pipes and the specifications of the fish-pouring box 1 in this embodiment can be changed as needed to accommodate fish fry of different sizes.
[0092] The fish fry sequencing module of this embodiment is used as follows: the fish fry are poured into the fish pouring box 1 and sent into the deceleration slide 2 through the dense multi-tube fitting 3. During the aforementioned process, the fish fry are initially sorted when passing through the dense multi-tube fitting 3. The deceleration baffle reduces the sliding speed of the fish fry and also plays a role in sorting the fish fry again as they slide down the deceleration slide 2.
[0093] The diversion and conveying module includes three sets of diversion slides 4 installed at the outlet of the deceleration slide 2, conveyor belts 5 and partitions 6 installed on the corresponding diversion slides 2, and two sets of baffles 7 installed in a V-shape on the partitions 6 facing the corresponding conveyor belts 5. Based on the diversion and conveying module, the fish fry fed in by the fish fry sequencing module are diverted. This embodiment uses three sets of diversion slides 4 as an example for illustration. In other embodiments, the number of diversion slides 4 can be adaptively increased according to the actual number of fish fry and the diversion scale to improve the efficiency of fish fry diversion and processing.
[0094] The three sets of diversion slides 4 are arranged horizontally and inclined downwards. The partition 6 is vertically fixed to the sliding surface of the corresponding diversion slide 4, and the partition 6 is located on the opposite side of the conveyor belt 5 facing away from the deceleration slide 2. It should be noted that the inclination of the side of the diversion slide 4 where the partition 6 is located is greater than that of the side where the conveyor belt 5 is located, so that the fish fry can slide down with the help of gravity.
[0095] The conveyor belt 5 is made of rubber, and the diversion slide 4 has a through-hole for the corresponding conveyor belt 5 to pass through. In this embodiment, in order to provide the driving force for the operation of the conveyor belt 5 to realize its function of directional transmission of fish fry, a rotary motor and two sets of conveyor rollers are installed in the matching cavity of the diversion slide 4. One set of conveyor rollers is rotatably set on the diversion slide 4, and the remaining set of conveyor rollers is fixedly connected to the output end of the rotary motor. The conveyor belt 5 is laid between the two sets of conveyor rollers. When the rotary motor is energized and drives the conveyor rollers to rotate, the conveyor belt 5 is pulled to realize the directional transmission of the fish fry on it. The aforementioned conveying structure is a mature existing technology and will not be described in detail here.
[0096] The partition 6 divides the corresponding diversion slide 2 into qualified and unqualified channels, and two sets of baffles 7 are used to control the opening and closing of the qualified and unqualified channels, respectively. The diversion slide 4 is equipped with a rotating structure for driving the baffles 7, and the baffles 7 perform unidirectional opening and closing motions under the action of the rotating structure. In this embodiment, the rotating structure is illustrated using a motor and a rotating shaft as an example. The side of the baffle 7 closest to the wall of the diversion slide 4 is fixed to the rotating shaft. The motor drives the rotating shaft to rotate, thereby adjusting the angle of the baffle 7 and achieving the effect of opening and closing the baffle 7.
[0097] In this embodiment, the area containing the partition 6 in the diversion chute 4 is divided into two, forming two screening channels: a qualified channel and an unqualified channel, used for the directional passage of qualified and unqualified fish fry, respectively. The software system is used to screen the fish fry. When a fry is deemed qualified, the baffle 7 controlling the opening and closing of the qualified channel opens, allowing the qualified fish fry to be screened out. When a fry is deemed unqualified, the baffle 7 controlling the unqualified channel opens, and the unqualified fish fry are discarded.
[0098] The fish fry feature specification discrimination module in this embodiment obtains fish fry feature information (fish fry body color, fish fry species, fish fry sex) and morphological measurement information such as fish fry body shape and fish fry weight based on color or black and white images of fish fry to provide a basis for sorting. The fish fry feature specification discrimination module includes a shell 8 mounted on the side of the sorting and conveying module via a hinge, a high-definition camera and lighting embedded in the shell 8 facing the sorting slide 4, an image processing component and an X-ray imaging component installed inside the shell 8, and the fish fry feature specification discrimination module itself (improved fish feature image recognition and training model, improved fish body length and weight prediction model), a baffle control module, a fish fry counting module, and a human-computer interaction module installed inside the shell 8.
[0099] In this embodiment, during the screening process, the fish fry characteristic specification discrimination module and the diversion and conveying module form a relatively dark environment. A high-definition camera, in conjunction with a lighting fixture, captures clear images of the fish fry. The high-definition camera and lighting fixture should be embedded in the lower surface of the housing 8 and arranged perpendicularly to the conveyor belt 5 to ensure clear and accurate image information.
[0100] To meet the requirements of waterproofing, rust prevention, and impact resistance, the outer shell 8 of this embodiment is made of stainless steel. Furthermore, to reduce X-ray radiation, the outer shell 8 is covered with a rubber lead baffle. A touchscreen display is embedded in the outer shell 8, fixed to its upper surface. The display should have touch interaction functionality to facilitate user interaction with the fish fry sorting equipment. The image processing component, consisting of a memory and a processor, processes the fish fry image information. Additionally, to meet the heat dissipation requirements of the image processing component during operation, a cooling fan is installed inside the outer shell 8 of this embodiment.
[0101] The X-ray imaging assembly includes an X-ray transmitter 10 placed below the shunt transmission module and an X-ray receiver 9 embedded in the housing 8 facing the shunt transmission module. The X-ray transmitter 10 and the X-ray receiver 9 correspond to each other. It should be noted that in this embodiment, the positive electrode material of the X-ray transmitter's emitting end is made of tungsten steel to meet the high temperature resistance requirements, and a vacuum condition should be formed inside the positive and negative electrode glass plates and glass tubes of the X-ray transmitter's emitting end after assembly.
[0102] In this embodiment, a screening device is constructed by combining a fry sequencing module, a diversion and conveying module, and a fry characteristic specification discrimination module, providing a screening space for fry. To overcome the difficulty of the tedious manual selection of fry, this embodiment designs a fry screening device that is easy to use, saves time and labor, has high accuracy, is easy for fish farms to handle in fry separation operations, and is less likely to damage individual fry. It can also prevent larger fry from cannibalizing smaller fry. Furthermore, the device in this embodiment can be operated by a single person, making it easy to promote and use.
[0103] In this embodiment, the fish fry feature specification discrimination module combines adaptive enhancement algorithm, improved CA attention mechanism, RESNET feature extraction network and maximum suppression, etc., to obtain a recognition system with stronger feature extraction ability and higher accuracy. Then, the improved image recognition system is pre-trained according to specific species, specifications, color, gonad features, etc. to obtain a recognition model with higher recognition accuracy and stronger feature extraction ability.
[0104] Please see Figure 8-11 The method for obtaining features through processing, and the improved accuracy of the judgment, are described in detail below:
[0105] S1 acquires color image data of fish fry;
[0106] S2 adaptive image enhancement MSRCR algorithm preprocesses fish fry images;
[0107] S3 uses the improved fish fry feature recognition model to judge whether the feature values of the fish fry color image meet the requirements;
[0108] If yes, execute S4; otherwise, execute S9.
[0109] The image information processing module uses Python to perform grayscale processing on the images, and performs edge detection on the collected fish fry images by traversing edges or using differential operators to obtain the edge images of the identified fish fry. Then, it performs morphometric and other recognition processing operations to obtain morphometric data.
[0110] The fish feature and size identification and comparison module identifies the comprehensive feature values of the selected fish fry image information through the fish fry feature recognition model output by the improved feature extraction module and the attention mechanism image training model, thereby identifying and outputting the fish fry species, size, color and sex recognition results, and outputting the confidence value.
[0111] The human-computer interaction module consists of a microcontroller and a color touch screen connected via the FSMC interface. The system status is displayed and the fish fry screening parameters are adjusted based on the human-computer interaction module. During system operation, the screening results are displayed on the color touch screen in real time, which makes it easy to observe the fish fry screening effect and adjust the screening parameters in a timely manner.
[0112] Please see Figure 5-7 and Figure 12 The method for obtaining morphological data through processing is as follows:
[0113] S31 extracts feature points from the color image of fish fry;
[0114] S32 performs grayscale processing on the fish fry image;
[0115] S33 extracts the outline of the grayscale image of fish fry;
[0116] S34 was used to extract fish fry characteristics and obtain morphometric data;
[0117] S31 to S34 are all processed using the Python language.
[0118] S4 determines whether it is the desired fish species based on the morphological data;
[0119] If yes, execute S5; otherwise, execute S9.
[0120] S5 acquires X-ray images of the gonads of fish fry to determine whether the sex of the fish fry meets expectations;
[0121] If yes, execute S6; otherwise, execute S9.
[0122] S6 extracts body length and body height from morphological data to determine whether the fish fry's body shape meets the specifications;
[0123] If yes, execute S7; otherwise, execute S9.
[0124] S7 calculates the weight of the fish fry and determines whether it is within the deviation range;
[0125] If yes, execute S8; otherwise, execute S9.
[0126] S8 opens the qualified channel, and the qualified fish fry count increases by 1;
[0127] S9 opens the non-compliant channel, and the count of non-compliant fish fry increases by 1.
[0128] The baffle control module receives the recognition results from the fish feature and size identification comparison module and triggers a signal. By controlling the changes in the logic input, it achieves changes in the level. The hardware, in conjunction with a specific power supply module, realizes the opening / closing of the baffle 7, thereby determining the opening and closing of the qualified and unqualified channels.
[0129] In summary, the fish fry screening system of this embodiment is designed with a multi-dimensional screening system based on fry size, body color, and sex. It utilizes a fry feature recognition model that incorporates morphological, color, and sex characteristics of different fish species. The built-in fry feature recognition model, improved for small fry, significantly enhances the accuracy of fry identification. Combined with machine vision recognition and intelligent computational screening, it overcomes the three key challenges of size screening, color screening, and sex screening in fish breeding. It effectively solves problems such as cannibalism between larger and smaller fish, selection of ornamental fish, and sex selection at the fry stage, filling a domestic gap, greatly saving labor, accelerating the artificial breeding process, and improving production efficiency. It should be noted that the size screening, color screening, and sex screening functions in this embodiment can exist individually or in combination, all of which should fall within the scope of protection of this patent.
[0130] Example 2: This example illustrates a fry selection method by selecting goldfish with reddish body colors from different colored fry, discarding those with single-tailed tails, retaining those with normal tails, and selecting larger fry. This method employs an intelligent fry size, color, and sex selection system based on morphometric feature recognition, as described in Example 1. The above fry selection method includes the following steps:
[0131] S1. Provide the fish feature dataset to the training module;
[0132] The image recognition system improves upon CA attention mechanism, RESNET feature extraction network, and maximum suppression to obtain a recognition system with stronger feature extraction capabilities and higher accuracy. The improved image recognition system is then pre-trained to recognize fish fry sample images according to specific species, specifications, colors, gonadal characteristics, etc. The fish feature and specification recognition system is stored in the form of an image recognition model and deployed on the device.
[0133] S2. Organize the batches of fish fry that have been poured in;
[0134] Select the appropriate size of the dense multi-tube fitting 3, pour a batch of fish fry into the fish pouring box 1, and after passing through the dense multi-tube fitting 3 and the deceleration slide 2, the fish fry are combed and diverted and enter the fish fry identification stage.
[0135] S3. Capture and extract fish fry image information, and preprocess the fish fry images using an image adaptive enhancement algorithm to remove interference factors such as reflection and noise as much as possible:
[0136] Once the fry enter the fry identification stage, their appearance image information is captured by a high-definition camera with the help of a light. The gonad image information of the fry is captured by an imaging structure consisting of an X-ray receiver 9 and an X-ray transmitter 10. The captured information is preprocessed by an image adaptive enhancement algorithm to obtain clearer fry image information.
[0137] S4. Analyze the fish fry image information and extract the color, sex, and overall feature information of the fish fry;
[0138] The method for analyzing fish fry image information and extracting morphological and color feature information of the fish fry is as follows:
[0139] S41. The image information processing module analyzes the captured image information by the improved image recognition model and processes it through the image adaptive enhancement algorithm. Then, YOLOv5s with improved CA attention and ResNet feature extraction network obtains the feature data required by the fish fry, such as color and tail shape.
[0140] The system selects features to be detected in a specified area of the image. If the confidence level is lower than the preset threshold, the system determines that the feature is unqualified.
[0141] S42. Use Python to perform grayscale processing on the captured fish fry images;
[0142] When processing the captured fish fry images in grayscale, spatial domain filtering or frequency domain filtering is used to filter the color RGB images to remove image noise. It should be noted that since Gaussian noise and salt-and-pepper noise are the main types of noise in production, this embodiment uses a median filtering algorithm with a filtering window of 3*3 to filter the color images of fish fry.
[0143] S43. After image filtering, the gradient operator is used to extract edges from the grayscale fish fry image.
[0144] The gradient operators include the first-order edge detection operators Sobel, Robert, the second-order edge detection operators Laplacian, and Canny.
[0145] S44. Using Python, an edge-traversing algorithm is used to calculate and extract morphometric data of the fish fry image information after edge extraction in S43. Morphometric feature data of the fish fry size are obtained, and based on multiple recognition results, the comprehensive recognition result of the fish fry entering the diversion and transmission module is determined. This result is compared with pre-stored data in the fish feature database to determine the species, morphological characteristics, and sex of the fish fry, and the weight coefficient is calculated according to a preset formula (the weight coefficient calculation formula is as follows:).
[0146] Where W is the weight of the fry, R is the coefficient, and L is the total length of the fry, the converted weight of the tested fry is obtained.
[0147] S5. Compare with the preset reliability threshold to determine whether to open qualified or unqualified channels and count fish fry, etc.
[0148] After color comparison and morphological recognition, and confidence level output, qualified fish fry are judged as qualified by the system if the confidence level is higher than the preset threshold. After the system judges them as qualified, it sends a signal to open the baffle 7 that controls the opening and closing of the qualified channel, and the fish fry are selected.
[0149] Blue goldfish only meet the morphometric data comparison but do not reach the color confidence threshold. After the system determines that they are unqualified, it sends a signal to open the baffle 7 that controls the opening and closing of the unqualified channel, and the fry are screened out. Red single-tailed goldfish only meet the color confidence result but the tail shape does not reach the confidence threshold. After the system determines that they are unqualified, it sends a signal to open the baffle 7 that controls the opening and closing of the unqualified channel, and the fry are screened out. Smaller goldfish fry do not meet the preset deviation value in weight calculation. After the system determines that they are unqualified, it sends a signal to open the baffle 7 that controls the opening and closing of the unqualified channel, and the fry are screened out.
[0150] When a qualified channel is opened once, a signal is sent to the fish fry counting module, incrementing the qualified fish fry count by 1; when an unqualified channel is opened once, the unqualified fish fry count is incremented by 1.
[0151] Example 3: This example compares the commonly used image recognition algorithm YOLOv5S with our improved algorithms GD-YOLOv5S (which integrates the image adaptive enhancement MSRCR algorithm and CA attention mechanism, and replaces the ResNet feature extraction network), YOLOv5s-CA (only the CA attention mechanism is added), YOLOv5s-resnet101 (only the ResNet101 feature extraction network is replaced), and YOLOv5s-resnet50 (only the ResNet50 feature extraction network is replaced). The comparison is based on mAP50:95, loss value, and final discrimination accuracy. When testing the trained GD-YOLOv5s model, we selected a series of image files not seen during model training as the test set to objectively evaluate the differences between the two improved algorithms.
[0152]
[0153] mAP50:95 (mean accuracy, within the 50% to 95% IoU threshold range): AP is a key metric for measuring the average detection performance of a model across different IoU thresholds. In evaluation, the area under the Precision-Recall curve is typically calculated over multiple IoU thresholds (from 0.5 to 0.95, with a step size of 0.05), and the average of these areas is taken as the AP value. AP50:95 specifically refers to the average accuracy calculated across the entire range of IoU thresholds from 50% to 95%. A higher AP value indicates more stable and superior detection performance across different IoU thresholds.
[0154]
[0155] Table 1 Ablation Experiment Results
[0156] After the same 800 epochs of training, the original YOLOv5s had an mAP50:95 value of 0.592, while the improved feature recognition model had a value of 0.536, which is a 10.4% improvement in mAP50:95 compared to the original YOLOv5s model.
[0157] After the same 800 epochs of training, the GD-YOLOv5s model achieved a total loss of 0.104326, compared to 0.105525 for the original YOLOv5s model. This reduction indicates that GD-YOLOv5s better fitted the data during training, thus reducing prediction error.
[0158] In the task of identifying and analyzing the caudal fin features of fish fry, the existing GD-YOLOv5s model showed a significant improvement in confidence level compared to the original YOLOv5s. This was particularly evident in the substantial improvement in confidence level for identifying the caudal fin of fish fry. GD-YOLOv5s also achieved an approximately 4% improvement in accuracy for skin color recognition, validating its effectiveness in enhancing target detection accuracy.
[0159] When analyzing the performance of the YOLOv5s model in recognizing fish fry tail fins, we observed that the original model struggled to handle this task. Specifically, the model not only exhibited generally low confidence levels when recognizing tail fin features, but also frequently missed detections, directly impacting the accuracy and reliability of the recognition results. Please refer to the comparison between the before and after improvements. Figure 15 16. The confidence level before the improvement was significantly lower, and there was a phenomenon that a single feature output two different judgment results, while the improved version is more accurate.
[0160] The fish fry screening method of this embodiment can be applied in the form of software, such as by designing it as a stand-alone program and installing it on a computer terminal. In other embodiments, it can also be designed as an embedded program and installed on a computer terminal, which can be a computer or other smart devices.
[0161] In summary, the fish fry screening method of this embodiment combines comprehensive fish feature points to construct a targeted and multifunctional fish fry identification system, which can perform multi-condition fish fry identification and sorting, thereby improving the efficiency of fish fry identification and screening.
[0162] The naming of each component is based on its function as described in the specification, and is not limited to the specific terms used in this invention. Those skilled in the art may also choose other terms to describe the names of the components of this invention.
[0163] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0164] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0165] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. An intelligent fish fry size, color, and sex selection system based on morphological quantitative feature recognition, characterized in that, It includes a fry sequencing module, a diversion and conveying module for processing the fry fed in by the fry sequencing module, and a fry feature and specification discrimination module located above the diversion and conveying module. The fish fry characteristic specification discrimination module includes the following steps: Feature discrimination: Take images of fish fry with different features, label the features, construct an initial dataset, and expand the dataset by rotation and translation. Then, obtain the final dataset by dividing the dataset into a test set and a training set. The YOLOV5s model was introduced and improved. Based on the improved YOLOV5s model, the final GD-YOLOV5s model was obtained by training on fish fry features. The model obtains fish fry feature information from fish fry images to provide a basis for flow separation. The GD-YOLOV5s model is obtained by combining the MSRCR image enhancement algorithm with the YOLO algorithm on the basis of the YOLOV5s image recognition algorithm to preprocess the acquired images to remove the interference of shallow water light refraction. The CA attention mechanism is incorporated into the C3 module, and the original feature extraction network is replaced by the ResNet feature extraction network and then maximum suppression is incorporated. The fish fry characteristic specification discrimination module is also used to obtain a unique and highly confident discrimination result based on the GD-YOLOV5S model and send a signal to the baffle control module. The fish fry feature specification discrimination module is also used to extract the contour of the fish fry image by calling functions in OpenCV, to obtain the minimum bounding rectangle of the fish fry contour by calling functions in OpenCV, and to approximate the width of the minimum bounding rectangle as the width of the contour. Then, a weight prediction model is established based on three parameters: the length of the fish fry skeleton line, the body length, and the reference object. When generating the weight, the weight of the fish fry is estimated based on the body length-weight coefficient. The baffle control module receives the discrimination result of the fish fry characteristic specification discrimination module and receives the signal. By controlling the change of the logic input, it realizes the change of level. In conjunction with the power supply module, it realizes the opening / closing of the baffle (7), thereby determining the opening and closing of the qualified channel and the unqualified channel. The human-computer interaction module consists of a microcontroller and a touch screen connected via an interface. The system status is displayed and fish fry screening parameters are adjusted based on the human-computer interaction module.
2. The intelligent fish fry size, color, and sex selection system based on morphological measurement feature recognition according to claim 1, characterized in that, The fish fry sequencing module includes a fish pouring box (1), a deceleration slide (2), and a dense multi-tube fitting (3) for transferring fish fry from the fish pouring box (1) to the deceleration slide (2); Several sets of speed reduction plates are fixedly installed on the deceleration slide (2), and the several sets of speed reduction plates are arranged in a stepped interval. The dense multi-pipe fitting (3) is composed of multiple pipes arranged in a dense manner, wherein one end of the pipe is arranged inside the fish-pouring box (1), and the other end extends outward into the deceleration slide (2); The number of the deceleration slides (2) is one or more; the dense multi-pipe fittings (3) are configured with different inner diameters.
3. The intelligent fish fry size, color, and sex selection system based on morphological measurement feature recognition according to claim 1, characterized in that, The diversion conveyor module includes a diversion slide (4) installed at the outlet of the deceleration slide (2), a conveyor belt (5) and a partition (6) installed on the corresponding diversion slide (2), and two sets of baffles (7) installed in a V-shape on the partition (6) facing the corresponding conveyor belt (5); The diversion slides (4) are arranged horizontally and are inclined downwards; the partition (6) is fixed vertically on the sliding surface of the corresponding diversion slide (4) and the partition (6) is located on the opposite side of the conveyor belt (5) away from the deceleration slide (2). The conveyor belt (5) is made of rubber or metal, and the diversion slide (4) has a connecting cavity for the corresponding conveyor belt (5) to pass through; The number of the diversion slide (4) and the conveyor belt (5) is one or more.
4. The intelligent fish fry size, color, and sex selection system based on morphological measurement feature recognition according to claim 3, characterized in that, The partition (6) divides the corresponding diversion slide (2) into qualified channels and unqualified channels, and the two sets of baffles (7) are used to control the opening and closing of qualified channels and unqualified channels respectively. The diversion slide (4) is equipped with a rotating structure for driving the baffle (7), and the baffle (7) performs a one-way opening and closing motion under the action of the rotating structure.
5. The intelligent fish fry size, color, and sex selection system based on morphological measurement feature recognition according to claim 1, characterized in that, The fish fry characteristic specification discrimination module includes a shell (8) mounted on the side of the diversion and conveying module via a hinge, a high-definition camera and a lighting lamp embedded in the shell (8) facing the diversion slide (4), an image processing component installed in the shell (8), and an X-ray imaging component; The X-ray imaging assembly includes an X-ray transmitter (10) placed below the shunt structure and an X-ray receiver (9) mounted on the housing (8) facing the shunt structure.
6. The intelligent fish fry size, color, and sex selection system based on morphological measurement feature recognition according to claim 1, characterized in that, The specific discrimination process of the fish fry characteristic specification discrimination module is as follows: S1 acquires color image data of fish fry; S2 is preprocessed using the adaptive image enhancement MSRCR algorithm before proceeding to the next step. S3 selects features or specifications for screening based on needs. If fish fry feature screening is selected, the improved feature image recognition system determines whether the body color meets the preset confidence requirements. If yes, execute S4; otherwise, execute S9. S4 selects features or specifications for filtering based on needs, and uses the improved feature image recognition system to identify whether it is the desired fish species; If yes, execute S5; otherwise, execute S9. S5 acquires X-ray images of the gonads of fish fry and determines whether the sex of the fish fry meets expectations based on the improved feature image recognition system. If yes, execute S6; otherwise, execute S9. S6 performs grayscale and binarization on the color image of fish fry, then performs edge processing, extracts the edges, and traverses every point of each fish fry outline to calculate the outline and perimeter, thus obtaining the morphological data of the fish fry. S7 extracts morphological data and calculates whether the weight meets the requirements based on body length; If yes, then execute S8; No, then execute S9; S8 opens the qualified channel, and the qualified fish fry count increases by 1; S9 opens the non-compliant channel, and the count of non-compliant fish fry increases by 1.
7. The intelligent fish fry size, color, and sex selection system based on morphological measurement feature recognition according to claim 6, characterized in that, The method for obtaining morphological data through processing is as follows: The S31 image adaptive enhancement MSRCR algorithm pre-enhances image information; S32 extracts feature points from color images of fish fry; S33 performs grayscale processing on the fish fry image; S34 extracts the outline of the grayscale image of fish fry; S35 obtains morphometric data by forming a contour through traversing the edges.
8. A method for selecting fish fry using an intelligent fish fry size, color, and sex selection system based on morphological measurement feature recognition as described in claim 1, characterized in that, Includes the following steps: S1 pre-sets a fish body length and weight coefficient database and a divided fish fry feature dataset, and obtains a fish fry feature recognition model through pre-training using an improved recognition system, and provides the screening system as described in claim 1; The S2 screening system sorts the batches of fish fry that are poured in. The batches of unsorted fish fry are poured into the fish pouring box (1) with water. The fish pouring box (1) realizes the process of storing fish fry and, together with the dense multi-pipe accessories (3), sorts the fish fry in batches. Then the fish fry flow into the deceleration slide (2) and, under the action of the deceleration plate, realizes a second batch sorting, ensuring that the fish fry will slowly flow into the conveyor belt (5) of the discrimination module in batches for judgment. The S3 screening system captures and extracts image information of fish fry; S4 analyzes and enhances fish fry image information, extracting color, sex, and morphological quantitative features of the fish fry; S5 compares the data with a preset confidence threshold, determines whether to open a qualified or unqualified channel based on whether the data is higher or lower than the confidence threshold, and counts the fish fry.
9. The fish fry screening method according to claim 8, characterized in that, The specific operations for analyzing and enhancing fish fry image information and extracting color, sex, and morphological measurement features of the fish fry are as follows: The S41 image information processing module analyzes the captured image information to obtain fish fry color feature data; Fish fry images captured using S42 grayscale processing; S43 performs edge extraction on grayscale fish fry images; S44 calculates the morphometric data of the fish fry image information after edge extraction, and obtains the morphometric feature data of the fish fry size. S45 X-ray imaging or CT imaging can be used to extract information on the development of gonads inside the fish fry, and obtain data on the sex characteristics of the fish fry.
Citation Information
Patent Citations
Automatic fry separating device and control method thereof
CN109566512A
Fish disease recognition processing device based on machine vision
CN113598098A
Underwater organism monitoring method and device and storage medium
CN115512215A
Fish detection method based on improved YOLOv5S model
CN115661628A
Divide fish ware
CN208211241U