A method and system for detecting underwater coral bleaching based on improved YOLO detection
By improving the YOLO detection method and combining it with an underwater refraction model and Zhang Zhengyou calibration method, underwater imaging distortion is corrected and the image is enhanced, thus solving the accuracy problem of underwater coral bleaching detection and achieving real-time and accurate coral bleaching identification.
Patent Information
- Application Number
- CN202610949461.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-11-20
AI Technical Summary
Existing methods for detecting coral bleaching are susceptible to light refraction and scattering during underwater imaging, leading to geometric distortion and color inaccuracy, making it difficult to accurately identify coral bleaching phenomena.
An improved YOLO detection method was adopted, combined with an underwater refraction model and Zhang Zhengyou calibration method for camera calibration and distortion correction. Multi-scale Retinex image enhancement was used, and dynamic convolution modules and EMA efficient multi-scale attention mechanisms were embedded for coral bleaching detection.
It effectively corrects underwater imaging distortion, enhances image contrast and detail, and improves the accuracy and stability of coral bleaching detection, making it suitable for real-time detection on underwater robots or edge computing platforms.
Smart Images

Figure CN123142011A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and in particular to an underwater coral bleaching detection method and system based on an improved YOLO detection method. Background Technology
[0002] Coral bleaching refers to the phenomenon where corals turn white due to the loss of their symbiotic zooxanthellae. The main causes include abnormally high seawater temperatures, ultraviolet radiation, and pollution. Currently, methods for monitoring coral degradation focus on analyzing the degree of bleaching, including the use of satellite remote sensing equipment and spectral sensors. However, these methods are costly, lack sensitivity, and are easily affected by environmental factors and equipment errors.
[0003] With the increasing demand for intelligent, real-time, and automated analysis, visual sensors are widely used in coral monitoring research due to their intuitiveness, rich information content, and ease of integration with artificial intelligence technologies. However, when using visual methods to monitor coral bleaching, underwater imaging is prone to geometric distortion and color distortion due to the refraction and scattering effects of light in the water. Furthermore, the distribution characteristics of coral bleaching further increase the difficulty of bleaching detection.
[0004] It is evident that current coral bleaching identification algorithms still have shortcomings and cannot accurately identify underwater coral bleaching phenomena. Summary of the Invention
[0005] The purpose of this invention is to solve the problems in the prior art.
[0006] The technical solution adopted by this invention to solve its technical problem is: to provide an underwater coral bleaching detection method based on improved YOLO detection, comprising the following steps:
[0007] The underwater refraction model and Zhang Zhengyou's calibration method were combined to complete the calibration of the binocular camera and the underwater refraction distortion correction.
[0008] Underwater images were acquired using a calibrated and corrected binocular camera.
[0009] The underwater image was enhanced using multi-scale Retinex.
[0010] Using an improved YOLO model for underwater coral bleaching detection;
[0011] The improved YOLO model embeds a dynamic convolutional module between the backbone and neck networks to adaptively extract local coral features, and introduces an efficient multi-scale attention mechanism (EMA) in front of the head to enhance multi-target feature response and suppress redundant background information.
[0012] Preferably, the process of integrating the underwater refraction model with Zhang Zhengyou's calibration method to calibrate the binocular camera and correct underwater refractive distortion includes the following steps:
[0013] Radial and tangential distortion corrections were achieved using camera intrinsic parameters, distortion coefficients, and a standard pinhole camera distortion model obtained through Zhang Zhengyou's planar calibration.
[0014] By combining the underwater refraction model with Zhang Zhengyou's method based on a planar calibration plate, all parameters related to the camera and refraction are jointly optimized.
[0015] Preferably, the step of correcting radial and tangential distortion by using the camera intrinsic parameters, distortion coefficients, and standard pinhole camera distortion model obtained through Zhang Zhengyou's planar calibration includes the following steps:
[0016] Radial distortion correction is performed using the following formula:
[0017]
[0018] Tangential distortion is performed using the following formula:
[0019]
[0020] in, Let be the radius of curvature, then... , The radial distortion coefficient is... These are the coordinates of the corner point after distortion. These are the correct coordinates of the corner points after distortion correction.
[0021] Preferably, the step of combining the underwater refraction model with Zhang Zhengyou's method based on a planar calibration plate to jointly optimize all parameters related to the camera and refraction includes the following steps:
[0022] The direction of light refraction at the interface of a water-glass-air multilayer medium, calculated using Snell's refraction relation, is expressed as:
[0023]
[0024] in, , These represent the refractive indices of water and glass, respectively. , These represent the angles between the light rays on the water side and the glass side and the interface normal, respectively. , These represent the direction vectors of light rays in the water and glass media, respectively; , () represents the coordinates of the light ray on the virtual imaging plane after refraction. and These represent the coordinates of the refraction points on the water side and the glass side, respectively.
[0025] The mapping relationship between virtual image points and image pixels is calculated and expressed as:
[0026]
[0027] in, , , , For camera internal parameters; and These are the equivalent focal lengths in the horizontal and vertical directions of the image, respectively. and , respectively, are the pixel coordinates of the principal point in the horizontal and vertical directions of the image; u and v are the final image pixel coordinates;
[0028] Establish a minimum reprojection error objective function and jointly optimize all camera and refraction-related parameters:
[0029]
[0030] in, The parameter vector to be optimized includes camera intrinsic parameters, camera extrinsic parameters, distortion parameters, and refractive index. For the refraction projection function, based on the current parameters To make the corner points in the world coordinate system Projecting onto the image plane yields the predicted pixel coordinates; It is the first one on the calibration board. The world coordinates of each corner point It is the first one actually detected Image pixel coordinates of each corner point;
[0031] The The calculation process is as follows: First, based on the camera's extrinsic parameters, the corner points of the calibration plate in the world coordinate system are... Transform to the camera coordinate system to determine the direction of the incident light ray; then calculate the refraction direction of the light ray at the water-glass-air multi-layer medium interface according to the Snell refraction relationship shown in equations (5) and (6); then obtain the coordinates on the virtual imaging plane according to the refracted light ray path; finally, map the virtual imaging point to the image pixel coordinates according to equation (7) to obtain the predicted pixel coordinates; the objective function minimizes the predicted pixel coordinates. Compared with the actual detected pixel coordinates By reducing the reprojection error between the parameters, joint optimization of camera parameters and refraction-related parameters can be achieved.
[0032] Preferably, the underwater image enhancement using multi-scale Retinex includes the following steps:
[0033] Median filtering is used by defining a sliding window around each pixel, sorting the gray values of all pixels within the window, and replacing the original value of the center pixel with the median value.
[0034] Histogram equalization is used to redistribute the pixel gray values of the image. The red, green and blue color channels of the contrast-stretched image are separated, the red channel with the most severe attenuation is enhanced independently, and then the three channels are merged back together.
[0035] A blurred version of the image is obtained by applying a Gaussian weighted average to the merged image using a Gaussian filter.
[0036] Subtracting this blurred version of the image from the original image yields high-frequency details representing edges and textures;
[0037] Finally, the high-frequency details are added back to the original image with a certain weight, thereby achieving sharpening.
[0038] Preferably, the dynamic convolution module includes the following steps in its internal calculation process:
[0039] For the i-th candidate convolution kernel Calculate four types of attention weights, including spatial dimension attention weights. Input channel attention weights Output channel attention weights And convolution kernel selection attention weights ;
[0040] The output feature map is calculated using four types of attention weights, and is represented as follows:
[0041]
[0042] in, This is the input feature map for the ODConv dynamic convolution module. This represents the output feature map of the ODConv dynamic convolution module; n is the number of candidate convolution kernels. For the first There are 10 candidate convolution kernels.
[0043] Preferably, the EMA efficient multi-scale attention mechanism includes the following steps in its internal calculation process:
[0044] First, the input feature map Divided evenly into channels Group the data, then reshape the channel dimensions of the grouped data to the batch dimension to obtain a new tensor. , represented as:
[0045]
[0046] The input consists of two parallel branches, one of which passes through 1... 1. Convolution and activation functions generate channel attention weights, and Element-wise multiplication yields short-range dependency features Another one went through 3 The 3-branch architecture captures long-range spatial dependencies by expanding the receptive field, outputting multi-scale features. ; respectively represented as:
[0047]
[0048] right and Global features are obtained by performing 2D global average pooling respectively. and The final attention weights are obtained through further matrix dot product, normalization, and multiplication and summation. , represented as:
[0049]
[0050] The final attention weight Input features after grouping and reshaping By weighting each element, we get Then Restore the original grouping method to the input feature map. The same dimensions yield the output feature map. .
[0051] This invention also provides an underwater coral bleaching detection system based on an improved YOLO detection method, comprising:
[0052] The calibration and correction module integrates the underwater refraction model and Zhang Zhengyou's calibration method to complete the calibration of the binocular camera and the correction of underwater refraction distortion.
[0053] The underwater acquisition module uses a calibrated and corrected binocular camera to acquire underwater images.
[0054] The underwater enhancement module uses multi-scale Retinex to enhance the underwater image;
[0055] The bleaching detection module uses an improved YOLO model to detect underwater coral bleaching.
[0056] The improved YOLO model embeds a dynamic convolutional module between the backbone and neck networks to adaptively extract local coral features, and introduces an efficient multi-scale attention mechanism (EMA) in front of the head to enhance multi-target feature response and suppress redundant background information.
[0057] The present invention also provides an electronic device, comprising:
[0058] One or more processors;
[0059] A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to perform any of the methods described above.
[0060] The present invention also provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements any of the methods described above.
[0061] The present invention has the following beneficial effects:
[0062] (1) This invention targets the visual characteristics of coral bleaching areas as “low saturation, near white, and weak boundaries”. It adopts a cascade enhancement method of median filtering, histogram equalization, independent red channel compensation, and Gaussian detail sharpening. This method can suppress suspended particle noise and compensate for the attenuation of red light by the water body, thus preventing the bleached area from being submerged by the blue-green background or shadow area. At the same time, it highlights the edge of the bleached patch, the texture of the coral skeleton, and the transition zone between bleached and healthy tissue by high-frequency detail re-addition, which is conducive to the subsequent YOLO network learning of more stable bleaching discrimination features.
[0063] (2) The present invention uses the lightweight YOLOv8n as the baseline, embeds the ODConv dynamic convolution module in the backbone network, and sets the EMA efficient multi-scale attention mechanism in front of the detection head; ODConv can adaptively adjust the space, channel and kernel selection weight of the convolution kernel according to the morphological changes of coral dendritic structure, occlusion adhesion and irregular whitening patches in the input image; EMA can enhance the response of multi-scale whitening targets and suppress the interference of sand, algae, reflection and complex coral texture background with low computational overhead; making the present invention more suitable for deployment on underwater robots or edge computing platforms to realize real-time coral whitening detection.
[0064] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments, but the present invention is not limited to the embodiments. Attached Figure Description
[0065] Figure 1 This is a flowchart illustrating the steps of an underwater coral bleaching detection method based on an improved YOLO detection method according to an embodiment of the present invention.
[0066] Figure 2 This is a schematic diagram of camera calibration according to an embodiment of the present invention;
[0067] Figure 3 This is a schematic diagram of an underwater camera refraction imaging model according to an embodiment of the present invention;
[0068] Figure 4 This is a flowchart illustrating the image enhancement process according to an embodiment of the present invention;
[0069] Figure 5 This is a schematic diagram of the improved YOLO network according to an embodiment of the present invention;
[0070] Figure 6 This is a schematic diagram of the structure of an underwater coral bleaching detection system based on an improved YOLO detection method according to an embodiment of the present invention;
[0071] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0072] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0073] Figure 1 This is a flowchart illustrating the steps of an underwater coral bleaching detection method based on an improved YOLO detection method according to an embodiment of the present invention, including the following steps:
[0074] S101 integrates the underwater refraction model and Zhang Zhengyou's calibration method to complete the calibration of the binocular camera and underwater refraction distortion correction;
[0075] S102 uses a calibrated and corrected binocular camera to acquire underwater images;
[0076] S103, The underwater image is enhanced using multi-scale Retinex;
[0077] S104, underwater coral bleaching detection using an improved YOLO model;
[0078] The improved YOLO model embeds a dynamic convolutional module between the backbone and neck networks to adaptively extract local coral features, and introduces an efficient multi-scale attention mechanism (EMA) in front of the head to enhance multi-target feature response and suppress redundant background information.
[0079] Specifically, the underwater binocular camera calibration and geometric distortion correction performed in S101 first involves underwater refractive distortion correction of the underwater binocular camera before the detection algorithm is deployed, such as... Figure 2 As shown.
[0080] Radial distortion is corrected by the following formula:
[0081]
[0082] Tangential distortion is corrected by the following formula:
[0083]
[0084] in, Let be the radius of curvature, then... , The radial distortion coefficient is... Here are the coordinates of the corner point after distortion, and here are the coordinates observed by the naked eye. These are the correct coordinates of the corner points after distortion correction.
[0085] Underwater camera refraction imaging model as follows Figure 3 As shown, there is a nonlinear relationship between the target point and the imaging point, which is affected by parameters such as camera parameters, the thickness of waterproof media such as glass, and the refractive index of the media. Figure 3 In These represent the camera focal length, the distance from the camera's optical center to the waterproof casing, and the thickness of the glass waterproof casing, respectively. By combining the underwater refraction model with Zhang Zhengyou's method based on a planar calibration plate, a precise refraction path for light passing through a multi-layered "water-glass-air" medium is established, thus correcting the traditional pinhole model. Light passes through the water-glass interface. At that time, the angle of refraction satisfies:
[0086]
[0087] in, , These represent the refractive indices of water and glass, respectively. , These represent the angles between the light rays on the water side and the glass side and the interface normal, respectively. , These represent the direction vectors of light rays in the water and glass media, respectively; , () represents the coordinates of the light ray on the virtual imaging plane after refraction. and These represent the coordinates of the refraction points on the water side and the glass side, respectively. The essence of Snell's Law is that the sine of the angle between a ray and the normal is inversely proportional to the refractive index. In water, the ray's angle with the interface normal (perpendicular to the glass surface) is... (Axial direction) included angle sine value Similarly, the term on the right represents the angle between the ray of light and the normal in the glass. sine value Through the glass-air interface ( After that, the final mapping between virtual image points and image pixels is:
[0088]
[0089] in, , , , For camera internal parameters; and These are the equivalent focal lengths (in pixels) in the horizontal and vertical directions of the image, respectively. and , respectively, are the pixel coordinates of the principal point in the horizontal and vertical directions of the image; u and v are the final image pixel coordinates.
[0090] By establishing a minimum reprojection error objective function, all camera and refraction-related parameters are jointly optimized:
[0091]
[0092] in The parameter vector to be optimized includes camera intrinsic parameters, camera extrinsic parameters, distortion parameters, and refractive index. Refraction projection function, based on current parameters To make the corner points in the world coordinate system Projecting this onto the image plane yields the predicted pixel coordinates. It is the first one on the calibration board. The world coordinates of each corner point (determined by the physical dimensions of the calibration plate). It is the first one actually detected Image pixel coordinates of each corner point. The refraction projection function is defined by the aforementioned refraction model and camera imaging model. Its specific calculation process is as follows: First, the calibration plate corner points in the world coordinate system are transformed to the camera coordinate system based on the camera's extrinsic parameters to determine the direction of the incident light ray; then, based on the Snell refraction relationship shown in equations (5) and (6), the refraction direction of the light ray at the water-glass-air multi-layer medium interface is calculated; next, the coordinates on the virtual imaging plane are obtained based on the refracted light ray path; finally, the virtual imaging point is mapped to image pixel coordinates according to equation (7) to obtain the predicted pixel coordinates. The objective function minimizes the predicted pixel coordinates. Compared with the actual detected pixel coordinates The reprojection error between the parameters is addressed to achieve joint optimization of camera parameters and refraction-related parameters. Specifically, in S103, a multi-scale Retinex method is used to enhance the underwater image through noise reduction, contrast enhancement, color correction, and detail sharpening, such as... Figure 4 As shown, the details are as follows:
[0093] Median filtering is used by defining a sliding window (e.g., 3×3) around each pixel, sorting the grayscale values of all pixels within the window, and replacing the original value of the center pixel with the median value. The specific formula is as follows:
[0094]
[0095] in, Represents pixels, Represents a set of pixel values. This represents the value in the filtered set.
[0096] Histogram equalization is used to redistribute the pixel grayscale values of the image. The red (R), green (G), and blue (B) color channels of the contrast-stretched image are separated, and the red channel, which has the most severe attenuation, is enhanced independently. Finally, the three adjusted channels are merged back together.
[0097] A blurred version is obtained by applying a Gaussian weighted average (i.e., low-pass filtering) to the image using a Gaussian filter. The filter formula is:
[0098]
[0099] Where (x, y) represents the center position of the convolution kernel. It is the standard deviation, used to control the degree of blurring or smoothing in an image. The larger the value, the blurrier the image. The convolution kernel generated by the Gaussian function is used to perform a Gaussian-weighted average on the image, achieving smoothing.
[0100] Then, subtract the blurred image from the original image to obtain high-frequency details representing edges and textures; finally, add this detail signal back to the original image with certain weights to achieve sharpening. The sharpening formula is:
[0101]
[0102] in It is the original image. It is a blurred image obtained by convolving the image with a Gaussian filter. The difference between the original image and the blurred image lies in the extracted high-frequency details, namely edges and textures. This is the enhancement factor, used when it is greater than 0, to control the intensity of detail enhancement. The larger the value, the stronger the sharpening effect.
[0103] Specifically, the detection model used in S104 embeds an ODConv dynamic convolutional module into the YOLOv8n backbone network to adaptively extract local coral features, and introduces an efficient multi-scale attention mechanism (EMA) before the detection head to enhance multi-target feature responses and suppress redundant background information, such as... Figure 5 As shown.
[0104] First, drawing inspiration from the design principles of conditional convolution (CondConv) and dynamic convolution (DyConv), we first examine the i-th candidate convolution kernel... Calculate the four types of attention weights, namely spatial dimension attention. Input channel attention Output channel attention Convolutional kernel selection attention A multi-headed, squeeze-excitation (SE-type) attention module is employed. To complete the calculation of the four types of attention mentioned above, the attention weights satisfy the following relationship:
[0105]
[0106] in, This is the input feature map for the ODConv dynamic convolution module. This represents the output feature map of the ODConv dynamic convolution module; n is the number of candidate convolution kernels. For the first One candidate convolutional kernel; , , and They represent the first Attention weights for each candidate convolutional kernel across spatial dimension, input channel dimension, output channel dimension, and kernel selection dimension.
[0107] The core of the EMA module is to achieve efficient and accurate attention calibration through grouping to preserve information, dual-branch feature extraction, and cross-spatial global fusion. First, the input feature map... Divided evenly into channels Group, then reshape the grouped channel dimensions to the batch dimension (original batch size is...). ), and obtain a new tensor . The expression is as follows:
[0108]
[0109] Remodeled The input consists of two parallel branches. One of them passes through 1... 1. Convolution and activation functions generate channel attention weights, and Element-wise multiplication yields short-range dependency features Another one went through 3 The 3-branch architecture captures long-range spatial dependencies by expanding the receptive field, outputting multi-scale features. .
[0110]
[0111] right , Global features are obtained by performing 2D global average pooling respectively. , The final attention weights, Attn, are obtained through further matrix dot product, normalization, and multiplication and summation. The formula for Attn is as follows:
[0112]
[0113] This weight is related to the original input features. Element-wise weighted, i.e. Then Restore the original grouping method to the input. With the same dimensions, it outputs more discriminative feature maps.
[0114] Figure 6 This is a schematic diagram of the structure of an underwater coral bleaching detection system based on an improved YOLO detection method according to an embodiment of the present invention, comprising:
[0115] The calibration and correction module 601 integrates the underwater refraction model and Zhang Zhengyou calibration method to complete the calibration of the binocular camera and the correction of underwater refraction distortion.
[0116] The underwater acquisition module 602 uses a calibrated and corrected binocular camera to acquire underwater images.
[0117] The underwater enhancement module 603 uses multi-scale Retinex to enhance the underwater image;
[0118] The bleaching detection module 604 uses an improved YOLO model to detect underwater coral bleaching.
[0119] The improved YOLO model embeds a dynamic convolutional module between the backbone and neck networks to adaptively extract local coral features, and introduces an efficient multi-scale attention mechanism (EMA) in front of the head to enhance multi-target feature response and suppress redundant background information.
[0120] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention includes: a processor 701 and a memory 702; wherein the memory 702 is used to store computer execution instructions; and the processor 701 is used to execute the computer execution instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant descriptions in the foregoing method embodiments.
[0121] Alternatively, the memory 702 can be either standalone or integrated with the processor 701.
[0122] When the memory 702 is set up independently, the electronic device also includes a bus 703 for connecting the memory 702 and the processor 701.
[0123] This invention also provides a computer storage medium storing computer execution instructions, which, when executed by a processor, implement the method described above.
[0124] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0125] In the embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0126] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0127] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0128] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0129] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0130] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0131] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0132] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0133] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0134] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; 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 or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting underwater coral bleaching based on an improved YOLO detection method, characterized in that, Includes the following steps: The underwater refraction model and Zhang Zhengyou's calibration method were combined to complete the calibration of the binocular camera and the underwater refraction distortion correction. Underwater images were acquired using a calibrated and corrected binocular camera. The underwater image was enhanced using multi-scale Retinex. Using an improved YOLO model for underwater coral bleaching detection; The improved YOLO model embeds a dynamic convolutional module between the backbone and neck networks to adaptively extract local coral features, and introduces an efficient multi-scale attention mechanism (EMA) in front of the head to enhance multi-target feature response and suppress redundant background information.
2. The underwater coral bleaching detection method based on improved YOLO detection according to claim 1, characterized in that, The fusion of the underwater refraction model and Zhang Zhengyou calibration method to complete the calibration and underwater refraction distortion correction of the binocular camera includes the following steps: Radial and tangential distortion corrections were achieved using camera intrinsic parameters, distortion coefficients, and a standard pinhole camera distortion model obtained through Zhang Zhengyou's planar calibration. By combining the underwater refraction model with Zhang Zhengyou's method based on a planar calibration plate, all parameters related to the camera and refraction are jointly optimized.
3. The underwater coral bleaching detection method based on improved YOLO detection according to claim 1, characterized in that, The camera intrinsic parameters, distortion coefficients, and standard pinhole camera distortion model obtained through Zhang Zhengyou's planar calibration are used to correct radial and tangential distortion, including the following steps: Radial distortion correction is performed using the following formula: Tangential distortion is performed using the following formula: in, Let be the radius of curvature, then... , The radial distortion coefficient is... These are the coordinates of the corner point after distortion. These are the correct coordinates of the corner points after distortion correction.
4. The underwater coral bleaching detection method based on improved YOLO detection according to claim 1, characterized in that, The method of combining the underwater refraction model with Zhang Zhengyou's method based on a planar calibration plate to jointly optimize all parameters related to the camera and refraction includes the following steps: The direction of light refraction at the interface of a water-glass-air multilayer medium, calculated using Snell's refraction relation, is expressed as: in, , These represent the refractive indices of water and glass, respectively. , These represent the angles between the light rays on the water side and the glass side and the interface normal, respectively. , These represent the direction vectors of light rays in the water and glass media, respectively; , () represents the coordinates of the light ray on the virtual imaging plane after refraction. and These represent the coordinates of the refraction points on the water side and the glass side, respectively. The mapping relationship between virtual image points and image pixels is calculated and expressed as: in, , , , For camera internal parameters; and These are the equivalent focal lengths in the horizontal and vertical directions of the image, respectively. and , respectively, are the pixel coordinates of the principal point in the horizontal and vertical directions of the image; u and v are the final image pixel coordinates; Establish a minimum reprojection error objective function and jointly optimize all camera and refraction-related parameters: in, The parameter vector to be optimized includes camera intrinsic parameters, camera extrinsic parameters, distortion parameters, and refractive index. For the refraction projection function, based on the current parameters To make the corner points in the world coordinate system Projecting onto the image plane yields the predicted pixel coordinates; It is the first one on the calibration board. The world coordinates of each corner point It is the first one actually detected Image pixel coordinates of each corner point; The The calculation process is as follows: First, based on the camera's extrinsic parameters, the corner points of the calibration plate in the world coordinate system are... Transform to the camera coordinate system to determine the direction of the incident light ray; then calculate the refraction direction of the light ray at the water-glass-air multi-layer medium interface according to the Snell refraction relationship shown in equations (5) and (6); then obtain the coordinates on the virtual imaging plane according to the refracted light ray path; finally, map the virtual imaging point to the image pixel coordinates according to equation (7) to obtain the predicted pixel coordinates; the objective function minimizes the predicted pixel coordinates. Compared with the actual detected pixel coordinates By reducing the reprojection error between parameters, joint optimization of camera parameters and refraction-related parameters can be achieved.
5. The underwater coral bleaching detection method based on improved YOLO detection according to claim 1, characterized in that, The underwater image enhancement using multi-scale Retinex includes the following steps: Median filtering is used by defining a sliding window around each pixel, sorting the gray values of all pixels within the window, and replacing the original value of the center pixel with the median value. Histogram equalization is used to redistribute the pixel gray values of the image. The red, green and blue color channels of the contrast-stretched image are separated, the red channel with the most severe attenuation is enhanced independently, and then the three channels are merged back together. A blurred version of the image is obtained by applying a Gaussian weighted average to the merged image using a Gaussian filter. Subtracting this blurred version of the image from the original image yields high-frequency details representing edges and textures; Finally, the high-frequency details are added back to the original image with a certain weight, thereby achieving sharpening.
6. The underwater coral bleaching detection method based on improved YOLO detection according to claim 1, characterized in that, The dynamic convolution module's internal calculation process includes the following steps: For the i-th candidate convolution kernel Calculate four types of attention weights, including spatial dimension attention weights. Input channel attention weights Output channel attention weights And convolution kernel selection attention weights ; The output feature map is calculated using four types of attention weights, and is represented as follows: in, This is the input feature map for the ODConv dynamic convolution module. This represents the output feature map of the ODConv dynamic convolution module; n is the number of candidate convolution kernels. For the first There are 10 candidate convolution kernels.
7. The underwater coral bleaching detection method based on improved YOLO detection according to claim 1, characterized in that, The EMA efficient multi-scale attention mechanism includes the following internal computation process: First, the input feature map Divided evenly into channels Group the data, then reshape the channel dimensions of the grouped data into the batch dimension to obtain a new tensor. , represented as: The input consists of two parallel branches, one of which passes through 1...
1. Convolution and activation functions generate channel attention weights, and Element-wise multiplication yields short-range dependency features Another one went through 3 The 3-branch architecture captures long-range spatial dependencies by expanding the receptive field, outputting multi-scale features. ; respectively represented as: right and Global features are obtained by performing 2D global average pooling respectively. and The final attention weights are obtained through further matrix dot product, normalization, and multiplication and summation. , represented as: The final attention weight Input features after grouping and reshaping By weighting each element, we get Then Restore the original grouping method to the input feature map. The same dimensions yield the output feature map. .
8. An underwater coral bleaching detection system based on an improved YOLO detection method, characterized in that, include: The calibration and correction module integrates the underwater refraction model and Zhang Zhengyou's calibration method to complete the calibration of the binocular camera and the correction of underwater refraction distortion. The underwater acquisition module uses a calibrated and corrected binocular camera to acquire underwater images. The underwater enhancement module uses multi-scale Retinex to enhance the underwater image; The bleaching detection module uses an improved YOLO model to detect underwater coral bleaching. The improved YOLO model embeds a dynamic convolutional module between the backbone and neck networks to adaptively extract local coral features, and introduces an efficient multi-scale attention mechanism (EMA) in front of the head to enhance multi-target feature response and suppress redundant background information.
9. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.
