Trachinotus ovatus image processing method and system based on machine vision
By improving the YOLOv11 model, using the hierarchical pyramid spatial attention mechanism and HSV color space conversion, the problems of low efficiency and high false detection rate in the detection of oval pomfret diseases were solved, and high-precision identification and real-time monitoring of small lesions in complex underwater environments were achieved.
Patent Information
- Application Number
- CN202511794116.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2045-12-02
AI Technical Summary
Existing technologies for detecting diseases in oval pomfret suffer from low efficiency and high false detection rates, making it difficult to achieve real-time, online disease early warning and control. In particular, the accuracy of identifying small target lesions is limited in complex underwater environments.
An improved YOLOv11 model structure and hierarchical pyramid spatial attention mechanism are adopted, combined with HSV color space conversion and disease-specific filtering. Disease detection is performed through multimodal information fusion, including the backbone network CSPDarknet53, hierarchical pyramid spatial attention module, neck network DWFPN and detection head. Calibration is performed using disease-specific threshold filter and detection box hue consistency verification.
It enables rapid, accurate, and automated detection of oval pomfret ulceration, suitable for real-time monitoring and early warning in aquaculture sites, significantly reducing the false detection rate in underwater environments and improving the accuracy of identifying small lesions.
Smart Images

Figure CN121236799A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of aquaculture disease detection technology, specifically relating to an image processing method and system for oval pomfret based on machine vision. Background Technology
[0002] The golden pomfret (Trachinotus ovatus), also known as the golden pomfret, is an important and economically valuable marine aquaculture fish in the coastal areas of southern my country. In recent years, with the expansion of intensive aquaculture, disease problems have become increasingly prominent, with ulceration caused by pathogens such as Vibrio being particularly common. Typical symptoms of this disease include round or near-round ulcers on the body surface, approximately 2-5 mm in diameter, with obvious congestion or hemorrhage at the edges. Other symptoms include eye disease, fin damage, and gill rot. In severe cases, it can lead to mass mortality and significant economic losses.
[0003] Currently, the detection of the aforementioned oval pomfret disease mainly relies on two methods: one is manual visual observation, where experienced aquaculture personnel regularly inspect the fish population, identify suspicious lesions, and then remove the fish for preliminary assessment; the other is laboratory molecular detection techniques, such as polymerase chain reaction (PCR), which involves extracting and amplifying DNA from fish tissue samples to confirm the presence of the pathogen. However, both methods have significant limitations: manual detection is greatly affected by subjective factors, is inefficient, and has a very high rate of missed detection for early, small lesions (less than 5 mm in diameter); while PCR detection is highly accurate, the process is cumbersome and time-consuming, making it impossible to achieve real-time, online disease early warning and control, and failing to meet the intelligent and high-density management needs of modern aquaculture. Furthermore, existing research has attempted to incorporate image processing and machine learning methods for fish disease identification, but practical applications still face numerous challenges: underwater shooting environments are complex, with uneven lighting, color casts, and significant variations in turbidity, leading to unstable image quality; traditional visual algorithms rely heavily on color and texture features, resulting in limited accuracy in identifying small lesions against complex backgrounds, particularly with a high false detection rate for diseases whose colors are similar to the background (such as ulcers). Therefore, developing an intelligent detection method that can adapt to the underwater environment, integrate multimodal information, and possesses high accuracy and robustness has become an urgent need in the field of aquaculture disease prevention and control. Summary of the Invention
[0004] To address the aforementioned problems, this invention provides a machine vision-based image processing method and system for oval pomfret.
[0005] To achieve the above objectives, the present invention employs the following technical solution: This invention provides a machine vision-based image processing method for oval pomfret, comprising the following steps: Step 1: Obtain images of oval pomfret and construct an oval pomfret image dataset; Step 2: Construct an image processing model for oval pomfret based on an improved YOLOv11. This model includes a backbone network, a hierarchical pyramid spatial attention module, a neck network, and a detection head. Traditional backbone networks such as VGG and Darknet have two major drawbacks: high computational cost, making them unsuitable for real-time detection in aquaculture environments; and an imbalance between extracting detailed and semantic features from underwater images, causing small target features to be obscured by the background. The backbone network of this invention uses the CSPDarknet53 network as its basic architecture. The original oval pomfret image is input into the backbone network to obtain three levels of feature maps. The CSPDarknet53 network, through a cross-stage partial connection structure, reduces computational cost while preserving more shallow detailed features. (e.g., the congested edges of ulcers, the tearing texture of fin damage), adapted for real-time detection in aquaculture sites; the three-level feature maps provide a full-dimensional feature foundation for the subsequent multi-scale enhancement of the hierarchical pyramid spatial attention module, avoiding the missed detection of small lesions caused by single-scale features; the three-level feature maps are processed by the hierarchical pyramid spatial attention module to obtain channel enhancement features; the neck network adopts the Dynamic Weighted Feature Pyramid Network (DWFPN), and the channel enhancement features are processed by the neck network to obtain the second fusion feature; the second fusion feature is processed by the detection head to obtain preliminary detection results; in the process of training the oval pompano image processing model based on the improved YOLOv11, the loss function includes bounding box loss, target confidence loss, and classification loss; Step 3: Perform HSV color space conversion and hue filtering of defects to generate corresponding binary masks; based on the preliminary detection results, obtain the hue similarity score of each detection box through hue consistency verification; through confidence fusion and filtering, remove detection boxes below the threshold to obtain calibrated detection results; use color modality information to correct the detection results of visual modality, significantly reducing false detections caused by color shift in underwater images.
[0006] Furthermore, the hierarchical pyramid spatial attention module includes a hierarchical feature aggregation layer, a multi-scale spatial attention layer, and a channel reweighting layer. The feature maps of the three levels are concatenated in the channel dimension by the hierarchical feature aggregation layer to obtain an initial feature map. By concatenating the three-level features in the channel dimension, detailed texture, local semantics, and global category information are integrated, enabling the model to simultaneously possess the accuracy for locating small lesions and the ability to classify large lesions. The initial feature map is then processed by the multi-scale spatial attention layer to obtain spatially enhanced features. The spatially enhanced features are then processed by the channel reweighting layer to obtain channel-enhanced features.
[0007] Furthermore, to enhance the response of the lesion area and suppress background noise, this invention employs a multi-scale spatial attention layer to process the initial feature map. The multi-scale spatial attention layer includes a multi-scale feature extraction unit, a feature fusion unit, and a spatial feature enhancement unit. The initial feature map is input to the multi-scale feature extraction unit, and after passing through three parallel dilated convolution branches, three dilated convolution features are obtained. The three dilated convolution features are input to the feature fusion unit, where they are added element-wise to obtain a first fused feature. The first fused feature undergoes convolution operations and a sigmoid activation function to generate a spatial weight map. The convolution operation is used to compress channels. The initial feature map and the spatial weight map are input to the spatial feature enhancement unit, where the initial feature map and the spatial weight map are multiplied element-wise to obtain the spatially enhanced feature.
[0008] Furthermore, the channel reweighting layer enhances lesion-related feature channels (such as ulcer texture / gill rot color) and suppresses irrelevant / redundant channels. The spatial enhancement features are input into the channel reweighting layer and processed sequentially through global average pooling, a first fully connected layer, a ReLU activation function, a second fully connected layer, and a Sigmoid activation function to obtain channel weights. The global average pooling is used to compress spatial information and generate channel description vectors. The first fully connected layer is used to reduce the dimensionality of the number of channels. The second fully connected layer is used to restore the feature map to the original number of channels. The spatial enhancement features and channel weights are then multiplied element-wise by the channel feature enhancement unit to obtain the channel enhancement features.
[0009] Furthermore, the original oval pomfret image is converted from the RGB color space to the HSV color space; a disease-specific threshold filter is set based on the color characteristics exhibited by specific diseases in the H hue channel; the specific settings of the disease-specific threshold filter are as follows: ulcer disease: H value range [0°, 15°], mask color is red; gill rot disease: H value range [90°, 120°], mask color is green; fin damage: H value range [30°, 50°], mask color is blue; fin damage: H value range [200°, 220°], mask color is yellow; the H value range is selected according to the disease category predicted by the detection box to generate a binary mask.
[0010] Furthermore, each candidate detection box in the preliminary detection results output by the model is mapped back to the HSV space of the original image, and the H value histogram of the pixels within the detection box region is calculated; the proportion of pixels within the region that fall within the range of the corresponding defect filter is counted to obtain the hue similarity score of each detection box.
[0011] Furthermore, the confidence score of each detection box output by the model is multiplied by the hue similarity score of each detection box to obtain the final confidence score of each detection box; a fusion score threshold is set; when the final confidence score is lower than the fusion score threshold, the detection box is removed, and the calibrated detection result is finally obtained.
[0012] This invention also provides a machine vision-based image processing system for oval pomfret, which executes the aforementioned machine vision-based image processing method for oval pomfret, including: Data acquisition module: used to acquire images of oval pomfret and construct an image dataset of oval pomfret; Model building module: used to build an image processing model for oval pomfret based on improved YOLOv11. The model includes a backbone network, a hierarchical pyramid spatial attention module, a neck network, and a detection head. The original oval pomfret image is input into the oval pomfret image processing model based on improved YOLOv11 to obtain preliminary detection results. The detection box calibration module is used to perform HSV color space conversion and disease hue filtering on the original oval pomfret image to generate a corresponding binary mask; based on the preliminary detection results, the hue similarity score of each detection box is obtained through detection box hue consistency verification; through confidence fusion and filtering, detection boxes below the threshold are removed to obtain the calibrated detection results.
[0013] The advantages of this invention are: This invention significantly enhances the ability to extract features from small-scale lesions and improves the model's perception performance in complex underwater environments by introducing an improved YOLOv11 model structure and a hierarchical pyramid spatial attention mechanism. By fusing disease-specific hue information from the HSV color space, a visual-color dual-modal verification mechanism is constructed, effectively overcoming the false detection problems caused by underwater color bias and lighting changes in single-vision models. It exhibits particularly strong correction capabilities for diseases with significant color characteristics, such as gill rot. This invention achieves rapid, accurate, and automated detection of oval pomfret ulceration, suitable for real-time monitoring and early warning in aquaculture, providing reliable technical support for intelligent disease control in aquaculture. Attached Figure Description
[0014] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0015] Figure 1 This is a flowchart of the steps of the method of the present invention; Figure 2 Precision-recall curves for the YOLOv11 base model; Figure 3This is a precision-recall curve of the method of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0017] Example 1 In this embodiment, as Figure 1 As shown, this invention provides a machine vision-based image processing method for oval pomfret, the specific steps of which include: S1. Obtain images of oval pomfret and construct an oval pomfret image dataset.
[0018] S2. Construct an image processing model for oval pomfret based on an improved YOLOv11, the model including a backbone network, a hierarchical pyramid spatial attention (HPSA) module, a neck network, and a detection head; Specifically, the backbone network uses the CSPDarknet53 network as its basic architecture; the original oval pomfret image is input into the backbone network to obtain three levels of feature maps; Specifically, the Hierarchical Pyramid Spatial Attention (HPSA) module includes a hierarchical feature aggregation layer, a multi-scale spatial attention layer, and a channel reweighting layer. To enhance the response of the lesion area and suppress background noise, the multi-scale spatial attention layer includes a multi-scale feature extraction unit (including a first branch, a second branch, and a third branch, wherein the first branch, the second branch, and the third branch respectively adopt dilated convolution with a dilation rate r=1 and a receptive field of 3×3, dilated convolution with a dilation rate r=3 and a receptive field of 7×7, and dilated convolution with a dilation rate r=5 and a receptive field of 11×11), a feature fusion unit, and a spatial feature enhancement unit. The channel reweighting layer can enhance lesion-related feature channels (such as ulcer texture / gill rot color) and suppress irrelevant / redundant channels. The channel reweighting layer includes global average pooling, a first fully connected layer, a ReLU activation function, a second fully connected layer, a Sigmoid activation function, and a channel feature enhancement unit. The global average pooling is used to compress spatial information and generate channel description vectors. The first fully connected layer is used to reduce the dimensionality of the number of channels. The second fully connected layer is used to restore the feature map to the original number of channels.
[0019] Specifically, the three-level feature maps are concatenated along the channel dimension by a hierarchical feature aggregation layer to obtain an initial feature map. The initial feature map is input to a multi-scale feature extraction unit and passes through three parallel dilated convolution branches to obtain three dilated convolution features. The three dilated convolution features are input to a feature fusion unit and added element-wise to obtain a first fused feature. The first fused feature is then processed by convolution and a sigmoid activation function to generate a spatial weight map. The convolution operation uses a 1×1 convolution kernel to compress channels. The initial feature map and the spatial weight map are input to a spatial feature enhancement unit, where the initial feature map and the spatial weight map are multiplied element-wise to obtain spatially enhanced features.
[0020] The spatial enhancement features are input into the channel reweighting layer, and are processed sequentially through global average pooling, a first fully connected layer, a ReLU activation function, a second fully connected layer, and a Sigmoid activation function to obtain the channel weights. The spatial enhancement features and the channel weights are then multiplied element-wise by the channel feature enhancement unit to obtain the channel enhancement features.
[0021] Specifically, the neck network adopts a Dynamically Weighted Feature Pyramid Network (DWFPN); the channel enhancement features are processed by the neck network to obtain a second fusion feature; the second fusion feature is processed by the detection head to obtain a preliminary detection result.
[0022] Specifically, during the training of the oval pompano image processing model based on the improved YOLOv11, the loss function includes bounding box loss, target confidence loss, and classification loss.
[0023] The S3.RGB color space is greatly affected by underwater lighting (such as strong light reflection and weak light dimming) and water color cast (such as blue water causing disease to appear bluish). Traditional models rely on RGB features and are prone to misidentifying normal areas with color distortion as disease (such as misidentifying normal fish scales in blue water as gill rot). This invention performs HSV color space conversion and disease hue filtering to generate corresponding binary masks; the hue similarity score of each detection box is obtained through detection box hue consistency verification; through confidence fusion and filtering, detection boxes below the threshold are removed to obtain calibrated detection results; and the detection results of the visual modality are corrected by using color modality information, which significantly reduces false detections caused by underwater image color cast.
[0024] Specifically, S31.HSV color space conversion and disease hue filtering: The original oval pomfret image is converted from the RGB color space to the HSV color space; a disease-specific threshold filter is set based on the color characteristics exhibited by specific diseases in the H hue channel; the specific settings of the disease-specific threshold filter are as follows: Ulcer disease: H value range [0°, 15°], mask color is red; Gill rot disease: H value range [90°, 120°], mask color is green; Fin damage: H value range [30°, 50°], mask color is blue; Fin damage: H value range [200°, 220°], mask color is yellow; The H value range is selected according to the disease category predicted by the detection box to generate a binary mask. .
[0025] Specifically, S32. Hue consistency verification of detection boxes: Map each candidate detection box in the preliminary detection results output by the model back to the HSV space of the original image, calculate the H value histogram of pixels within the detection box region; count the proportion of pixels within the region that fall within the corresponding defect filter range, and obtain the hue similarity score of each detection box, as expressed by the following formula: , in, This indicates the hue similarity score; This indicates the number of pixels within the detection box that conform to the range H; Indicates a binary mask. Indicates the area affected by the disease. Indicates the background area; This indicates the total number of pixels in the detection box.
[0026] Specifically, S33. Confidence fusion and filtering: The confidence score of each detection box output by the model is multiplied by the hue similarity score of each detection box in step S32 to obtain the final confidence score of each detection box. The formula is as follows: , in, This represents the confidence score of the detection box. This represents the final confidence score; the fusion score threshold is set to 0.7; if the final confidence score is lower than the fusion score threshold, the detection box is removed, and the calibrated detection result is obtained.
[0027] Example 2 In this embodiment, an oval pomfret image dataset was constructed, containing 8475 images, with the test set containing 1695 images. Experiments were conducted on this oval pomfret image dataset using the YOLO11 base model, the YOLO11+HPSA model, and the YOLO11+HPSA+HSV model for comparison. The experimental results are shown in Table 1.
[0028] Table 1. Experimental comparison of the method of the present invention Mean accuracy (mAP) is a core metric for measuring the accuracy of a model in object detection; a higher value indicates a more accurate model. The F1 score is the harmonic mean of precision and recall, comprehensively reflecting the model's classification performance. As shown in the table, adding HPSA and HSV color space enhancements sequentially significantly improved model performance, with mAP and F1 scores increasing by 21% and 19%, respectively. This demonstrates that the method described in this invention has a clear advantage in improving detection accuracy and classification stability.
[0029] like Figure 2 , Figure 3 As shown in the figure, the precision (PR) curve of the method of this invention is generally located above and to the right of the YOLOv11 curve. At the same recall point, the precision of the method of this invention is higher; at the same precision point, the recall of the method of this invention is higher, proving that the method of this invention can better balance precision and recall. This invention, by introducing HPSA and HSV color space enhancements, can significantly improve the performance of the YOLOv11 model in object detection tasks.
[0030] Example 3 This embodiment provides a machine vision-based image processing system for oval pomfret, which executes the machine vision-based image processing method for oval pomfret described in Embodiment 1, including: Data acquisition module: used to acquire images of oval pomfret and construct an image dataset of oval pomfret; Model building module: used to build an image processing model for oval pomfret based on improved YOLOv11. The model includes a backbone network, a hierarchical pyramid spatial attention module, a neck network, and a detection head. The original oval pomfret image is input into the oval pomfret image processing model based on improved YOLOv11 to obtain preliminary detection results. The detection box calibration module is used to perform HSV color space conversion and disease hue filtering on the original oval pomfret image to generate a corresponding binary mask; based on the preliminary detection results, the hue similarity score of each detection box is obtained through detection box hue consistency verification; through confidence fusion and filtering, detection boxes below the threshold are removed to obtain the calibrated detection results.
[0031] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A machine vision-based processing method for images of Trachurus japonicus, characterized by, The method comprises the following steps: An image of Trachurus japonicus is acquired, and an image dataset of Trachurus japonicus is constructed; An image processing model of Trachurus japonicus based on an improved YOLOv11 is constructed, the model comprising a backbone network, a hierarchical pyramid spatial attention module, a neck network and a detection head; an original image of Trachurus japonicus is input into the backbone network to obtain three levels of feature maps; the three levels of feature maps pass through the hierarchical pyramid spatial attention module to obtain channel enhanced features; The channel enhanced features pass through the neck network to obtain second fusion features; the second fusion features pass through the detection head to obtain a preliminary detection result; the hierarchical pyramid spatial attention module comprises a hierarchical feature aggregation layer, a multi-scale spatial attention layer and a channel reweighting layer; the three levels of feature maps pass through the hierarchical feature aggregation layer to be spliced in the channel dimension to obtain an initial feature map; the initial feature map passes through the multi-scale spatial attention layer to obtain spatial enhanced features; The spatial enhanced features pass through the channel reweighting layer to obtain channel enhanced features; HSV color space conversion and disease hue filtering are performed to generate a corresponding binary mask; Based on the preliminary detection result, hue similarity scores of each detection box are obtained through detection box hue consistency verification; through confidence fusion and filtering, detection boxes below a threshold value are removed to obtain a calibrated detection result.
2. The method according to claim 1, wherein the method is characterized by: The initial feature map passes through the multi-scale spatial attention layer to obtain spatial enhanced features: The multi-scale spatial attention layer comprises a multi-scale feature extraction unit, a feature fusion unit and a spatial feature enhancement unit; The initial feature map is input into the multi-scale feature extraction unit and passes through three parallel hollow convolution branches to obtain three hollow convolution features; The three hollow convolution features are input into the feature fusion unit, and element-wise addition is performed to obtain first fusion features; the first fusion features pass through convolution operation and Sigmoid activation function to generate a spatial weight map; the initial feature map and the spatial weight map are input into the spatial feature enhancement unit, and the initial feature map and the spatial weight map are multiplied element by element to obtain spatial enhanced features. 3.The method of image processing of jackfish based on machine vision according to claim 2, wherein, The spatial enhanced features pass through the channel reweighting layer to obtain channel enhanced features: The spatial enhanced features are input into the channel reweighting layer and processed through, in sequence, global average pooling, a first full connection layer, a ReLU activation function, a second full connection layer and a Sigmoid activation function to obtain channel weights; the spatial enhanced features and the channel weights are multiplied element by element through a channel feature enhancement unit to obtain channel enhanced features.
4. The method according to claim 3, wherein the method further comprises the steps of: HSV color space conversion and disease hue filtering are performed to generate a corresponding binary mask; The original Trachurus japonicus image is converted from an RGB color space to an HSV color space; a disease-specific threshold filter is set according to the color characteristics of a specific disease in an H hue channel; the specific setting of the disease-specific threshold filter is as follows: for ulcer disease, the H value range is [0°, 15°], and the mask color is red; for gill rot disease, the H value range is [90°, 120°], and the mask color is green; for fish fin injury, the H value range is [30°, 50°], and the mask color is blue; for fish fin injury, the H value range is [200°, 220°], and the mask color is yellow; the H value range is selected according to the disease category predicted by the detection box, and a binary mask is generated.
5. The machine vision-based Trachurus japonicus image processing method according to claim 4, characterized in that, The hue similarity scores of the detection boxes are obtained through hue consistency verification of the detection boxes: The H value histogram of the pixels in the detection box region is calculated by mapping each candidate detection box in the preliminary detection result output by the model back to the HSV space of the original image; the proportion of the pixels in the region falling within the range of the corresponding disease filter is counted to obtain the hue similarity score of each detection box.
6. The jack mackerel image processing method based on machine vision according to claim 5, characterized in that, Through confidence fusion and filtering, the detection boxes below the threshold are removed to obtain the calibrated detection result: The final confidence score of each detection box is obtained by multiplying the confidence score of each detection box output by the model and the hue similarity score of each detection box; A fusion score threshold is set; When the final confidence score is lower than the fusion score threshold, the detection box is removed, and the calibrated detection result is finally obtained.
7. The method according to claim 6, wherein the image processing method is based on machine vision. The backbone network adopts a CSPDarknet53 network as a basic architecture; and the neck network adopts a dynamic weighted feature pyramid network DWFPN.
8. The jack mackerel image processing method based on machine vision according to claim 7, characterized in that, In the process of training the Trachurus japonicus image processing model based on the improved YOLOv11, the loss function includes a bounding box loss, a target confidence loss and a classification loss.
9. A machine vision-based jackfish image processing system that performs a machine vision-based jackfish image processing method according to claim 1, characterized in that, It comprises: A data acquisition module is used to acquire Trachurus japonicus images and construct a Trachurus japonicus image dataset; A model construction module is used to construct a Trachurus japonicus image processing model based on the improved YOLOv11, wherein the model comprises a backbone network, a hierarchical pyramid spatial attention module, a neck network and a detection head; the original Trachurus japonicus image is input into the Trachurus japonicus image processing model based on the improved YOLOv11 to obtain a preliminary detection result; A detection box calibration module is used to perform HSV color space conversion and disease hue filtering on the original Trachurus japonicus image to generate a corresponding binary mask; Based on the preliminary detection result, the hue similarity scores of the detection boxes are obtained through hue consistency verification of the detection boxes; through confidence fusion and filtering, the detection boxes below the threshold are removed to obtain the calibrated detection result.
Citation Information
Patent Citations
Vehicle and pedestrian detection method based on vehicle-mounted thermal infrared imager in complex scene
CN111915583A
Feature pyramid network detection method based on weighted cross-level channel attention mechanism
CN120071066A
Fruit tree pest detection method and device based on improved YOLOv11
CN120147871A
DRZXConv-based rapid identification method for percocephalus latus
CN120279551A
Fish disease identification method based on deep learning
CN120451761A