Shipborne radar oil spill detection method and system based on improved monarch butterfly optimization algorithm
By improving the Monarch Butterfly optimization algorithm and the genetic algorithm to optimize the RBF neural network, the optimal segmentation threshold is adaptively determined, which solves the problems of accuracy and robustness in oil spill detection in complex marine scenarios. It achieves efficient and accurate segmentation of oil spill areas and is suitable for shipborne radar oil spill detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN INST OF GUANGDONG OCEAN UNIV
- Filing Date
- 2026-04-16
- Publication Date
- 2026-07-03
AI Technical Summary
Traditional radar oil spill detection methods suffer from poor environmental adaptability and insufficient oil spill extraction accuracy in complex marine scenarios. Traditional optimization algorithms are prone to getting trapped in local optima, making it difficult to accurately match the grayscale distribution characteristics of oil spills. Furthermore, simple threshold segmentation is insufficient to handle areas with ambiguous boundaries.
An improved monarch butterfly optimization algorithm is adopted, which is combined with a genetic algorithm to optimize the RBF neural network for pixel-by-pixel classification. The optimal segmentation threshold is adaptively determined. The improved monarch butterfly optimization algorithm is used to segment within the region of interest. The boundary is optimized by morphological post-processing to achieve fine segmentation of the oil spill area.
It significantly improves the accuracy and robustness of oil spill identification, adapts to the segmentation needs of oil spill targets under different sea conditions, takes into account both segmentation accuracy and regional integrity, and is applicable to scenarios such as maritime supervision, marine oil spill emergency response, and marine environmental governance.
Smart Images

Figure CN122049628B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil spill detection technology, specifically to a shipborne radar oil spill detection method and system based on an improved monarch butterfly optimization algorithm. Background Technology
[0002] With the deep penetration of radar imaging technology into the field of marine monitoring, its all-weather and highly mobile sensing advantages have made it a core technical means for oil spill target identification. However, in complex marine scenarios, problems such as the weak radiation difference between oil spills and seawater background, strong dynamic interference from sea surface clutter, and significant signal attenuation caused by fog become prominent, making traditional segmentation methods generally suffer from poor environmental adaptability and insufficient oil spill extraction accuracy.
[0003] When traditional RBF neural networks are applied to oil spill segmentation, the hidden layer parameters rely on manual experience for setting, lacking an adaptive optimization mechanism, resulting in insufficient model generalization ability and limited classification accuracy. Traditional optimization algorithms are prone to getting trapped in local optima under dynamic disturbances on the sea surface, making it difficult to accurately match the gray-scale distribution characteristics of oil spills, and simple threshold segmentation is insufficient for handling fine classification of regions with blurred boundaries. For example, the traditional Monarch Butterfly Optimization (MBO) algorithm uses a fixed population size and full gray-scale initialization, without filtering image background noise and invalid pixels, resulting in a large search space, high computational redundancy, susceptibility to noise interference, and low optimization accuracy. At the same time, the fixed migration step size and fixed adjustment probability lead to insufficient global exploration ability in the early stage of iteration and limited local development ability in the later stage, easily resulting in premature convergence or slow convergence. In addition, the single migration mechanism and lack of a high-quality solution protection strategy result in insufficient population diversity and a single search path, making it easy to get trapped in local optima and unable to escape.
[0004] Therefore, there is an urgent need for an oil spill area segmentation method that can improve the accuracy and robustness of oil spill identification in complex marine scenarios. Summary of the Invention
[0005] In view of the above problems, this invention proposes a shipborne radar oil spill detection method and system based on an improved monarch butterfly optimization algorithm.
[0006] According to one aspect of the present invention, a shipborne radar oil spill detection method based on an improved Monarch Butterfly optimization algorithm is proposed, the method comprising:
[0007] S1. Optimize the RBF neural network using a genetic algorithm, and use the optimized RBF neural network to classify radar images pixel by pixel and extract regions of interest; S2. Adaptively determine the optimal segmentation threshold by improving the Monarch Butterfly optimization algorithm, and use the optimal segmentation threshold to segment the regions of interest to obtain the final oil spill area segmentation result.
[0008] Furthermore, S1 specifically includes:
[0009] S11. The three-dimensional pixel matrix of the original radar image is reconstructed to a two-dimensional pixel feature matrix. A training sample set is constructed from the two-dimensional pixel feature matrix using a random uniform sampling strategy. A brightness feature vector is constructed by linearly fusing the training samples based on the RGB three-channel pixel values.
[0010] S12. Sort the brightness feature vector in ascending order and segment it into equal frequency intervals to divide the training samples into three categories: low brightness, medium brightness, and high brightness, and generate corresponding one-hot encoded labels.
[0011] S13. Using the RGB three-channel features in the two-dimensional pixel feature matrix as input and the one-hot encoded label as output, the hidden layer center and kernel width parameters of the RBF neural network are optimized using a genetic algorithm within a preset parameter constraint space; a fitness function is constructed using the mean square error of the model's prediction of training samples, and the population is iteratively optimized through selection, crossover, and mutation operations to obtain the optimized RBF neural network.
[0012] S14. Input the full-image pixel features of the original radar image into the optimized RBF neural network for pixel-by-pixel category prediction, and generate an initial binary mask according to the preset category filtering threshold.
[0013] S15. Perform pixel-level weighted fusion of the initial binary mask and the original radar image to obtain the region of interest.
[0014] Furthermore, S2 specifically includes:
[0015] S21. Extract the effective pixel set from the region of interest, and adaptively determine the population size and the search range of the segmentation threshold for the monarch butterfly optimization algorithm based on the effective pixel set.
[0016] S22. Divide the iterative process into an exploration phase and a development phase, and adaptively adjust the migration step size and elite reproduction probability according to the current iteration number.
[0017] S23. Perform migration operations on individuals based on adaptive migration step size and global optimal position, and generate candidate solutions by combining reverse learning operations;
[0018] S24. Perform elite crossover operation based on adaptive elite reproduction probability, and retain individuals with better fitness through greedy selection;
[0019] S25. Construct a fitness function that integrates intra-class variance, inter-class grayscale difference, and oil spill area ratio to evaluate the quality of the segmentation threshold.
[0020] S26. Iterate and optimize until the termination condition is met, output the optimal segmentation threshold, perform fine segmentation on the region of interest, and obtain the final oil spill area segmentation result.
[0021] Furthermore, the population size of the adaptively determined monarch butterfly optimization algorithm described in S21 is... :
[0022] ;
[0023] in, Represents the floor function; This is a constant coefficient used to adaptively adjust the population size; The standard deviation of grayscale values for the effective pixel set;
[0024] The search range for the segmentation threshold is:
[0025] ;
[0026] in, The adaptive search interval for the segmentation threshold. These are the lower and upper bounds of the segmentation threshold search interval, respectively; The set of valid pixels; This is the interval expansion coefficient.
[0027] Furthermore, the formula for adaptively adjusting the migration step size based on the current iteration number in S22 is as follows:
[0028] ;
[0029] in, Let be the migration step size for the t-th iteration; To explore the upper limit of the step size in the exploration phase, This is the lower limit of the development phase step size; To switch iteration numbers during the development phase, This represents the maximum number of iterations.
[0030] The formula for calculating the elite reproduction probability is:
[0031] ;
[0032] in, Let be the elite reproduction probability in the t-th iteration; This is the upper limit for the development phase; This represents the lower limit of the exploration phase.
[0033] Furthermore, the update formula for the migration operation in S23 is:
[0034] ;
[0035] in, This represents the updated position of the i-th monarch butterfly after migration. Let be the current position of the i-th monarch butterfly individual in the t-th iteration; A random number within the range [0,1]; The global optimal position of the entire monarch butterfly population in the t-th iteration;
[0036] The formula for generating candidate solutions through reverse learning is:
[0037] ;
[0038] in, The candidate positions are generated by reverse learning based on the migration location of the i-th monarch butterfly individual.
[0039] Furthermore, in S24, the formula for performing elite crossover based on adaptive elite reproduction probability and retaining individuals with better fitness through greedy selection is as follows:
[0040] ;
[0041] in, For the first +1 iterations to determine the position of the i-th monarch butterfly individual; The candidate position is obtained by the i-th monarch butterfly after migration, reverse learning, and selection. A random number within the range [0,1]; These are elite individuals from the parent generation, randomly selected from the elite set. The fitness function; It is a random threshold within the interval [0,1].
[0042] Furthermore, the formula for the fitness function described in S25 is:
[0043] ;
[0044] in, The fitness value corresponding to the segmentation threshold T; These are the intra-class variances corresponding to foreground and background pixels, respectively. These are the grayscale values corresponding to the foreground and background pixels, respectively. These are the number of foreground pixels and the total number of pixels in the image, respectively. These are the weighting coefficients for the evaluation indicators; This is the area balance coefficient; It is the minimum regularization constant.
[0045] Furthermore, the formula for finely segmenting the region of interest in S26 is as follows:
[0046] ;
[0047] in, This is the final result of the oil spill separation; The pixel value of the region of interest (x, y) and channel c. This is the globally optimal position at the end of the iteration, i.e., the optimal segmentation threshold; For the effective pixel mask matrix, The set of valid pixels; This is a morphological post-processing operator.
[0048] According to another aspect of the present invention, a shipborne radar oil spill detection system based on an improved Monarch Butterfly optimization algorithm is proposed. The system is implemented based on the aforementioned shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm. The system includes:
[0049] The region of interest coarse extraction module is configured to optimize the RBF neural network using a genetic algorithm, and then use the optimized RBF neural network to classify the radar image pixel by pixel and extract the region of interest. The fine segmentation optimization module is configured to adaptively determine the optimal segmentation threshold by improving the Monarch Butterfly optimization algorithm, and then use the optimal segmentation threshold to segment the region of interest to obtain the final oil spill area segmentation result.
[0050] The beneficial technical effects of this invention are:
[0051] This invention proposes a shipborne radar oil spill detection method and system based on an improved Monarch Butterfly optimization algorithm. Utilizing the unique grayscale response characteristics of oil spill areas based on brightness features, the method accurately locates the candidate oil spill region. Then, a GA-RBF neural network is used to perform coarse pixel classification and ROI extraction across the entire image, filtering out sea surface clutter and background interference. Subsequently, an improved MBO algorithm is introduced to perform adaptive threshold search and optimization within the ROI grayscale range. Morphological post-processing is combined to correct boundary ambiguity errors, achieving precise and targeted segmentation of the oil spill target. This invention effectively overcomes the segmentation bottleneck under complex sea conditions, significantly improving the accuracy, regional integrity, and robustness of oil spill identification. It is adaptable to the real-time processing needs of scenarios such as maritime supervision, marine oil spill emergency response, and marine environmental governance, providing stable and reliable technical support for the efficient and accurate identification of oil spill targets in shipborne radar images. Attached Figure Description
[0052] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated in the drawings by way of example and not limitation, wherein:
[0053] Figure 1 This is a flowchart of the shipborne radar oil spill detection method based on the improved monarch butterfly optimization algorithm described in an embodiment of the present invention;
[0054] Figure 2 This is an example of an original radar image in an embodiment of the present invention;
[0055] Figure 3 This is an example of a region of interest image coarsely extracted in an embodiment of the present invention;
[0056] Figure 4 This is an example of the oil spill mask segmentation result in an embodiment of the present invention. Detailed Implementation
[0057] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.
[0058] This invention proposes a shipborne radar oil spill detection method. First, a radial basis function (RBF) neural network is optimized using a genetic algorithm (GA). The global optimization capability of the genetic algorithm effectively solves the convergence and stability problem of RBF neural network parameter optimization in complex environments, providing a reliable center for the initial coarse classification of the oil spill area. On this basis, an adaptive monarch butterfly optimization algorithm (MBO) is introduced. Utilizing its improved two-stage dynamic parameter adjustment, back learning, and elite breeding strategy, a gray-scale adaptation optimization space is constructed based on the region of interest (ROI) output by GA-RBF. Adaptive threshold optimization corrects the hard allocation error of boundary pixels. Especially for gray-scale transition areas caused by wave reflection and fog interference, the improved MBO can accurately match the gray-scale distribution of the oil spill, achieving progressive optimization from coarse classification to fine segmentation, adapting to the segmentation requirements of oil spill targets under different sea conditions, and taking into account segmentation accuracy, regional integrity, and environmental adaptability.
[0059] This invention proposes a shipborne radar oil spill detection method based on an improved Monarch Butterfly optimization algorithm, such as... Figure 1 As shown, the method includes:
[0060] S1. Optimize the RBF neural network using a genetic algorithm, and use the optimized RBF neural network to classify radar images pixel by pixel and extract regions of interest; S2. Adaptively determine the optimal segmentation threshold by improving the Monarch Butterfly optimization algorithm, and use the optimal segmentation threshold to segment the regions of interest to obtain the final oil spill area segmentation result.
[0061] The embodiments of the present invention will be described in detail below.
[0062] First, in S1, a genetic algorithm is used to optimize the RBF neural network. The optimized RBF neural network is then used to perform pixel-by-pixel classification of radar images and extract regions of interest. Specifically, this includes:
[0063] S11. The three-dimensional pixel matrix of the original radar image is reconstructed to a two-dimensional pixel feature matrix. A training sample set is constructed from the two-dimensional pixel feature matrix using a random uniform sampling strategy. A brightness feature vector is constructed by linearly fusing the training samples based on the RGB three-channel pixel values.
[0064] S12. Sort the brightness feature vector in ascending order and segment it into equal frequency intervals to divide the training samples into three categories: low brightness, medium brightness, and high brightness, and generate corresponding one-hot encoded labels.
[0065] S13. Using the RGB three-channel features in the two-dimensional pixel feature matrix as input and the one-hot encoded label as output, the hidden layer center and kernel width parameters of the RBF neural network are optimized using a genetic algorithm within a preset parameter constraint space; a fitness function is constructed using the mean square error of the model's prediction of training samples, and the population is iteratively optimized through selection, crossover, and mutation operations to obtain the optimized RBF neural network.
[0066] S14. Input the full-image pixel features of the original radar image into the optimized RBF neural network for pixel-by-pixel category prediction, and generate an initial binary mask according to the preset category filtering threshold.
[0067] S15. Perform pixel-level weighted fusion of the initial binary mask and the original radar image to obtain the region of interest.
[0068] According to an embodiment of the present invention, S11 specifically includes image data processing and feature space mapping. First, the three-dimensional image (e.g., ...) is reconstructed through dimensional reconstruction. Figure 2 The pixel feature matrix (as shown) is converted into a two-dimensional pixel feature matrix. A training sample set is constructed using a random uniform sampling strategy. Brightness features are constructed using the linear fusion of RGB three-channel pixel values, providing a clear physical basis for unsupervised label generation. This enhances the interpretability and reliability of the subsequent classification process, ensuring a high degree of match between the label system and the visual characteristics of the image. The relevant formulas are as follows:
[0069] ;
[0070] ;
[0071] in, The feature matrix of the training samples; It is a random uniform sampling operator; For vectorization operators; This is a data type conversion operator that converts pixel values to double-precision floating-point numbers. These are the pixel values of the original radar image. For pixel space coordinates, For channel indexing; This represents the number of training samples. Let be the brightness feature value of the i-th training sample; For small perturbation coefficients, a value of 10 can be taken. -6 To avoid sorting ambiguity caused by identical brightness values; Operator for generating random numbers from a standard normal distribution; Represents the training sample matrix The feature value of the i-th sample and the c-th channel.
[0072] S12 specifically includes: sorting brightness features in ascending order and segmenting them into equal-frequency intervals, dividing the training samples into three categories—low, medium, and high—with significant brightness discrimination. This ensures that the classification results are highly consistent with the actual visual characteristics of the image pixels, avoiding class confusion and model learning bias caused by random segmentation. Furthermore, an equal-proportion segmentation strategy is used to ensure a balanced number of samples in the three classes, effectively suppressing the bias effect of class imbalance on model training and ensuring consistent learning weights for each class. The relevant formulas are expressed as follows:
[0073] ;
[0074] ;
[0075] ;
[0076] in, This is the brightness feature vector of the training samples. Sort the index vector by brightness feature; As a sorting index operator, it outputs the index sequence of the original samples; This is the disturbance coefficient, which can be 10. -8 This solves the problem of unstable sorting caused by repeated brightness values; Operator for generating uniformly distributed random numbers. This is the one-hot encoding value of the k-th class corresponding to the i-th training sample; This is the category index, with values 1, 2, and 3, corresponding to the low brightness, medium brightness, and high brightness categories, respectively. This is a floor operator used to divide samples into three classes based on their frequency.
[0077] S13 specifically includes: employing a genetic algorithm for global parameter optimization. Within a predefined parameter constraint space, evolutionary operations such as selection, crossover, and mutation are used to achieve adaptive iterative updates of the parameter population. A fitness function is constructed using the model's mean squared error in predicting training samples, directly using model training accuracy as the optimization objective of the genetic algorithm, thus achieving deep coupling between parameter optimization and model performance. In the output layer weight calculation process, regularized least squares is introduced to suppress the singularity of the hidden layer output matrix by adding a small regularization term. Through multiple generations of evolutionary iteration, the optimal parameter combination is gradually selected, providing a stable and high-performance model foundation for subsequent full-image pixel-level accurate classification, ensuring the consistency and accuracy of the classification results. The relevant formulas are expressed as follows:
[0078] ;
[0079] ;
[0080] ;
[0081] in, Output matrix of hidden layer in RBF neural network The element in the i-th row and j-th column is the output value of the Gaussian kernel function at the center of the j-th hidden layer for the i-th training sample; It is a natural exponential function, representing the similarity between the sample and the center of the hidden layer; The square of the Euclidean distance is used to calculate the spatial distance between the training sample and the center of the hidden layer. For the training sample feature matrix The i-th row, i.e., the RGB three-channel feature vector of the i-th training sample; Let j be the center vector of the hidden layer of the RBF; The Gaussian kernel width parameter; The small perturbation term can take the value 10. -7 This improves the stability of the formula. The optimal parameter vector obtained by the genetic algorithm; For the constrained minimum solution operator, For parameter constraint space; Let be the one-hot label vector of the i-th training sample; Hidden layer output matrix The i-th row represents the outputs of all hidden layer neurons for the i-th sample. For temporary output weights; This is the regularization coefficient, which can take a value of 10. -5 This ensures stable weight calculation. Given a K-order identity matrix, a regularization term is constructed to avoid overfitting; This is a matrix inversion operator used to solve for the output layer weights of regularized least squares.
[0082] S14 specifically includes: reusing the RBF neural network optimized based on a genetic algorithm, inputting the pixel features of the entire image (original radar image) into the optimized network, displaying pixel-by-pixel category probability prediction and category judgment, generalizing the optimal model performance from the training phase to the entire image, ensuring the consistency, accuracy, and reliability of the entire image classification results; and initially separating the target category from the background category by setting a category filtering threshold, generating an initial binary mask. .
[0083] S15 specifically includes: performing pixel-level weighted fusion of the initial binary mask and the original radar image, preserving the color features of the target area, and calibrating the image to ultimately achieve accurate ROI extraction, such as... Figure 3 As shown. The formula is as follows:
[0084] ;
[0085] ;
[0086] in, The classification result for image pixels (x, y); a This is the maximum value index operator, which takes the maximum value of the predicted values for the three categories; The full-image pixel feature matrix The corresponding row; This is the optimal hidden layer center vector; The kernel width of the j-th RBF hidden layer neuron after GA optimization; The output layer weights of the RBF neural network optimized by GA; The pixel values (x, y) and channel c of the final ROI image; For morphological closing operators, This indicates the size of its structural element, and can take a value of 3.
[0087] Then, in S2, the oil spill area is finely segmented based on the improved Monarch butterfly optimization algorithm, specifically including:
[0088] S21. Extract the effective pixel set from the region of interest, and adaptively determine the population size and the search range of the segmentation threshold for the monarch butterfly optimization algorithm based on the effective pixel set.
[0089] S22. Divide the iterative process into an exploration phase and a development phase, and adaptively adjust the migration step size and elite reproduction probability according to the current iteration number.
[0090] S23. Perform migration operations on individuals based on adaptive migration step size and global optimal position, and generate candidate solutions by combining reverse learning operations;
[0091] S24. Perform elite crossover operation based on adaptive elite reproduction probability, and retain individuals with better fitness through greedy selection;
[0092] S25. Construct a fitness function that integrates intra-class variance, inter-class grayscale difference, and oil spill area ratio to evaluate the quality of the segmentation threshold.
[0093] S26. Iterate and optimize until the termination condition is met, output the optimal segmentation threshold, perform fine segmentation on the region of interest, and obtain the final oil spill area segmentation result.
[0094] According to an embodiment of the present invention, S21 specifically includes effective pixel extraction and adaptive initialization of algorithm parameters: The traditional MBO algorithm uses a fixed population size and the entire grayscale range [0, 255] for initialization, without filtering image background noise and invalid pixels, resulting in problems such as large search space, high computational redundancy, susceptibility to noise interference, and low optimization accuracy. The traditional MBO algorithm does not extract effective pixels, only initializes with a fixed range, and the parameters are not adaptive, as shown in the following formula:
[0095] ;
[0096] in, Let i be the initial position of the i-th monarch butterfly individual; To fix the upper and lower bounds of the search; To maintain a fixed population size; It is a uniform random number within [0,1].
[0097] This invention eliminates invalid background areas by filtering effective pixels and adaptively determines the population size and search range based on the grayscale features of effective pixels. This makes the algorithm more closely resemble the actual distribution of radar oil spill images, thereby reducing computational load and unnecessary iterations while improving the algorithm's anti-interference capability and initial search reliability. Subsequent iterations become more stable and efficient, adapting to oil spill images of varying complexity. The formula is as follows:
[0098] ;
[0099] ;
[0100] ;
[0101] in, This is the effective pixel mask matrix; Population size for optimizing the algorithm for monarch butterflies; This is a constant coefficient used to adaptively adjust the population size; The standard deviation of grayscale values for the effective pixel set; This represents the floor function, which guarantees that the population size is a valid positive integer. The set of valid pixels, i.e., a matrix Element; The adaptive search interval for the segmentation threshold. These are the lower and upper bounds of the segmentation threshold search interval, respectively; This is the range expansion coefficient, which can be 1 / 10 of the effective pixel grayscale range.
[0102] S22 specifically includes a two-stage dynamic parameter adaptive adjustment: Traditional MBO algorithms use fixed migration step sizes and fixed adjustment probabilities, which cannot guarantee sufficient global exploration capabilities in the early stages of iteration, nor can they achieve fine-grained local development in the later stages, easily leading to premature convergence or slow convergence, and insufficient optimization accuracy. Traditional MBO algorithms do not have dynamic parameter adjustment; the step size and parameters are fixed throughout the process.
[0103] ;
[0104] in, For fixed step size; To fix the elite reproduction probability.
[0105] This invention employs a two-stage dynamic parameter strategy, enabling the migration step size and elite reproduction probability to adaptively adjust with the iteration process. Simultaneously, it combines population size and search range to achieve parameter self-adaptation. This allows the algorithm to maintain population diversity and expand the search range during the exploration phase, while strengthening local optimization and approximating the optimal solution during the development phase. This effectively balances global search and local optimization, significantly improving convergence speed and optimization accuracy. The formula is as follows:
[0106] ;
[0107] ;
[0108] in, For the first The adaptive migration step size for each iteration; To explore the upper limit of the step size in the exploration phase, This is the lower limit of the development phase step size; To switch algebras during the development phase, This represents the maximum number of iterations for the algorithm. For the first The elite reproduction probability of the next iteration; This is the upper limit for the development phase. This represents the lower limit of the exploration phase.
[0109] S23 specifically includes an individual update strategy that combines basic migration and reverse learning: Traditional MBO algorithms rely solely on a single migration mechanism to update individual positions, and the search direction is highly dependent on the current global optimum. This leads to insufficient population diversity, a single search path, and a high risk of getting trapped in local optima, making it difficult to adapt to complex multi-peak oil spill segmentation scenarios. Traditional MBO algorithms only use a single migration update and lack reverse learning, as shown in the following formula:
[0110] ;
[0111] in, For the first The position of the i-th individual in the next iteration; For the first The global optimal position in the next iteration.
[0112] This invention introduces a reverse learning strategy based on migration updates, generating symmetric reverse candidate solutions for the migrated positions. While ensuring the algorithm's convergence trend, this broadens the search range, enriches population diversity, and enhances the algorithm's ability to escape local optima. This makes it easier for the algorithm to find the globally optimal threshold in complex oil spill segmentation scenarios, thus improving segmentation accuracy. The formula is as follows:
[0113] ;
[0114] ;
[0115] in, This represents the updated position of the i-th monarch butterfly after migration. Let be the current position of the i-th monarch butterfly individual in the t-th iteration; The random number in the range [0,1] is used to increase the randomness of the search; The global optimal position of the entire monarch butterfly population in the t-th iteration; The candidate positions are generated by reverse learning based on the migration location of the i-th monarch butterfly individual.
[0116] S24 specifically includes elite-guided breeding and greedy retention strategies: Traditional MBO algorithms lack effective utilization and protection mechanisms for high-quality solutions, simply moving closer to the optimal individual. High-quality information cannot be fully transmitted, and the absence of elite-guided breeding and greedy retention leads to slow convergence speed, low optimization accuracy, and poor result stability. The formula is as follows:
[0117] ;
[0118] ;
[0119] in, For random individual locations; This is the fitness function.
[0120] This invention introduces an elite-guided breeding and greedy retention strategy. It triggers elite crossover operations with a dynamic elite breeding probability to generate high-quality new solutions, and greedily selects to retain only individuals with better fitness, thus fully strengthening the guiding role of high-quality solutions and ensuring that iterations always move towards better solutions. This improves convergence speed while enhancing the accuracy and stability of the segmentation threshold. The formula is as follows:
[0121] ;
[0122] in, For the first +1 iterations to determine the position of the i-th monarch butterfly individual; The candidate position is obtained by the i-th monarch butterfly after migration, reverse learning, and selection. A random number within the range [0,1]; These are elite individuals from the parent generation, randomly selected from the elite set. This is the fitness function, used to evaluate the quality of the segmentation threshold; It is a random threshold within the interval [0,1].
[0123] S25 specifically includes constructing a multi-dimensional weighted fitness function for oil spill segmentation: Traditional MBO algorithms use a single fitness index, which cannot comprehensively evaluate the oil spill segmentation effect and is prone to problems such as uneven distribution of oil spill and seawater areas, low inter-class discrimination, and unreasonable proportion of oil spill area. The formula is as follows:
[0124] ;
[0125] in, For individuals fitness value; Threshold Within-class variance of the foreground segment; Threshold Within-class variance of the background after segmentation.
[0126] This invention constructs a multi-dimensional weighted fitness function that integrates intra-class variance, inter-class grayscale difference, and oil spill area ratio. By weighting the data, key evaluation indicators are highlighted, making the evaluation criteria more aligned with the actual needs of oil spill segmentation. This more accurately guides threshold optimization, resulting in significant improvements in regional uniformity, inter-class discriminability, and morphological integrity of the final segmentation results. The formula is as follows:
[0127] ;
[0128] in, The fitness value corresponding to the segmentation threshold T; These are the intra-class variances corresponding to foreground and background pixels, respectively. These are the grayscale values corresponding to the foreground and background pixels, respectively. These are the number of foreground pixels and the total number of pixels in the image, respectively. These are the weighting coefficients for the evaluation indicators; This is the area balance coefficient, which can be 0.5. It is a minimal regularization constant to prevent the denominator from being 0.
[0129] S26 specifically includes optimal threshold decision-making and oil spill area segmentation: Traditional segmentation methods directly binarize the entire image without considering previous effective region constraints, easily leading to missegmentation in invalid background areas, and the segmentation results often have morphological defects such as internal holes, small noise points, and rough boundaries. The traditional MBO algorithm has no effective pixel constraints, no post-processing, and directly segments the entire image, as shown in the following formula:
[0130] ;
[0131] ;
[0132] in, The result of segmenting pixels (x, y); In order to make When the minimum value is obtained value.
[0133] This invention utilizes previously obtained effective pixel masks and iteratively optimized thresholds for targeted segmentation. Simultaneously, morphological post-processing is added to optimize region structure, fill holes, remove noise, and smooth boundaries, resulting in cleaner, more complete, and smoother segmentation results. This significantly improves the practicality and accuracy of the final oil spill segmentation, meeting actual oil spill detection needs. The formula is as follows:
[0134] ;
[0135] in, This is the final result of the oil spill separation; The pixel value of the region of interest (x, y) and channel c. This is the globally optimal position at the end of the iteration, i.e., the optimal segmentation threshold; For the effective pixel mask matrix, The set of valid pixels; This is a morphological post-processing operator.
[0136] Mark the oil film in the original image to obtain Figure 4 The results are shown.
[0137] This invention first accurately locates the oil spill area using brightness features, then performs coarse classification and ROI extraction of the entire image using a GA-RBF neural network guided by these features. Finally, it utilizes an improved adaptive MBO algorithm to achieve fine boundary segmentation and morphological optimization, significantly reducing the impact of wave reflection and fog interference on the segmentation results. This invention successfully balances the accuracy and real-time performance of oil spill segmentation under dynamic sea conditions, providing highly reliable technical support for scenarios such as maritime monitoring and oil spill cleanup scheduling.
[0138] This invention also proposes a shipborne radar oil spill detection system based on an improved Monarch Butterfly optimization algorithm. The system is implemented based on the shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm described in the above embodiments. The system includes:
[0139] The region of interest coarse extraction module is configured to optimize the RBF neural network using a genetic algorithm, and then use the optimized RBF neural network to classify the radar image pixel by pixel and extract the region of interest. The fine segmentation optimization module is configured to adaptively determine the optimal segmentation threshold by improving the Monarch Butterfly optimization algorithm, and then use the optimal segmentation threshold to segment the region of interest to obtain the final oil spill area segmentation result.
[0140] For the parts of the shipborne radar oil spill detection system based on the improved Monarch Butterfly optimization algorithm according to the embodiments of the present invention that are not described in detail, please refer to the detailed description of the method embodiments above.
[0141] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A shipborne radar oil spill detection method based on an improved Monarch butterfly optimization algorithm, characterized in that, include: S1. Optimize the RBF neural network using a genetic algorithm, and then use the optimized RBF neural network to perform pixel-by-pixel classification of radar images and extract regions of interest; including: S11. The three-dimensional pixel matrix of the original radar image is reconstructed to a two-dimensional pixel feature matrix. A training sample set is constructed from the two-dimensional pixel feature matrix using a random uniform sampling strategy. A brightness feature vector is constructed by linearly fusing the training samples based on the RGB three-channel pixel values. S12. Sort the brightness feature vector in ascending order and segment it into equal frequency intervals to divide the training samples into three categories: low brightness, medium brightness, and high brightness, and generate corresponding one-hot encoded labels. S13. Using the RGB three-channel features in the two-dimensional pixel feature matrix as input and the one-hot encoded label as output, the hidden layer center and kernel width parameters of the RBF neural network are optimized using a genetic algorithm within a preset parameter constraint space; a fitness function is constructed using the mean square error of the model's prediction of training samples, and the population is iteratively optimized through selection, crossover, and mutation operations to obtain the optimized RBF neural network. S14. Input the full-image pixel features of the original radar image into the optimized RBF neural network for pixel-by-pixel category prediction, and generate an initial binary mask according to the preset category filtering threshold. S15. Perform pixel-level weighted fusion of the initial binary mask and the original radar image to obtain the region of interest; S2. An optimal segmentation threshold is adaptively determined using an improved Monarch butterfly optimization algorithm. This threshold is then used to segment the region of interest, yielding the final oil spill area segmentation result; including: S21. Extract the effective pixel set from the region of interest, and adaptively determine the population size and the search range of the segmentation threshold for the monarch butterfly optimization algorithm based on the effective pixel set. S22. Divide the iterative process into an exploration phase and a development phase, and adaptively adjust the migration step size and elite reproduction probability according to the current iteration number. S23. Perform migration operations on individuals based on adaptive migration step size and global optimal position, and generate candidate solutions by combining reverse learning operations; S24. Perform elite crossover operation based on adaptive elite reproduction probability, and retain individuals with better fitness through greedy selection; S25. Construct a fitness function that integrates intra-class variance, inter-class grayscale difference, and oil spill area ratio to evaluate the quality of the segmentation threshold. S26. Iterate and optimize until the termination condition is met, output the optimal segmentation threshold, perform fine segmentation on the region of interest, and obtain the final oil spill area segmentation result.
2. The shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm according to claim 1, characterized in that, The population size of the adaptive determination of the monarch butterfly optimization algorithm described in S21 is: : ; in, Represents the floor function; This is a constant coefficient used to adaptively adjust the population size; The standard deviation of grayscale values for the effective pixel set; The search range for the segmentation threshold is: ; in, The adaptive search interval for the segmentation threshold. These are the lower and upper bounds of the segmentation threshold search interval, respectively; The set of valid pixels; This is the interval expansion coefficient.
3. The shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm according to claim 2, characterized in that, The formula for adaptively adjusting the migration step size based on the current iteration number in S22 is: ; in, Let be the migration step size for the t-th iteration; To explore the upper limit of the step size in the exploration phase, This is the lower limit of the development phase step size; To switch iteration numbers during the development phase, This represents the maximum number of iterations. The formula for calculating the elite reproduction probability is: ; in, Let be the elite reproduction probability in the t-th iteration; This represents the upper limit of elite breeding probability during the development phase. This represents the lower limit of the elite reproduction probability during the exploration phase.
4. The shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm according to claim 3, characterized in that, The update formula for migration operations in S23 is: ; in, This represents the updated position of the i-th monarch butterfly after migration. Let be the current position of the i-th monarch butterfly individual in the t-th iteration; A random number within the range [0,1]; The global optimal position of the entire monarch butterfly population in the t-th iteration; The formula for generating candidate solutions through reverse learning is: ; in, The candidate positions are generated by reverse learning based on the migration location of the i-th monarch butterfly individual.
5. The shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm according to claim 4, characterized in that, In S24, the formula for performing elite crossover based on adaptive elite reproduction probability and retaining individuals with better fitness through greedy selection is as follows: ; in, For the first +1 iterations to determine the position of the i-th monarch butterfly individual; The candidate position is obtained by the i-th monarch butterfly after migration, reverse learning, and selection. A random number within the range [0,1]; These are elite individuals from the parent generation, randomly selected from the elite set. The fitness function; It is a random threshold within the interval [0,1].
6. The shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm according to claim 5, characterized in that, The formula for the fitness function described in S25 is: ; in, The fitness value corresponding to the segmentation threshold T; These are the intra-class variances corresponding to foreground and background pixels, respectively. These are the grayscale values corresponding to the foreground and background pixels, respectively. These are the number of foreground pixels and the total number of pixels in the image, respectively. These are the weighting coefficients for the evaluation indicators; This is the area balance coefficient; It is the minimum regularization constant.
7. The shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm according to claim 6, characterized in that, The formula for finely segmenting the region of interest as described in S26 is: ; in, This is the final result of the oil spill separation; The pixel value of the region of interest (x, y) and channel c. This is the globally optimal position at the end of the iteration, i.e., the optimal segmentation threshold; For the effective pixel mask matrix, The set of valid pixels; This is a morphological post-processing operator.
8. A shipborne radar oil spill detection system based on an improved Monarch butterfly optimization algorithm, characterized in that, The system is used to implement the shipborne radar oil spill detection method based on the improved Monarch Butterfly optimization algorithm as described in any one of claims 1-7; the system includes: The region of interest coarse extraction module is configured to optimize the RBF neural network using a genetic algorithm, and then use the optimized RBF neural network to classify the radar image pixel by pixel and extract the region of interest. The fine segmentation optimization module is configured to adaptively determine the optimal segmentation threshold by improving the Monarch Butterfly optimization algorithm, and then use the optimal segmentation threshold to segment the region of interest to obtain the final oil spill area segmentation result.