Shipborne radar oil spill detection method and system based on improved whale optimization algorithm
By improving the salient feature extraction and segmentation techniques of the whale optimization algorithm, the false detection problem in shipborne radar oil spill detection was solved, achieving efficient and accurate oil spill area identification, which is applicable to the detection of different sea conditions and oil spill types.
Patent Information
- Application Number
- CN202511518485.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Existing shipborne radar is susceptible to interference from waves and wind fields in oil spill detection, resulting in a high false detection rate and making it difficult to achieve rapid and accurate oil spill detection.
An improved whale optimization algorithm is adopted. By extracting salient features and designing an improved whale optimization algorithm, combined with prey encirclement behavior and spiral bubble net attack, the local search capability is enhanced, the optimal segmentation threshold is obtained and the image is segmented, and the false detection rate is reduced.
It enables efficient and accurate identification of oil slick areas under different sea conditions and oil spill types, enhances the contrast between oil spill targets and background, and reduces the false detection rate.
Smart Images

Figure CN120997486B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing and pattern recognition, and particularly relates to a shipborne radar oil spill detection method and system based on an improved whale optimization algorithm. BACKGROUND
[0002] Marine oil spill accidents cause serious damage to the ecological environment and marine economy, and rapid and accurate oil spill detection is the key to emergency response. Shipborne radar will gradually develop into the core technology in the field of oil spill monitoring due to its all-weather, all-day and large-scale imaging capabilities. However, the contrast between the oil spill area and the marine background in the shipborne radar image is low, and it is disturbed by sea waves, wind fields and the like, and the traditional method is prone to false detection. Therefore, it is urgent to combine advanced image processing technology and intelligent algorithm to improve the detection accuracy. SUMMARY
[0003] In order to solve or alleviate one or more of the above problems, the present application proposes a shipborne radar oil spill detection method and system based on an improved whale optimization algorithm.
[0004] According to an aspect of the present application, a shipborne radar oil spill detection method based on an improved whale optimization algorithm is provided, which comprises the following steps:
[0005] Pretreating the acquired shipborne radar image;
[0006] Extracting the saliency boundary feature of the pretreated image;
[0007] Extracting the ROI image based on the saliency boundary feature;
[0008] Obtaining the optimal segmentation threshold value by using the improved whale optimization algorithm, and segmenting the ROI image by using the optimal segmentation threshold value to obtain the optimal segmentation image;
[0009] Post-processing the optimal segmentation image to obtain the final oil film image.
[0010] Further, the extraction of the saliency boundary feature of the pretreated image comprises:
[0011] Calculating the adaptive threshold value of the image and the median deviation of the image pixel value;
[0012] Calculating the saliency boundary feature of each sliding window based on the adaptive threshold value, including: binarizing the pixel value in each sliding window based on the adaptive threshold value: assigning the pixel value less than the adaptive threshold value as 1, and other values as 0; according to the value of the binarized image, counting the number N of values greater than 1, the number P of boundary pixels and the length L of the window boundary in each sliding window; according to the number N, the number P and the length L, calculating the saliency boundary feature value D of each sliding window according to the following formula:
[0013] ;
[0014] wherein, is the minimum constant.
[0015] Further, the adaptive threshold T of the image and the median deviation of the image pixel value is calculated according to the following formula:
[0016] ;
[0017] wherein, represents the median of the pixel value of the image ; represents the function of taking the median; h represents the scaling factor; k represents the adjustment coefficient for distinguishing noise and signal.
[0018] Further, the extracting the ROI image based on the saliency boundary feature comprises: setting upper and lower threshold values, assigning the image corresponding to the saliency boundary feature between the upper and lower threshold values as 1 and other values as 0 to obtain an ROI mask image; multiplying the ROI mask image with the preprocessed image by point pixels; adding the image after the point pixel multiplication with the image after the ROI mask image is inverted to obtain the ROI image.
[0019] Further, the improvement of the improved whale optimization algorithm comprises:
[0020] The position updating formula for simulating the spiral updating of the humpback whale is:
[0021] ;
[0022] wherein, represents the whale position of the t+1th iteration; represents the distance between the current whale position and the optimal solution ; represents the spiral shape parameter, is a random number in [-1, 1]; a2 represents the spiral coefficient, , t max represents the maximum number of iterations.
[0023] Further, the improvement of the improved whale optimization algorithm further comprises: the fitness function is the inter-class variance with an exponential penalty term, and the formula is as follows:
[0024] ;
[0025] wherein, threshold represents the threshold value of the current iteration, and the value range is 0-255 of the image gray value; s represents an adjustment coefficient; represents the maximum inter-class variance, , This represents the average grayscale value of all pixels belonging to class i in the image. This represents the global mean of all pixels in the image. Let K represent the proportion of samples of class i in the dataset, and K represent the total number of classes.
[0026] Furthermore, the preprocessing of the acquired shipborne radar image includes: transforming the image polar coordinates to Cartesian coordinates, performing noise reduction on the image due to co-frequency interference and suppressing speckle noise, and enhancing the local contrast of the image; the postprocessing of the optimal segmented image includes: eliminating noise speckles in the image and transforming the image Cartesian coordinates to polar coordinates.
[0027] According to another aspect of the present invention, a shipborne radar oil spill detection system based on an improved whale optimization algorithm is proposed. The system is used to implement the aforementioned shipborne radar oil spill detection method based on the improved whale optimization algorithm; the system includes:
[0028] The preprocessing module is configured to preprocess the acquired shipborne radar images in pairs.
[0029] The feature extraction module is configured to extract the saliency boundary ratio feature of the preprocessed image;
[0030] The interest image extraction module is configured to extract ROI images based on saliency boundary ratio features;
[0031] The optimal segmentation module is configured to obtain the optimal segmentation threshold using the improved whale optimization algorithm, and then segment the ROI image using the optimal segmentation threshold to obtain the optimal segmented image.
[0032] The oil film extraction module is configured to post-process the optimal segmented image to obtain the final oil film image.
[0033] According to another aspect of the present invention, a terminal device is proposed, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the shipborne radar oil spill detection method based on the improved whale optimization algorithm as described above.
[0034] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the shipborne radar oil spill detection method based on the improved whale optimization algorithm as described above.
[0035] The beneficial technical effects of this invention are:
[0036] The application provides a shipborne radar oil spill detection method and system based on an improved whale optimization algorithm. BRIEF DESCRIPTION OF DRAWINGS
[0037] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which a few embodiments of the present application are shown by way of illustrative example. In the drawings:
[0038] Figure 1 is a flowchart of a shipborne radar oil spill detection method based on an improved whale optimization algorithm provided by the present application;
[0039] Figure 2 is an example of a preprocessed image in the embodiment of the present application;
[0040] Figure 3 is an example of a saliency boundary feature map in the embodiment of the present application;
[0041] Figure 4 is an example of an ROI mask image in the embodiment of the present application;
[0042] Figure 5 is an example of an image obtained by multiplying the ROI mask image and the preprocessed image in the embodiment of the present application;
[0043] Figure 6 is an example of an ROI image in the embodiment of the present application;
[0044] Figure 7 is an example of an image segmented based on an optimal segmentation threshold in the embodiment of the present application;
[0045] Figure 8 is an example of an image after removing noise spots in the embodiment of the present application;
[0046] Figure 9 is an example of an image after coordinate conversion in the embodiment of the present application;
[0047] Figure 10It is a kind of shipborne radar oil spill detection system based on improved whale optimization algorithm structure schematic diagram provided by the application. DETAILED DESCRIPTION
[0048] The principles and spirits of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present application, and do not limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0049] The present application provides a kind of shipborne radar oil spill detection method and system based on improved whale optimization algorithm, first, by introducing saliency feature extraction, using local contrast, color (or gray scale) distribution and other saliency features, highlight the difference between oil spill area and background;Second, the whale optimization algorithm design is improved, dynamic adjustment convergence factor is introduced, inertia weight is introduced to dynamically adjust the whale moving step according to iteration progress, improve the spiral path formula, enhance local search ability, avoid premature convergence;Also combined with surrounding prey behavior and spiral bubble net attack, improve algorithm diversity.
[0050] The embodiment of the present application provides a kind of shipborne radar oil spill detection method based on improved whale optimization algorithm, as shown in Figure 1 The method comprises the following steps:
[0051] S1, the shipborne radar image obtained is preprocessed;
[0052] S2, the saliency boundary feature of the preprocessed image is extracted;
[0053] S3, ROI image is extracted based on saliency boundary feature;
[0054] S4, the optimal segmentation threshold is obtained by using improved whale optimization algorithm, and the optimal segmentation threshold is used to segment ROI image, to obtain the optimal segmentation image;
[0055] S5, the optimal segmentation image is post-processed to obtain the final oil film image.
[0056] The method starts from S1. In S1, the shipborne radar image obtained is preprocessed.
[0057] According to the embodiment of the present application, first, the original data image of marine radar is converted in coordinate system, i.e. the image polar coordinate is transformed into Cartesian coordinate, and the image is denoised and speckle noise suppressed. The preprocessed image is shown in Figure 2 .
[0058] In S2, a significance-to-boundary ratio (SBR) feature of the pre-processed image is extracted.
[0059] According to the embodiment of the present application, the extraction process comprises:
[0060] S21, an adaptive threshold T of the image and the median deviation of the image pixel value is calculated:
[0061] ;
[0062] wherein, represents the median value of the pixel value of the image ; represents a function for calculating the median value; h is a scaling factor, and in the embodiment, h = 0.6475; k is an adjustment coefficient for distinguishing noise and signal, and in the embodiment, k = 3.
[0063] S22, a significance-to-boundary ratio feature of each sliding window is calculated based on the adaptive threshold T, comprising:
[0064] First, the pixel value in each sliding window is binarized based on the adaptive threshold T:
[0065] ;
[0066] wherein, is the value of the binarized image at coordinates (x, y); represents the pixel value of the image at coordinates .
[0067] Then, the number N of values greater than 1 in each sliding window is counted, and the number P of boundary pixels and the length L of the window boundary are calculated; as an example, the size of the sliding window is 15x15. The calculation formula of the number N is: , and W is the position range of the sliding window in the image.
[0068] If the value of the pixel point is equal to 1, and at least one of the values of the 8 surrounding fields of the pixel point is zero, then the pixel point is a boundary pixel; the calculation formula of the number P of boundary pixels is:
[0069] ;
[0070] In the formula, g and n represent the coordinates of the 8 adjacent neighborhood pixel points of the pixel point . The coordinates of the 8 pixel points can be obtained by shifting ±1 in the horizontal and vertical directions respectively based on .
[0071] The boundary length of the window is the perimeter L of the window outline: , This indicates the side length of a local window.
[0072] Then, based on the quantity N, the number of boundary pixels P, and the boundary length L, the improved saliency boundary ratio feature value D is calculated according to the following formula:
[0073] ;
[0074] in, It is the smallest constant. As an example, =0.001.
[0075] Furthermore, the significance boundary ratio eigenvalue D is linearly normalized:
[0076] ;
[0077] in, and This represents the global extremum of all window fractal dimensions. Window fractal dimension is used to quantify the complexity of boundaries within local regions of an image, and is subsequently used for tasks such as extracting salient boundary ratio features. The extracted salient boundary ratio features are as follows: Figure 3 As shown.
[0078] In S3, ROI images are extracted based on saliency boundary ratio features.
[0079] According to an embodiment of the present invention, firstly, upper and lower thresholds are set, based on the normalized significance boundary ratio eigenvalue D. norm Extract the ROI mask image of the saliency boundary ratio feature region between the upper and lower thresholds:
[0080] ;
[0081] Where 'a' is the lower threshold and 'b' is the upper threshold; for example, 'a' = 0.01 and 'b' = 0.9. The generated ROI mask image is as follows: Figure 4 As shown.
[0082] Then, the ROI mask image is multiplied pixel by pixel with the preprocessed image, such as... Figure 5 As shown; then, the image obtained by multiplying the pixels is added to the inverted image of the ROI mask to obtain the ROI image, as shown. Figure 6 As shown.
[0083] In S4, the improved whale optimization algorithm is used to obtain the optimal segmentation threshold, and the ROI image is segmented using the optimal segmentation threshold to obtain the optimal segmented image.
[0084] According to the embodiment of the present application, at the beginning of the algorithm, initialization is required, the initial positions of N whales are randomly generated, and initial parameters are set, including: a linear decreasing coefficient a, decreasing from 2 to 0 linearly, used for controlling the balance between global and local search; a coefficient vector A, A = 2a r1-a, r1 [0, 1] is a random number; a coefficient vector C, C = 2 r2, r2 [0, 1] is a random number; a spiral shape parameter l, l [-1, 1] is a random number; a spiral constant b, usually taking 1, defining the tightness of the logarithmic spiral; a probability threshold p, usually set to 0.5, used for switching the search strategy.
[0085] In the embodiment of the present application, the spiral constant b is replaced by a spiral coefficient :
[0086] ;
[0087] Wherein, t is the current iteration number, t max is the maximum iteration number. This improvement significantly improves the search efficiency, solution quality and robustness of the algorithm. The spiral coefficient and the linear decreasing coefficient a work together to achieve a better balance between global exploration and local development.
[0088] When performing fitness evaluation, the fitness value of each whale is calculated, and the one with the highest fitness value is determined as the current optimal solution , and then the position of each whale is updated, which specifically includes: for the position of each whale , the search strategy needs to be selected according to the fitness difference value |A| and the probability threshold p, which is divided into three cases: if |A| <1 and r <p: execute surround prey; if |A| <1 and r ≥p: execute spiral update; if |A| ≥1: execute random search; wherein, the parameter r is a randomly generated probability value, r [0, 1].
[0089] When the whale approaches the current optimal solution position by surrounding prey, the position update formula is:
[0090] ;
[0091] Wherein, represents the distance between the current whale position and the optimal solution , , is a coefficient vector.
[0092] When the simulated humpback whale performs spiral update, the position update formula is:
[0093] ;
[0094] Wherein, represents the whale position of the t+1th iteration; represents the distance between the current whale position and the optimal solution , .
[0095] The algorithm termination condition is to reach the maximum iteration number t max , as an example, t max =200; or to meet the convergence condition, as an example, the convergence condition is that the fitness function value remains unchanged for 10 times, and the optimal solution is output.
[0096] The embodiment of the application introduces an exponential penalty term in the fitness function on the basis of Otsu inter-class variance to encourage low threshold value:
[0097] ;
[0098] wherein, represents the fitness function; threshold represents the threshold value currently traversed, which takes the possible value of the image gray level (such as 0 to 255), by dynamically adjusting the weight of the low threshold value, the adaptability and robustness of the threshold segmentation are significantly improved; s represents an adjustment coefficient, as an example, s=3; represents the maximum inter-class variance, and the calculation formula is:
[0099] ;
[0100] wherein, represents the average value of the gray values of all pixels belonging to the i-th class in the image; represents the global mean value; represents the proportion of the i-th class sample in the data set, and the calculation formula is: K is the total number of classes, and the division of K depends on the specific requirements of image segmentation, and is usually divided into foreground and background.
[0101] The improved whale optimization algorithm is used to obtain the optimal segmentation threshold value, and the optimal segmentation threshold value is used to segment the ROI image to obtain the optimal segmentation image, as shown in Figure 7 .
[0102] In S5, the optimal segmentation image is post-processed to obtain the final oil film image.
[0103] According to the embodiment of the application, the post-processing of the optimal segmentation image includes: eliminating noise spots in the image; and further converting the Cartesian coordinates and the polar coordinates. As shown in Figure 8 and 9 .
[0104] The embodiment of the present application also provides a shipborne radar oil spill detection system based on an improved whale optimization algorithm, which is used to realize the shipborne radar oil spill detection method based on the improved whale optimization algorithm. Figure 10 As shown in the figure, the system comprises:
[0105] a preprocessing module 101 configured to preprocess the acquired shipborne radar image;
[0106] a feature extraction module 102 configured to extract a saliency boundary feature of the preprocessed image;
[0107] an interest image extraction module 103 configured to extract an ROI image based on the saliency boundary feature;
[0108] an optimal segmentation module 104 configured to acquire an optimal segmentation threshold by using the improved whale optimization algorithm, and segment the ROI image by using the optimal segmentation threshold to acquire an optimal segmentation image;
[0109] an oil film extraction module 105 configured to post-process the optimal segmentation image to acquire a final oil film image.
[0110] The function of the shipborne radar oil spill detection system based on the improved whale optimization algorithm according to the embodiment of the present application can be described by the shipborne radar oil spill detection method based on the improved whale optimization algorithm, and thus the system embodiment is not described in detail, and reference can be made to the method embodiment above.
[0111] Another embodiment of the present application provides a terminal device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor realizes the shipborne radar oil spill detection method based on the improved whale optimization algorithm when executing the computer program.
[0112] Another embodiment of the present application provides a computer readable storage medium comprising a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the shipborne radar oil spill detection method based on the improved whale optimization algorithm when the computer program runs.
[0113] Although the spirit and principles of the present application have been described with reference to several specific embodiments, it should be understood that the present application is not limited to the disclosed specific embodiments, and the division of aspects does not mean that the features in these aspects cannot be combined for the benefit, and the division is only for the convenience of expression. The present application is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims.
Claims
1. A shipborne radar oil spill detection method based on improved whale optimization algorithm, characterized in that, The method comprises the following steps: preprocessing the obtained shipborne radar image; extracting the saliency boundary feature of the preprocessed image; the method comprises the following steps: calculating an adaptive threshold of the image and the median deviation of the image pixel value; calculating the saliency boundary feature of each sliding window based on the adaptive threshold, which comprises the following steps: binarizing the pixel value in each sliding window based on the adaptive threshold; assigning the pixel value less than the adaptive threshold as 1 and other pixel values as 0; according to the value of the binarized image, counting the number N of values greater than 1, the number P of boundary pixels and the length L of the window boundary in each sliding window; and calculating the saliency boundary feature value D of each sliding window according to the number N, the number P and the length L according to the following formula: ; wherein is the minimum constant; extracting the ROI image based on the saliency boundary feature; obtaining the optimal segmentation threshold by using the improved whale optimization algorithm, and segmenting the ROI image by using the optimal segmentation threshold to obtain the optimal segmentation image; the improvement of the improved whale optimization algorithm comprises the following steps: the position updating formula of simulating the spiral updating of a humpback whale is as follows: ; wherein, denotes the whale position at the t+1 iteration; denotes the distance between the current whale position and the best solution ; denotes the spiral shape parameter, a random number in [-1, 1]; a2denotes the spiral coefficient, , t max denotes the maximum number of iterations; postprocessing the optimal segmentation image to obtain the final oil film image.
2. The shipborne radar oil spill detection method based on improved whale optimization algorithm according to claim 1, characterized in that, The adaptive threshold T of the image and the median deviation of the image pixel value is calculated according to the following formula: ; wherein representing the image the median value of the pixel values of the image; representing the function of taking the median; h represents a scaling factor; k represents an adjustment coefficient for distinguishing between noise and signal.
3. The shipborne radar oil spill detection method based on improved whale optimization algorithm according to claim 1, characterized in that, The method of extracting the ROI image based on the saliency boundary feature comprises the following steps: setting an upper and lower threshold, assigning the image corresponding to the saliency boundary feature between the upper and lower threshold as 1 and other images as 0 to obtain an ROI mask image; multiplying the ROI mask image with the preprocessed image; adding the image obtained by multiplying the point pixels with the image obtained by inverting the ROI mask image to obtain the ROI image.
4. The shipborne radar oil spill detection method based on improved whale optimization algorithm according to claim 1, characterized in that, The improvement of the improved whale optimization algorithm further comprises the following steps: the fitness function is an inter-class variance with an exponential penalty term, and the formula is as follows: ; Wherein, threshold represents the threshold of the current traversal, its value range is image gray value 0-255; s represents the adjustment coefficient; is the maximum inter-class variance, , represents the average value of the gray value of all pixels belonging to the i-th class in the image, represents the global mean value of all pixels in the image, represents the proportion of the i-th class sample in the data set, and K represents the total number of classes.
5. The shipborne radar oil spill detection method based on improved whale optimization algorithm according to claim 1, characterized in that, The preprocessing of the obtained shipborne radar image comprises the following steps: transforming the polar coordinates of the image into Cartesian coordinates, performing same-frequency interference noise reduction and speckle noise suppression on the image, and performing local contrast enhancement on the image; the postprocessing of the optimal segmentation image comprises the following steps: eliminating noise spots in the image, and transforming the Cartesian coordinates of the image into polar coordinates.
6. A shipborne radar oil spill detection system based on improved whale optimization algorithm characterized in that, The system is used to implement the shipborne radar oil spill detection method based on the improved whale optimization algorithm according to any one of claims 1-5; the system comprises: a preprocessing module configured to preprocess the obtained shipborne radar image; a feature extraction module configured to extract the saliency boundary feature of the preprocessed image; an interest image extraction module configured to extract the ROI image based on the saliency boundary feature; an optimal segmentation module configured to obtain the optimal segmentation threshold by using the improved whale optimization algorithm, and segment the ROI image by using the optimal segmentation threshold to obtain the optimal segmentation image; an oil film extraction module configured to postprocess the optimal segmentation image to obtain the final oil film image.
7. A terminal device, characterized by, The system comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the shipborne radar oil spill detection method based on the improved whale optimization algorithm according to any one of claims 1-5 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored computer program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to execute the shipborne radar oil spill detection method based on the improved whale optimization algorithm as claimed in any one of claims 1 to 5 when the computer program is running.
Citation Information
Patent Citations
Sea surface oil spill detection method and system based on Faster RCNN
CN113901945A
Marine radar oil spill target segmentation method and system
CN119863478A