An image recognition method for the health status of marine cultured fish
By using the YOLOv8-seg model and the pose-sensitive morphology-color joint health index algorithm, the problems of low efficiency and poor accuracy in identifying the health status of marine aquaculture fish have been solved, enabling refined health assessment and automated detection for different fish species.
Patent Information
- Application Number
- CN202610173285.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-26
AI Technical Summary
Traditional methods for identifying the health status of marine aquaculture fish are inefficient, inaccurate, difficult to automate, produce low-quality underwater images that are difficult to segment, and cannot be adapted to different fish species, leading to delayed disease detection and economic losses.
The YOLOv8-seg model is used for instance-level segmentation. Combined with the posture-sensitive morphology-color joint health index extraction algorithm, the health-sensitive feature index is calculated by using the posture deformation penalty factor and global color variance to achieve accurate identification of fish posture and color abnormalities.
It improves the accuracy and integrity of fish body extraction, reduces misjudgment, enhances the ability to identify non-standard postures and color abnormalities, adapts to the health assessment of different fish species, and meets the needs of refined management in multi-fish aquaculture environments.
Smart Images

Figure CN122089676A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition, and more particularly to an image recognition method for the health status of marine aquaculture fish. Background Technology
[0002] Marine aquaculture, as one of the pillar industries of the economy, plays a crucial role in regional economic development and food security. However, the health management of marine aquaculture fish has long relied on manual observation and experience-based judgment, which is not only inefficient and inaccurate but also prone to delayed detection of fish diseases, leading to disease outbreaks and severe economic losses. Traditional methods for identifying the health status of marine aquaculture fish also suffer from problems such as difficulty in automating underwater fish health monitoring, low underwater image quality and segmentation difficulties, poor generalization of health monitoring models, and difficulty in adapting to different fish species. Automated and intelligent health status detection of marine aquaculture fish using modern information technologies such as artificial intelligence, image recognition, and computer vision has become a research hotspot. In particular, the development of image recognition technology has provided a feasible path for non-contact health monitoring of aquaculture fish. An image recognition method for the health status of marine aquaculture fish, with advantages of non-contact, real-time, high efficiency, and quantifiability, is one of the key supporting technologies for realizing intelligent aquaculture. With the continuous advancement of hardware equipment, image processing algorithms, and artificial intelligence models, it will play an increasingly important role in future marine aquaculture, helping the industry develop towards intelligence, greening, and efficiency. Summary of the Invention
[0003] This invention provides an image recognition method for the health status of marine aquaculture fish, which solves the technical problems of morphological indicators failing due to fish body posture distortion, inability to quantify abnormal color features such as red spots and white spots, and the impact of fish species differences on the universality and accuracy of assessment results.
[0004] The present invention provides an image recognition method for the health status of marine aquaculture fish, comprising the following steps: S1. Acquire the original RGB color image containing the fish school; based on the acquired original RGB color image, perform instance-level segmentation to obtain the category label, confidence score, and pixel-level binary mask for each fish instance; based on the confidence score, perform confidence score filtering to obtain fish instances that pass the confidence score filtering; based on the fish instances that pass the confidence score filtering, perform image preprocessing to obtain the normalized color vector and the preprocessed RGB color image; S2. Based on the normalized color vector and the preprocessed RGB color image, a health sensitivity feature index is obtained through a pose-sensitive morphology-color joint health index extraction algorithm; based on the health sensitivity feature index, a judgment result is obtained.
[0005] Preferably, S2 specifically includes: Based on the pixel-level binary mask of the fish instance in the preprocessed RGB color image, the projected area of the fish body is obtained; based on the pixel-level binary mask region, the outer contour of the fish body is extracted to obtain the boundary pixel sequence.
[0006] Preferably, S2 specifically includes: Based on the boundary pixel sequence, the ellipse parameters are obtained; based on the ellipse parameters, the attitude deformation penalty factor is calculated.
[0007] Preferably, S2 specifically includes: Based on the boundary pixel sequence, calculate the total path length of the boundary pixel sequence; based on the total path length of the boundary pixel sequence and the projected area of the fish body, calculate the contour compactness index.
[0008] Preferably, S2 specifically includes: Multiplying the contour compactness index by the posture deformation penalty factor yields the posture-sensitive morphological anomaly degree.
[0009] Preferably, S2 specifically includes: Based on the pixel-level binary mask region and the normalized color vector, the average color vector of all pixels in the fish body is calculated; based on the normalized color vector and the average color vector, the global color variance is calculated.
[0010] Preferably, S2 specifically includes: The pose-sensitive morphological anomaly degree and the global color variance are weighted and summed to obtain the intermediate value of the linear fusion; the intermediate value of the linear fusion is transformed to output the health-sensitive feature index.
[0011] Preferably, S2 specifically includes: Based on the category label of the fish instance, a preset fish-specific threshold is selected and compared with the health sensitivity feature index to determine the health status. When the fish's health sensitivity feature index is greater than or equal to the fish-specific threshold, the health status is abnormal; when the fish's health sensitivity feature index is less than the fish-specific threshold, the health status is normal.
[0012] Preferably, S2 specifically includes: The abnormality rate is calculated based on the number of fish with abnormal health status.
[0013] The beneficial effects of the technical solution of the present invention are: 1. By employing real-time instance segmentation models such as YOLOv8-seg, instance-level segmentation is performed on each fish in the original RGB color image, outputting a rectangular bounding box and a pixel-level binary mask, which significantly improves the accuracy and completeness of fish body extraction and avoids the problem of inaccurate description of fish body boundaries in traditional object detection.
[0014] 2. By filtering the confidence scores of all fish instances, only visually complete and clearly defined fish bodies are retained, effectively filtering out individuals with occlusion, overlap, blurring, or extreme poses, thereby improving the robustness and reliability of the overall analysis and reducing the risk of misjudgment.
[0015] 3. By fitting the minimum bounding ellipse and combining it with the typical reference major-minor axis ratio of healthy individuals of the fish species to calculate the posture deformation penalty factor, it is possible to effectively identify stress or pathological postures such as side swimming, bending, and abnormal expansion, improve the ability to identify non-standard postures, and reduce the false negative rate. By multiplying the contour compactness index with the posture deformation penalty factor, a posture-sensitive morphological abnormality degree is constructed, which comprehensively describes the degree of abnormality in fish morphology, enhances the ability to perceive subtle morphological differences, and more accurately identifies pathological features such as fish deformation or atrophy.
[0016] 4. Calculating the Euclidean distance between the normalized color vector and the average color vector of the pixel-level binary mask region can effectively capture lesion features such as red spots, ulcers, and black spots on the surface of the fish, and enhance the sensitivity of color abnormality detection.
[0017] 5. Based on the category label of the fish instance, match the set fish-specific threshold, perform individual health judgment, realize the adaptability health assessment of different fish species, and meet the needs of refined management in multi-fish farming environments. Attached Figure Description
[0018] Figure 1 This is a flowchart of an image recognition method for the health status of marine aquaculture fish according to the present invention. Detailed Implementation
[0019] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0021] The following describes in detail, with reference to the accompanying drawings, a specific scheme for an image recognition method for the health status of marine aquaculture fish provided by the present invention.
[0022] See attached document Figure 1 The diagram illustrates a flowchart of an image recognition method for the health status of marine aquaculture fish according to an embodiment of the present invention. The method includes the following steps: S1. Acquire the original RGB color image containing the fish school; based on the acquired original RGB color image, perform instance-level segmentation to obtain the category label, confidence score, and pixel-level binary mask for each fish instance; based on the confidence score, perform confidence score filtering to obtain fish instances that pass the confidence score filtering; based on the fish instances that pass the confidence score filtering, perform image preprocessing to obtain the normalized color vector and the preprocessed RGB color image.
[0023] The underwater high-definition camera periodically captures raw RGB color images containing schools of fish. The raw RGB color images consist of three color channels: red, green, and blue, with each channel having a pixel value range of 0 to 255.
[0024] A real-time instance segmentation model, such as the YOLOv8-seg model, is used to perform multi-object instance-level segmentation on the acquired raw RGB color images, outputting the category label, bounding box, and confidence score for each detected fish instance. and pixel-level binary masks ,in, Indicates the first The confidence score of the fish instance. Indicates that the pixel belongs to the first... Example of a fish This represents the background area excluding the fish. This represents the position coordinates of a pixel.
[0025] The confidence score of each fish instance is checked for confidence screening. Only fish instances with a confidence score that reaches or exceeds the pre-calibrated optimal confidence threshold are retained. This maximizes the retention of visually complete fish instances with clear outlines and no severe occlusion or defects. At the same time, targets that cause insufficient confidence in the YOLOv8-seg model due to severe occlusion, partial visibility, severely blurred boundaries, extremely distorted poses, or being largely covered by other fish are actively removed. By using underwater high-definition cameras to collect a large number of raw RGB images of fish, including healthy and abnormal (disease, stress, deformity, etc.) fish, in actual marine aquaculture sites or controlled laboratory environments, professional technicians manually labeled each fish as healthy or abnormal, based on their biological knowledge and visual observation, forming a labeled dataset. Subsequently, the dataset was randomly divided into three sets, such as 70%-80% training set, 10%-15% validation set, and 10%-15% test set. The validation set was used to evaluate the model's generalization performance on unseen data during training, and the optimal confidence threshold was determined by the precision-recall curve.
[0026] For each fish instance that passes the confidence level screening, image preprocessing is performed: only pixels with a pixel-level binary mask value of 1 are considered, and the maximum brightness value of each of the three channels of the original RGB color image is counted, which is the maximum value of all pixel values in the channel within the pixel-level binary mask area of the fish; the pixel-level binary mask area is the area composed of pixels with a value of 1 in the pixel-level binary mask; the R, G, and B values of each pixel are divided by the maximum brightness value of the corresponding channel to obtain the normalized color vector, realizing linear stretching and normalization of each channel, and thus obtaining the preprocessed RGB color image; independent normalization of each channel can better preserve the inherent tonal differences of the fish surface, while suppressing the common problem of large areas of blue-green tone dominance underwater.
[0027] S2. Based on the normalized color vector and the preprocessed RGB color image, a health sensitivity feature index is obtained through the pose-sensitive morphology-color joint health index extraction algorithm; based on the health sensitivity feature index, a judgment result is obtained.
[0028] For each complete fish individual in the preprocessed RGB color image, after multi-target instance-level segmentation and confidence-based filtering, a health-sensitive feature index that comprehensively reflects the fish's morphological regularity and surface color uniformity is calculated using a pose-sensitive morphology-color joint health index extraction algorithm. This algorithm, based on the classic contour compactness index, introduces a pose-related deformation penalty mechanism while preserving global color variance. Finally, it uses a non-linear sigmoid function for fusion output, resulting in a health-sensitive feature index compressed to the 0-1 range.
[0029] The area of the fish is calculated by summing the total number of pixels with a value of 1 in the pixel-level binary mask of the current fish instance.
[0030] Based on the same pixel-level binary mask region, the outer contour of the fish is extracted. Mature contour detection technology, such as OpenCV's findContours function, is used to retain only the outermost continuous boundary and ignore possible tiny holes or gaps inside the fish, resulting in a set of boundary pixel points that describe the complete outline of the fish.
[0031] Using the boundary pixel sequence as input, a minimum bounding ellipse fitting is performed to obtain an ellipse parameter that optimally approximates the fish's outline. This parameter includes the lengths of the major and minor axes of the ellipse. The major axis corresponds to the extension of the fish's body in the head-to-tail direction, and the minor axis corresponds to the thickness in the body width direction. By calculating the ratio of the major to minor axis lengths and comparing it with the typical reference ratio of a healthy individual fish, the degree of relative deviation is determined and quantified as a dimensionless positive posture deformation penalty factor: when the actual ratio is closer to the typical reference ratio of a healthy individual fish, the posture deformation penalty factor is close to 1; when the actual ratio deviates significantly from the typical reference ratio of a healthy individual fish due to lateral swimming, bending, or pathological deformities, the posture deformation penalty factor is significantly greater than 1; when the fish truly becomes fat or widens, the posture deformation penalty factor is significantly less than 1. The typical reference ratio of a healthy individual fish is derived from fish biology manuals or aquaculture standards.
[0032] Furthermore, the classic contour compactness index is calculated: first, the total length of the complete outline of the fish body is obtained, that is, the total path length of the boundary pixel sequence. Then, the square of the total path length of the boundary pixel sequence is divided by the projected area of the fish body. The ratio is multiplied by 1 to obtain a contour compactness index. In an ideal circle, the contour compactness index reaches its minimum value of 1. The more irregular or elongated the shape, the larger the contour compactness index value.
[0033] The posture sensitivity morphological anomaly is obtained by directly multiplying the contour compactness index by the posture deformation penalty factor. If the fish body deviates significantly from its actual length-to-short axis ratio due to posture distortion, the posture sensitivity morphological anomaly will be further amplified based on the contour compactness index. This results in a stronger penalty effect on pathological or stress-induced morphological forms under non-standard postures, significantly improving robustness to common underwater postures such as side swimming, bending, and twisting, while retaining sensitivity to true morphological deformities.
[0034] Meanwhile, for the same pixel-level binary mask region of the preprocessed RGB color image, the average color vector of all pixels of the fish body is calculated, that is, the three-channel mean. For each pixel in the same pixel-level binary mask region, the squared Euclidean distance between the normalized color vector and the average color vector is calculated. Then, the average of the squared Euclidean distances of all pixels is obtained to obtain the global color variance, which directly quantifies the degree of unevenness of the color on the surface of the fish body: the color distribution of healthy fish is relatively uniform and the global color variance is small. When pathological changes such as local redness, whitening, black spots, and ulcers occur, the global color variance increases significantly.
[0035] The pose sensitivity morphological anomaly and the global color variance are multiplied by their respective weighting coefficients to obtain the weighted morphological and color terms. The weighting coefficients satisfy the normalization constraint, and their sum is always equal to 1, jointly determining the relative importance of morphological and color anomalies in the health sensitivity feature index.
[0036] The weighted morphology and color terms are directly added to obtain a linearly fused intermediate value. This intermediate value is then input into a sigmoid nonlinear function for transformation, outputting a health sensitivity index. The sigmoid function exhibits an S-shaped growth characteristic: when the input linearly fused intermediate value is low, indicating a healthy state, the output is close to 0 and changes slowly; when the input linearly fused intermediate value is near the inflection point, the output rises rapidly; and when the input linearly fused intermediate value is high, indicating severe abnormality, the output approaches 1 and saturates. This simulates the threshold transition phenomenon common in biology—healthy—sub-healthy—obvious pathological state—making the health sensitivity index have higher discriminative power and early warning sensitivity in the critical pathological region. The steepness and central inflection point of the sigmoid function can be fine-tuned according to the actual fish species and scenario to further optimize the clarity of the boundary between health and abnormality.
[0037] The formula for calculating the health sensitivity index is: , in, Indicates the first The health sensitivity index of the fish, with a value range of [value range missing]. ; The function is used to map the intermediate values of linear fusion to The interval, and produces a nonlinear transition effect; and These represent weighting coefficients, used to control the relative importance of morphological and color abnormalities in the health sensitivity characteristic index. This is achieved by collecting samples that are half healthy and half abnormal, and first fixing... and Each group is assigned a value of 0.5. A health sensitivity trait index is calculated, and different groups are tested using a one-dimensional search. ,make Calculate the classification performance, such as accuracy, of the health sensitivity feature indices for healthy and abnormal groups in each group, and select the group with the best classification performance. and ; Indicates the first The fish's posture sensitivity and morphological abnormality; This represents a classic indicator of contour tightness; Indicates the first The total path length of the sequence of boundary pixels of the fish, i.e., the first... The total length of the complete outline of the fish; Indicates the first The projected area of the fish's body; This represents a mathematical constant derived from the circular optimal solution in the isoperimetric inequality, which makes... It equals 1 when it is a perfect circle; The attitude deformation penalty factor is calculated using the following formula: , Indicates the first The fish's actual length-to-short axis ratio, and They represent the first The major and minor axis lengths of the minimum bounding ellipse are fitted to the pixel-level binary mask region of the fish. Based on the boundary pixel sequence, the fitEllipse function of OpenCV is used to return the ellipse parameters, including the major and minor axis lengths. The typical reference major-minor axis ratio for a healthy individual of a fish species is derived from fish biology manuals or aquaculture standards; Represents the global color variance; Indicates the first The total number of pixels within the pixel-level binary mask area of a fish; Indicates the first The pixel-level binary mask region of the fish; This represents the squared Euclidean distance between the normalized color vector and the average color vector. Indicates the first The normalized color vector of the fish; The average color vector is calculated using the following formula: ; This represents the weighted morphological terms; This indicates the weighted color item; This represents the intermediate value of linear fusion.
[0038] Based on the fish instance's category label, a fish-specific threshold preset by professional technicians is selected and compared with the health sensitivity characteristic index of each fish to determine its health status. If the health sensitivity characteristic index of each fish is greater than or equal to the fish-specific threshold, its health status is abnormal, and the output value is 1; conversely, if the health sensitivity characteristic index of each fish is less than the fish-specific threshold, its health status is normal, and the output value is 0. Simultaneously, the number of fish with abnormal health status is divided by the total number of fish in the group to calculate a group-level statistical indicator, namely the abnormality ratio, used to quickly reflect the overall health trend of the fish group.
[0039] In summary, an image recognition method for the health status of marine aquaculture fish has been developed.
[0040] The order of the embodiments is for illustrative purposes only and does not represent the superiority or inferiority of the embodiments. The processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0041] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0042] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An image recognition method for the health status of marine aquaculture fish, characterized in that, Includes the following steps: S1. Collect the original RGB color image containing the fish; based on the collected original RGB color image, perform instance-level segmentation to obtain the category label, confidence score and pixel-level binary mask for each fish instance; Based on the confidence score, fish instances that pass the confidence score screening are obtained; based on the fish instances that pass the confidence score screening, image preprocessing is performed to obtain normalized color vectors and preprocessed RGB color images; S2. Based on the normalized color vector and the preprocessed RGB color image, the health sensitivity feature index is obtained through the pose-sensitive morphology-color joint health index extraction algorithm; The judgment result is obtained based on the health sensitivity characteristic index.
2. The image recognition method for the health status of marine aquaculture fish according to claim 1, characterized in that, S2 specifically includes: Based on the pixel-level binary mask of the fish instance in the preprocessed RGB color image, the projected area of the fish body is obtained; based on the pixel-level binary mask region, the outer contour of the fish body is extracted to obtain the boundary pixel sequence.
3. The image recognition method for the health status of marine aquaculture fish according to claim 2, characterized in that, S2 specifically includes: Based on the boundary pixel sequence, the ellipse parameters are obtained; based on the ellipse parameters, the attitude deformation penalty factor is calculated.
4. The image recognition method for the health status of marine aquaculture fish according to claim 3, characterized in that, S2 specifically includes: Based on the boundary pixel sequence, calculate the total path length of the boundary pixel sequence; based on the total path length of the boundary pixel sequence and the projected area of the fish body, calculate the contour compactness index.
5. The image recognition method for the health status of marine aquaculture fish according to claim 4, characterized in that, S2 specifically includes: Multiplying the contour compactness index by the posture deformation penalty factor yields the posture-sensitive morphological anomaly degree.
6. The image recognition method for the health status of marine aquaculture fish according to claim 1, characterized in that, S2 specifically includes: Based on the pixel-level binary mask region and the normalized color vector, the average color vector of all pixels in the fish body is calculated; based on the normalized color vector and the average color vector, the global color variance is calculated.
7. The image recognition method for the health status of marine aquaculture fish according to claim 6, characterized in that, S2 specifically includes: We calculate the intermediate value of the linear fusion by weighted summation of the pose-sensitive morphological anomaly degree and the global color variance; we then transform the intermediate value of the linear fusion to output the health-sensitive feature index.
8. The image recognition method for the health status of marine aquaculture fish according to claim 7, characterized in that, S2 specifically includes: Based on the category label of the fish instance, a preset fish-specific threshold is selected and compared with the health sensitivity feature index to determine the health status. When the fish's health sensitivity feature index is greater than or equal to the fish-specific threshold, the health status is abnormal; when the fish's health sensitivity feature index is less than the fish-specific threshold, the health status is normal.
9. The image recognition method for the health status of marine aquaculture fish according to claim 8, characterized in that, S2 specifically includes: The abnormality rate was calculated based on the number of fish with abnormal health conditions.
