A marine biofouling detection method, storage medium and endoscope system

CN122597965APending Publication Date: 2026-08-18CHINA SHIPBUILDING INDUSTRY CORPORATION NO725 RESEARCH INSTITUTE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610722329.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-25
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]传统检测方式通常由潜水员目视观察或采用常规内窥镜拍照,后期人工判别种类并估算面积,存在人工效率低、主观性强、精度差、水下环境适应性弱、系统集成度低等问题,难以实现自动化、实时化、高精度的污损检测与量化

Benefits of technology

[0020] Compared with existing technologies, the marine biofouling detection method, storage medium, and endoscope system described in this embodiment of the invention have the following beneficial effects: 1) By using the multi-scale adaptive gain MSRCR algorithm, LAB channel processing, and bilateral filtering, the interference of seawater turbidity, color cast, weak light, and noise is effectively overcome, resulting in stable image enhancement and highlighting the edge and texture features of the biofouling; 2) The improved YOLOv8 model, combined with the C2f module, ECA attention, PAN-FPN, CIoU, and Anchor-Free, achieves high detection accuracy for small and irregular targets and strong anti-interference ability. After testing, the average precision reaches 89.6%, recall rate 88.3%, and accuracy rate 90.1%; 3) Through ROI extraction, Canny edge detection, contour filling, pixel statistics, and camera calibration, automated and high-precision area quantization is achieved, with an average area calculation error of only 3.2% and an RMSE of 28.5.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597965A_ABST
    Figure CN122597965A_ABST
Patent Text Reader

Abstract

This invention provides a method, storage medium, and endoscope system for detecting marine biofouling. The method includes: S1, acquiring raw image data of a surface containing marine biofouling in situ underwater; S2, enhancing the raw image data using a modified Retinex algorithm to obtain an enhanced image; S3, inputting the enhanced image into a trained target detection neural network model to identify the category and location of marine biofouling targets in the image; and S4, extracting the contours of the located biofouling targets and calculating the corresponding actual physical area of ​​the biofouling. This invention uses the modified Retinex algorithm to suppress image degradation caused by water scattering, color shift, and noise, restoring the texture, contour, and color features of the biofouling targets and obtaining clear features, providing high-quality image input for subsequent target detection; achieving in-situ, real-time, intelligent, and accurate underwater detection of marine biofouling, effectively improving detection efficiency and quantification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of underwater detection technology, and more specifically, to a method for detecting marine biofouling, a storage medium, and an endoscope system. Background Technology

[0002] The adhesion of fouling organisms such as barnacles, algae, and tube worms increases the surface roughness of ship hulls, raises water resistance, and severely affects the ship's navigation performance and fuel efficiency. It also accelerates localized corrosion of the hull metal, shortens the ship's maintenance cycle and service life, causing huge economic losses to the global shipping industry. Accurate and efficient in-situ monitoring of underwater fouling organisms is crucial for evaluating the performance of antifouling coatings and developing scientific cleaning and maintenance strategies.

[0003] Traditional detection methods typically involve divers visually observing or taking photos with conventional endoscopes, followed by manual identification of the type and estimation of the area. This approach suffers from problems such as low efficiency, high subjectivity, poor accuracy, weak adaptability to underwater environments, and low system integration, making it difficult to achieve automated, real-time, and high-precision detection and quantification of contamination. Summary of the Invention

[0004] The problem addressed by this invention is how to detect fouling organisms in confined spaces such as subsea pipelines.

[0005] To address the above problems, this invention provides a method for detecting marine biofouling, applicable to the surface of ships, offshore platforms, or underwater pipelines, comprising:

[0006] S1. Underwater in-situ acquisition of raw image data of marine biofouling on the surface to be tested;

[0007] S2. The original image data is enhanced using the improved Retinex algorithm to obtain an enhanced image;

[0008] S3. Input the enhanced image into a trained target detection neural network model to identify the category of marine biofouling targets in the image and locate their positions;

[0009] S4. Based on the location of the soiled target, extract its outline and calculate the corresponding actual soiled physical area.

[0010] Preferably, step S1 includes: simultaneously acquiring the pose, depth, and / or position data of the acquisition end while acquiring the original image data; associating the pose, depth, and / or position data with the corresponding original image data for subsequent image stitching, smudged area location, and area conversion.

[0011] Preferably, the Retinex enhancement algorithm in step S2 involves converting the original image from the RGB color space to the LAB color space; performing Retinex enhancement on the luminance channel, using bilateral filtering to estimate the illuminance component to smooth water noise and preserve edge details of the polluted target; performing adaptive compensation on the chrominance channel to restore the true color features of the underwater image; and adaptively adjusting the enhancement parameters according to the water turbidity and color deviation angle.

[0012] Preferably, the target detection neural network model in step S3 is an improved YOLOv8 model that uses an improved C2f module as the basic module of the backbone network and embeds an ECA attention mechanism module in the backbone network.

[0013] Preferably, the improved YOLOv8 model further includes: using a PAN-FPN structure for high- and low-level feature fusion, and using a CIoU loss function to improve the bounding box regression accuracy.

[0014] Preferably, the improved YOLOv8 model uses an anchor-free detection head to directly predict the target category, bounding box coordinates, and confidence level.

[0015] Preferably, the improved YOLOv8 model is trained using marine biofouling images from Qingdao, Xiamen, and Sanya sea areas with different seasons, attachment densities, lighting conditions, and turbidity. The dataset contains 1200 images with a uniform resolution of 640×640. The dataset is divided into training, validation, and test sets in an 8:1:1 ratio. The LabelImg tool is used to annotate the biofouling target categories and bounding boxes.

[0016] Preferably, step S4 specifically includes:

[0017] S41. Obtain the target contaminated ROI region based on the positioning result; S42. Perform grayscale processing on the target contaminated ROI region and use Gaussian filtering for noise reduction; S43. Use the Canny operator to perform edge detection on the denoised image and extract the contour of the contaminated target; S44. Fill the extracted closed contour and generate a binary mask of the contaminated region; S45. Count the number of pixels representing the contaminated region in the binary mask and obtain the pixel area. Based on the pre-calibrated pixel-to-actual physical size conversion relationship, convert the pixel area into the actual physical area.

[0018] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the marine biofouling detection method as described above.

[0019] The present invention also provides an endoscope system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the marine biofouling detection method as described above.

[0020] Compared with existing technologies, the marine biofouling detection method, storage medium, and endoscope system described in this embodiment of the invention have the following beneficial effects: 1) By using the multi-scale adaptive gain MSRCR algorithm, LAB channel processing, and bilateral filtering, the interference of seawater turbidity, color cast, weak light, and noise is effectively overcome, resulting in stable image enhancement and highlighting the edge and texture features of the biofouling; 2) The improved YOLOv8 model, combined with the C2f module, ECA attention, PAN-FPN, CIoU, and Anchor-Free, achieves high detection accuracy for small and irregular targets and strong anti-interference ability. After testing, the average precision reaches 89.6%, recall rate 88.3%, and accuracy rate 90.1%; 3) Through ROI extraction, Canny edge detection, contour filling, pixel statistics, and camera calibration, automated and high-precision area quantization is achieved, with an average area calculation error of only 3.2% and an RMSE of 28.5. Attached Figure Description

[0021] Figure 1 This is an overall structural diagram of the endoscope system described in an embodiment of the present invention;

[0022] Figure 2 This is a schematic diagram of the frame of the endoscope system described in an embodiment of the present invention;

[0023] Figure 3 This is a schematic flowchart of the marine biofouling detection method described in an embodiment of the present invention.

[0024] Explanation of reference numerals in the attached figures:

[0025] 1-Underwater endoscope probe; 11-Underwater image acquisition unit; 12-Attitude and positioning unit; 13-Probe control unit; 14-Flexible probe rod; 2-Surface control terminal; 21-Control module; 22-Data receiving module; 23-Power supply module; 3-Data transmission module; 31-Wired transmission unit; 32-Wireless transmission unit; 4-Visual recognition and area statistics module; 41-Image preprocessing unit; 42-Dirty identification unit; 43-Area statistics unit; 5-Display and storage module; 51-Display unit; 52-Storage unit. Detailed Implementation

[0026] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Without conflict, the technical features of the embodiments of the present invention can be combined with each other.

[0027] Biofouling on underwater ship surfaces, such as the hull and propeller, is a long-standing critical problem for the shipping industry. The attachment of fouling organisms, such as barnacles, algae, and tube worms, increases surface roughness, raises water resistance, and accelerates metal corrosion, causing billions of dollars in economic losses to the global shipping industry annually. Traditional methods involve divers carrying cameras or visually observing the fouling, or photographing the fouling using traditional industrial endoscopes, followed by manual identification of the type of fouling and calculation of the area. This approach suffers from low efficiency and poor adaptability to underwater visual inspection environments. Therefore, the applicant proposes the following technical solution:

[0028] Example 1

[0029] like Figure 1-3 As shown, this invention provides a method for detecting marine biofouling, applicable to the surface of ships, offshore platforms, or underwater pipelines, comprising:

[0030] S1. Underwater in-situ acquisition of raw image data of marine biofouling on the surface to be tested;

[0031] S2. The original image data is enhanced using the improved Retinex algorithm to obtain an enhanced image;

[0032] S3. Input the enhanced image into a trained target detection neural network model to identify the category of marine biofouling targets in the image and locate their positions;

[0033] S4. Based on the location of the soiled target, extract its outline and calculate the corresponding actual soiled physical area.

[0034] This invention uses an improved Retinex algorithm to suppress image degradation caused by water scattering, color shift, and noise, restoring the texture, contour, and color features of fouled targets. This ensures clear features are obtained even in turbid, low-light, and color-shifted waters, providing high-quality image input for subsequent target detection. It enables in-situ, real-time, intelligent, and accurate underwater detection of marine biofouling, effectively improving detection efficiency and quantification accuracy.

[0035] As a preferred example of the present invention, step S1 further includes: simultaneously acquiring the pose, depth and / or position data of the acquisition end while acquiring the original image data; associating the pose, depth and / or position data with the corresponding original image data for subsequent image stitching, smudged area location and area conversion.

[0036] This setup enables precise location and spatial marking of fouled areas, facilitating re-inspection and targeted removal of fouled areas; automatic image stitching based on multi-frame images and spatial information enables large-scale, continuous detection of marine facility surfaces; and distortion correction of area calculations by combining attitude and depth data significantly improves the accuracy of quantitative conversion of fouled areas.

[0037] As a preferred example of the present invention, the Retinex improvement algorithm in step S2 is to convert the original image from the RGB color space to the LAB color space; perform Retinex enhancement on the luminance channel, use bilateral filtering to estimate the illuminance component to smooth water noise and preserve the edge details of the polluted target; perform adaptive compensation on the chrominance channel to restore the true color features of the underwater image; and adaptively adjust the enhancement parameters according to the water turbidity and color deviation angle.

[0038] This setup achieves brightness enhancement and color restoration without interference by converting images to the LAB color space and processing them in separate channels. It employs bilateral filtering to estimate illuminance components, effectively preserving edge details of contaminated targets while smoothing water noise and fogging interference, thus avoiding edge blurring. The enhancement parameters are adaptively adjusted based on water turbidity and color cast angle, making it suitable for various complex underwater environments such as nearshore high turbidity, offshore blue tint, and deep-water low light. It accurately restores the color and texture features of contaminated targets, providing a high-quality image foundation for subsequent contamination identification and area statistics.

[0039] Specifically, the brightness of the supplementary lighting group is adjusted based on the underwater environment in the early stage. After the endoscope probe captures images, the turbidity and color cast of the water are evaluated in combination with data collected by the underwater positioning unit. The enhanced image is then output based on the multi-scale adaptive gain Retinex (MSRCR) algorithm. This algorithm uses bilateral filtering instead of the traditional Gaussian filtering of MSR. When estimating the illuminance component, it can effectively smooth water noise and fogging interference while preserving the edge details of the fouled target, avoiding the edge blurring caused by Gaussian filtering. It is especially suitable for fouled targets with obvious edge features, such as barnacles and mussels. The original underwater color image is converted from the RGB color space to the LAB color space. The luminance channel (L channel) is enhanced by Retinex, and the scale weight is dynamically adjusted to achieve dynamic range compression and detail enhancement. Adaptive compensation is performed on the chrominance channels (A channel and B channel). Overall, it can eliminate fogging and enhance details in nearshore turbid waters, compensate for red light and restore colors in farshore bluish waters, and balance brightness and suppress noise in deep waters with low light, thereby restoring the true colors of the fouled targets and making the output enhanced images highlight the edges and corners of the fouled organisms, texture features, contour intersections and color abrupt changes.

[0040] As a preferred example of the present invention, the target detection neural network model in step S3 is an improved YOLOv8 model that uses an improved C2f module as the basic module of the backbone network and embeds an ECA attention mechanism module in the backbone network to enhance the extraction of texture and contour features of the contaminated target.

[0041] This setup enhances the depth and efficiency of feature extraction through an improved C2f module, enabling more thorough learning of the color, texture, shape, and edge features of contaminated targets. Simultaneously, the ECA attention mechanism strengthens the extraction of key texture and contour features, suppresses underwater interference such as water noise and suspended matter, and improves detection accuracy. It also enhances the model's ability to identify small targets, such as juvenile barnacles and scattered mussels, reducing the false negative rate.

[0042] Preferably, the improved YOLOv8 model further includes: employing a PAN-FPN structure for high- and low-level feature fusion, and using a CIoU loss function to improve the bounding box regression accuracy. This setup uses high-level semantic features to identify categories and low-level detail features to accurately locate targets, ensuring stable detection of large targets, small targets, and targets with blurred edges; the bounding boxes more closely resemble the real contours; the CIoU loss function considers overlapping area, center point distance, and aspect ratio, making the detection boxes more accurate, tighter, and more closely match the actual shape of the dirt.

[0043] Specifically, the extracted features are fed into the intermediate feature fusion network (Neck) for further feature extraction and fusion. The feature fusion network retains the PAN-FPN feature fusion structure and achieves full fusion of high and low layer features through upsampling, downsampling and skip connections. High-level semantic features are used for dirt category identification, and shallow-level detail features are used for accurate target bounding box localization, adapting to the detection needs of dirt targets of different sizes.

[0044] Preferably, the improved YOLOv8 model uses an anchor-free detection head to directly predict the target category, bounding box coordinates, and confidence level. This setting can directly predict the target category, bounding box coordinates, and confidence level without manually presetting anchor box parameters, avoiding missed detections and positioning errors caused by mismatch between the anchor box and the underwater fouling target; the bounding box prediction is more flexible and the positioning is more accurate, especially suitable for marine fouling targets with irregular shapes and large differences in size; at the same time, it reduces the model's computational load, improves the detection speed, and meets the needs of underwater in-situ real-time detection.

[0045] To further improve the accuracy and robustness of anchorless bounding box detection, the model training was optimized: Considering the characteristics of underwater fouled images such as color cast, uneven lighting, and variable turbidity, data augmentation strategies using Mosaic, MixUp, and HSV tone perturbation were employed to expand the dataset, enhancing the model's generalization ability in complex underwater environments. Simultaneously, a dynamic label assignment strategy was used to assign the optimal predicted bounding box to each real fouled target, further improving detection accuracy. This setup enables the model to maintain high detection accuracy and strong generalization ability even in underwater scenarios with color cast, uneven lighting, and variable target shapes.

[0046] As a preferred example of the present invention, the improved YOLOv8 model is trained using marine biofouling images from the waters of Qingdao, Xiamen, and Sanya with different seasons, attachment densities, lighting conditions, and turbidity. The dataset contains 1200 images with a uniform resolution of 640×640. The dataset is divided into training, validation, and test sets in an 8:1:1 ratio. The LabelImg tool is used to annotate the biofouling target categories and bounding boxes, and the model is trained based on the annotated dataset.

[0047] The accuracy of the improved YOLOv8 model was verified. The Retinex enhancement parameters were adaptively adjusted according to the water type. The model training parameters were set as follows: 100 iterations, 0.001 learning rate, and 16 batch size. Testing showed that the improved YOLOv8 model described in this invention achieved an average precision of 89.6%, a recall of 88.3%, and a precision of 90.1%, demonstrating excellent recognition accuracy and reliability. It should be noted that the soiled images need to cover a variety of different scenes to fully verify the generalization ability of the method in complex underwater environments. Furthermore, an 8:1:1 ratio was used to divide the training, validation, and test sets, and the target categories included barnacles, mussels, seaweed, and calcareous worms, ensuring the objectivity of the training, validation, and testing.

[0048] As a preferred example of the present invention, step S4 specifically includes: S41, obtaining the target soiled ROI region based on the positioning result; S42, performing grayscale processing on the target soiled ROI region and using Gaussian filtering for noise reduction; S43, using the Canny operator to perform edge detection on the denoised image and extract the contour of the soiled target; S44, performing filling processing on the extracted closed contour and generating a binary mask of the soiled region; S45, counting the number of pixels representing the soiled region in the binary mask and obtaining the pixel area, and converting the pixel area into the actual physical area according to the pre-calibrated pixel-to-actual physical size conversion relationship of the camera.

[0049] This setup first extracts the fouled ROI region, effectively narrowing the calculation range and eliminating background interference; then, it improves edge detection quality through grayscale conversion and Gaussian filtering for noise reduction; finally, it utilizes the Canny operator to accurately extract the fouled contour; and then generates a binary mask through contour filling to clearly distinguish the fouled area from the background. Finally, based on pixel statistics and camera calibration conversion, it achieves automated, high-precision, and standardized quantification of the actual physical area of ​​marine biofouling. The area statistics results are accurate, stable, and have good repeatability, meeting the quantitative assessment needs of marine engineering inspection.

[0050] Specifically, an improved YOLOv8 model is used to identify and locate typical fouling organisms such as barnacles, mussels, and seaweed in the image, obtaining the target fouled ROI region. The colored ROI region is converted into a grayscale image. Gaussian filtering is used to denoise the grayscale image, smoothing residual water noise and image artifacts, and avoiding noise interference with edge detection accuracy. After accurate edge detection using the Canny operator, the findContours function in OpenCV is used to find the contours obtained by Canny edge detection, filtering out noise contours with too small an area. The drawContours function is used to fill the closed contours, generating a binary mask of the fouled area. The white area in the mask represents the fouled target, and the black area represents the background. The countNonZero function is used to count the total number of white pixels in the binary mask, which is the pixel area of ​​a single fouled target. The pixel areas of all fouled targets are summed to obtain the total fouled pixel area. The conversion relationship between pixels and actual physical size is obtained through camera calibration, and the total fouled pixel area is converted into the actual physical area.

[0051] As an example of this invention, the Canny operator for precise edge detection includes: locating the boundary between the contaminant and the background through gradient calculation, then refining the edge through non-maximum suppression to retain the clearest contour line, and finally filtering out false edges and retaining the true contaminant contour through dual threshold filtering, thereby outputting a binary image containing only clear contaminant edge lines. This setting can effectively filter out false edges and output clear and realistic contaminant contours, improving the accuracy of area statistics, and has advantages such as accurate positioning, fine edges, and strong anti-interference. Experimental verification shows that, based on the actual area manually annotated by LabelImg, using the Canny operator with dual thresholds of 50 / 150 for area statistics, the average area calculation error is 3.2%, and the root mean square error (RMSE) is 28.5, indicating that the edge detection and area quantization method has high accuracy and good stability.

[0052] As an example of the present invention, before step S1, the method further includes: S0, system deployment and adjustment: deploying the underwater image acquisition terminal near the surface to be detected; monitoring the underwater image quality in real time, and dynamically adjusting the brightness of the supplementary light, the shooting angle and / or the camera parameters.

[0053] This setup allows for flexible placement of the underwater image acquisition unit near the surface to be inspected, and optimizes the brightness of the supplementary lighting, shooting angle, and camera parameters in real time according to the actual underwater environment. This ensures the quality of underwater image acquisition from the source and effectively adapts to complex underwater environments such as high turbidity, low light, and color cast. At the same time, it expands the field of view, eliminates blind spots, reduces the difficulty of manual operation, improves overall inspection efficiency and operational safety, and provides a high-quality raw image foundation for subsequent image enhancement, damage identification, and area statistics.

[0054] As an example of the present invention, the marine biofouling detection method further includes: S5, result output: displaying the original image in real time or in playback, as well as the recognition result image superimposed with information on the type of biofouling, the location box, and the area of ​​biofouling, and storing and exporting the images, videos, and detection data. This setting can display the detection image superimposed with information on the type of biofouling, the location box, and the area in real time or in playback, intuitively presenting the detection results and facilitating rapid on-site judgment and decision-making.

[0055] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the marine biofouling detection method as described above.

[0056] The present invention also provides an endoscope system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the marine biofouling detection method as described above.

[0057] As an example of the present invention, the endoscope system includes an underwater endoscope probe 1, a surface control terminal 2, a data transmission module 3, a visual recognition and area statistics module 4, and a display and storage module 5. The underwater endoscope probe 1 is the front-end acquisition unit of the system and can be directly immersed in the seawater environment. It consists of an underwater image acquisition unit 11, a probe control unit 13, and a flexible probe rod 14. The underwater image acquisition unit 11 consists of a high-definition industrial camera, a wide-angle optical lens, an underwater supplementary light group, and an optical window. The probe control unit 13 has a built-in microcontroller that controls the brightness of the supplementary light, camera parameters, and attitude data acquisition. It also communicates with the surface control terminal 2 through the data transmission module 3 to receive control commands. The flexible probe rod 14 is bendable and its length can be customized to adapt to different detection scenarios. At the same time, the probe head can achieve 360° rotation and 90° bending adjustment to expand the detection field of view.

[0058] As an example of the present invention, the high-definition industrial camera has a resolution of not less than 4K and a frame rate of ≥30fps, and can capture clear images of underwater marine organism fouling. The underwater supplementary lighting group adopts a uniform surface light source design with adjustable brightness to adapt to different water conditions. The optical window is made of high light transmittance and seawater corrosion resistant material with an internal coating to reduce marine organism attachment and water refraction interference.

[0059] As a preferred example of the present invention, the underwater endoscope probe 1 further includes an attitude and positioning unit 12, which includes a three-axis gyroscope, an accelerometer, a depth sensor and an underwater acoustic positioning module, and can collect the probe's attitude angle, depth and underwater position coordinates in real time, providing spatial reference for image stitching and positioning of contaminated areas.

[0060] The underwater control terminal 2, serving as the system's operation and control core, adopts a portable design and incorporates a high-performance processor. It comprises a control module 21, a data receiving module 22, and a power supply module 23. The control module 21 primarily provides a human-machine interface, enabling remote control of the underwater endoscope probe's rotation, pitch, supplementary lighting brightness, and camera parameter adjustment, achieving precise control during the detection process. The data receiving module 22 mainly receives image data, attitude, and positioning data collected by the underwater probe through a data transmission module, performing preliminary caching and preprocessing. The power supply module 23 is a lithium battery with a runtime of ≥8 hours, capable of powering the underwater endoscope probe 1, control terminal 21, and data receiving module 22, meeting the needs of field operations.

[0061] The data transmission module 3 uses a special optical fiber that is waterproof, tensile-resistant, and resistant to seawater corrosion to ensure real-time, delay-free transmission of high-definition images acquired by the underwater endoscope probe 1 to the surface control terminal 2.

[0062] The visual recognition and area statistics module 4 includes an image processing unit 41, a soiling recognition unit 42, and an area statistics unit 43. The display and storage module 5 includes a display unit 51 and a storage unit 52. The display unit 51 uses a high-definition touch screen to display the original underwater images, soiling recognition results (labeling soiling type and area), and soiling area statistics in real time. The storage unit 52 is used to store high-definition images, videos, recognition results, and area statistics, and supports USB data export for easy later analysis and traceability.

[0063] Example 2

[0064] A method for detecting marine biofouling on a ship's hull, comprising:

[0065] S1. Underwater in-situ acquisition of raw image data of marine biofouling on the surface to be tested;

[0066] The underwater endoscope probe 1 is placed on the outside of the ship's hull via a flexible probe rod 14. The surface control terminal 2 is placed on the ship's deck and connected to the underwater endoscope probe 1 via a wired transmission module 3. The power supply module 23 turns on the system power supply. The underwater endoscope probe 1 is rotated and tilted by the surface control terminal 2. The brightness of the supplementary light is adjusted in real time according to the underwater turbidity observed by the endoscope. The target observation area on the ship's surface is observed and high-definition underwater images are collected. At the same time, the attitude and positioning unit collects the probe's attitude, depth and position data in real time, providing criteria for the multi-scale adaptive gain Retinex (MSRCR) algorithm in the visual recognition and area statistics module 4.

[0067] S2. The original image data is enhanced using the improved Retinex algorithm to obtain an enhanced image;

[0068] The visual recognition and area statistics module 4 enhances the acquired images based on the improved Retinex algorithm, eliminating image degradation caused by underwater water scattering, color shift, and noise, restoring the texture, contour, and color features of the contaminated targets, and highlighting the edge corners, texture feature points, contour intersections, and color abrupt change points of the contaminated organisms in the output enhanced image.

[0069] S3. Input the enhanced image into a trained target detection neural network model to identify the category of marine biofouling targets in the image and locate their positions;

[0070] This paper describes an improved YOLOv8 deep learning model for identifying soiling types by enhancing image input. The improved C2f module in the main network effectively increases the depth and efficiency of feature extraction, such as color, texture, shape, and edge direction. The ECA attention mechanism strengthens the extraction of texture and contour features of soiled targets, improving the model's ability to identify small targets such as juvenile barnacles and scattered mussels. The intermediate feature fusion network further extracts and fuses features to achieve full fusion of high and low layer features. High-level semantic features are used for soiling type identification, while shallow-level detail features are used for accurate target bounding box localization, adapting to the detection needs of soiled targets of different sizes. Finally, the anchor-free detection head directly predicts the target's category probability, bounding box coordinates, and confidence. The model can automatically identify soiling types such as barnacles, oysters, and seaweed in images, accurately locate soiled areas, and label them.

[0071] S4. Based on the location of the soiled target, extract its outline and calculate the corresponding actual soiled physical area.

[0072] The YOLOv8 target detection model is used to identify and locate typical fouling organisms such as barnacles, mussels, and seaweed in the image and obtain the target fouling ROI region. The colored ROI region is converted into a grayscale image. A 3×3 Gaussian filter is used to denoise the grayscale image, smoothing residual water noise and image artifacts, and avoiding noise interference with edge detection accuracy. After accurate edge detection using the Canny operator, the closed contour is filled to generate a binary mask of the fouling area. The white area in the mask is the fouling target, and the black area is the background. The total number of white pixels in the binary mask is counted. The pixel area of ​​all fouling targets is accumulated to obtain the total fouling pixel area. The conversion relationship between pixels and actual physical size is obtained through camera calibration, and the total fouling pixel area is converted into the actual physical area. At the same time, the display unit 5 displays the fouling type, distribution, and fouling area in real time. The average processing speed is 28.3 frames / second. The storage unit automatically stores the images, videos, and data to complete the ship hull fouling detection.

[0073] This application effectively overcomes problems such as seawater turbidity, uneven lighting, and water refraction by improving the Retinex algorithm and supplementing the lighting design, ensuring the stability of image quality in complex underwater environments. Furthermore, by improving the YOLOv8 model and using the Canny operator, it identifies biofouling types and calculates the area of ​​biofouling, providing a scientific basis for decision-making on prevention and removal of biofouling.

[0074] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.

Claims

1. A method for detecting marine biofouling, used on the surface of ships, offshore platforms, or underwater pipelines, characterized in that, include: S1. Acquire raw image data in situ underwater; S2. The original image data is enhanced using the improved Retinex algorithm to obtain an enhanced image; S3. Input the enhanced image into a trained target detection neural network model to identify the category of the smudged target in the image and locate its position; S4. Based on the location of the contaminated target, extract its outline and calculate the corresponding actual physical area of ​​contamination.

2. The method for detecting marine biofouling according to claim 1, characterized in that, Step S1 further includes: simultaneously acquiring the pose, depth, and / or position data of the acquisition end while acquiring the original image data; associating the pose, depth, and / or position data with the corresponding original image data for subsequent image stitching, smudged area location, and area conversion.

3. The method for detecting marine biofouling according to claim 1, characterized in that, The Retinex improvement algorithm described in step S2 is to convert the original image from the RGB color space to the LAB color space; to perform Retinex enhancement on the luminance channel, and to use bilateral filtering to estimate the illuminance component in order to smooth water noise and preserve the edge details of the polluted target; to perform adaptive compensation on the chrominance channel to restore the true color features of the underwater image, and to adaptively adjust its enhancement parameters according to the turbidity of the water and the color deviation angle.

4. The method for detecting marine biofouling according to claim 1, characterized in that, The target detection neural network model mentioned in step S3 is an improved YOLOv8 model that uses an improved C2f module as the basic module of the backbone network and embeds an ECA attention mechanism module in the backbone network.

5. The method for detecting marine biofouling according to claim 4, characterized in that, The improved YOLOv8 model also includes: using a PAN-FPN structure for high- and low-level feature fusion, and using the CIoU loss function to improve the accuracy of bounding box regression.

6. The method for detecting marine biofouling according to claim 5, characterized in that, The improved YOLOv8 model uses an anchor-free detection head to directly predict the target category, bounding box coordinates, and confidence level.

7. The method for detecting marine biofouling according to claim 1, characterized in that, Step S4 specifically includes: S41. Obtain the target contaminated ROI region based on the positioning result; S42. Perform grayscale processing on the target contaminated ROI region and use Gaussian filtering for noise reduction; S43. Use the Canny operator to perform edge detection on the denoised image and extract the contour of the contaminated target; S44. Fill the extracted closed contour and generate a binary mask of the contaminated region; S45. Count the number of pixels representing the contaminated region in the binary mask and obtain the pixel area. Based on the pre-calibrated pixel-to-actual physical size conversion relationship, convert the pixel area into the actual physical area.

8. The method for detecting marine biofouling according to claim 1, characterized in that, Before step S1, the method further includes: deploying the underwater image acquisition terminal near the surface to be inspected; monitoring the underwater image quality in real time; and dynamically adjusting the brightness of the supplementary light, the shooting angle, and / or the camera parameters.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the marine biofouling detection method as described in any one of claims 1-8.

10. An endoscope system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the marine biofouling detection method as described in any one of claims 1-8.