An oil film detection method and system based on region perception and structure guidance
By using an improved KAZE feature detector and a mirage particle swarm optimization algorithm guided by a neural gas network, the problem of segmenting oil film regions in low-contrast, high-noise radar images was solved, improving the accuracy and robustness of oil film detection and supporting real-time monitoring of marine oil spills.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN INST OF GUANGDONG OCEAN UNIV
- Filing Date
- 2026-02-04
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies struggle to accurately segment oil slick areas on the sea surface when processing low-contrast, high-noise radar images. Traditional methods are sensitive to noise and are prone to regional discontinuities, inaccurate boundaries, or over-segmentation/under-segmentation. Furthermore, they fail to fully utilize prior information about the image structure.
An oil film detection method based on region perception and structure guidance is adopted, including an improved KAZE feature detector, kernel density estimation, and a mirage particle swarm optimization algorithm guided by a neural gas network. Through preprocessing, feature point detection, continuous probability density field extraction, and optimal segmentation threshold segmentation, the oil film region is accurately segmented.
It significantly improves the accuracy and robustness of oil film detection in complex images, and realizes automated processing from raw radar images to oil film detection results, providing an effective tool for real-time monitoring and assessment of marine oil spills.
Smart Images

Figure CN121661042B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil film detection technology, specifically to an oil film detection method and system based on region sensing and structure guidance. Background Technology
[0002] Marine oil spills pose a serious threat to the ecological environment and economic development, making rapid and accurate detection of oil slicks on the sea surface crucial. Shipborne radar is an important means of conducting large-scale, all-weather sea surface monitoring, and the radar images it acquires can reflect information about oil slicks on the sea surface. However, radar images often suffer from low contrast, high noise, and blurred target edges, making it difficult for traditional image segmentation and target detection methods to obtain stable and accurate oil slick areas.
[0003] When processing such complex images, existing methods based on threshold segmentation, edge detection, or traditional feature extraction are often sensitive to noise, and the segmentation results are prone to regional discontinuities, inaccurate boundaries, or oversegmentation / undersegmentation. Although some improved swarm intelligence optimization algorithms (such as particle swarm optimization) have been introduced to find better segmentation thresholds, they are still prone to getting trapped in local optima when dealing with low-contrast, multimodal grayscale distributions, and fail to fully utilize the prior structural information of the image itself, resulting in limited detection capabilities for weakly characterized oil film regions.
[0004] Therefore, there is an urgent need for an oil film detection method that can effectively suppress noise, adaptively enhance target features, and utilize the essential structure of images for intelligent guidance, so as to improve the accuracy, robustness, and automation level of oil film detection under complex sea conditions. Summary of the Invention
[0005] In view of the above problems, this invention proposes an oil film detection method and system based on region perception and structure guidance, aiming to solve the problem of accurate segmentation of oil film regions in low-contrast and high-noise radar images.
[0006] According to one aspect of the present invention, an oil film detection method based on region sensing and structure guidance is proposed, the method comprising:
[0007] S1. Preprocess the acquired raw radar image data;
[0008] S2. Feature point detection is performed on the preprocessed image using an improved KAZE feature detector; the improved KAZE feature detector improves the diffusion mode to a region diffusion mode based on local consistency;
[0009] S3. The detected discrete feature points are converted into a continuous probability density field, and high-density regions are extracted from the continuous probability density field as regions of interest, thereby generating an image of interest.
[0010] S4. Obtain the optimal segmentation threshold using a mirage particle swarm optimization algorithm guided by a neural gas network, and segment the interest image using the optimal segmentation threshold to obtain a segmented image based on the optimal segmentation threshold.
[0011] S5. Post-process the segmented image based on the optimal segmentation threshold to obtain the final oil film detection result.
[0012] Furthermore, the preprocessing described in S1 includes: coordinate transformation, detection and suppression of co-frequency interference, speckle noise filtering, grayscale correction, and contrast enhancement.
[0013] Furthermore, the region diffusion mode based on local consistency described in S2 includes: in the transfer function used to control the diffusion intensity Introducing a local grayscale consistency factor Then the new transmission function is constructed. for:
[0014] ;
[0015] In the formula, Represents the image after Gaussian smoothing At pixel position The gradient vector at that point, Indicates the scale control factor; Indicates the gradient threshold; , Indicates the enhancement coefficient. This represents the adjustment coefficient. This represents the local grayscale standard deviation.
[0016] Further, the specific steps of S3 include: using a kernel density estimation method to calculate the density value at any pixel position on the image plane based on the detected feature point set, thereby obtaining a continuous probability density field; normalizing the continuous probability density field to obtain a normalized density field; based on the normalized density field, using the Otsu's maximum inter-class variance method to determine the optimal segmentation threshold between the region of interest and the background region, and generating a binary mask based on the optimal segmentation threshold; and performing a pixel-by-pixel multiplication between the binary mask and the preprocessed image to generate the image of interest.
[0017] Further, the specific steps of S4 include: extracting a set of feature anchor points representing the gray-level distribution from the input interest image using a neural gas network; based on the feature anchor point set, using a particle swarm optimization algorithm incorporating a mirage guidance mechanism to search for the optimal segmentation threshold by minimizing the fusion fitness function; the mirage guidance mechanism is implemented through the following velocity update equation:
[0018] ;
[0019] In the formula, Let represent the velocity vector of particle i at the (t+1)th iteration; This represents the inertial weight, used to control the motion inertia of particle i; , , All represent learning factors, used to modulate the individual cognitive coefficient, social cognitive coefficient, and mirage guidance coefficient, respectively; , , Both represent random numbers that are uniformly distributed within the interval [0,1]. This represents the mirage point assigned to particle i; This represents the individual historical best position of particle i; G(t) represents the position vector of particle i; G(t) represents the global optimal position of the population.
[0020] Furthermore, the inertial weight With the number of iterations The formula for adaptive adjustment is:
[0021] ;
[0022] In the formula, , These are the maximum and minimum values of the inertia weight, respectively. Indicates the maximum number of iterations;
[0023] Learning factor , , With the number of iterations The formulas for adaptive adjustment are as follows:
[0024] ;
[0025] ;
[0026] ;
[0027] In the formula, This indicates the growth rate of an individual's cognitive coefficient. This represents the initial value of the individual's cognitive coefficient; This indicates the growth rate of the social cognition coefficient; This represents the initial value of the social cognition coefficient; The baseline value representing the mirage guiding coefficient; and These represent the final training value and the reference baseline value of the learning rate of the neural gas network, respectively. This indicates a decrease in rate.
[0028] Furthermore, the mirage point The generation process includes:
[0029] Calculate the probability of strategy selection The formula is:
[0030] ;
[0031] In the formula, and These represent the probability of strategy selection at the beginning and end of the iteration, respectively;
[0032] Generate a random decision variable ξ ~ Uniform(0,1); Represents a random variable that follows a uniform distribution;
[0033] If the random decision variable ξ is less than or equal to Then, mirage points are generated according to the elite perturbation guidance strategy or the NGN guidance strategy. Otherwise, mirage points will be generated using a diversity-guided exploration strategy. Among them, mirage points are generated according to the elite perturbation guidance strategy. The formula is:
[0034] ;
[0035] In the formula, This indicates the position of a randomly selected elite particle. This indicates a random perturbation. ,in Indicates the amplitude of the decaying disturbance: , This represents the initial value of the disturbance amplitude. and These represent the upper and lower bounds of the search space, respectively. This represents a random vector whose dimensions follow a standard normal distribution, used to provide the random direction of the perturbation. This represents element-wise multiplication;
[0036] Generate mirage points according to NGN guidance strategy. The formula is:
[0037] ;
[0038] In the formula, This represents a feature anchor point randomly selected from the set of feature anchor points;
[0039] Generate mirage points using a diversity-guided exploration strategy. For example: Randomly and uniformly sample a point within the global search space, the formula is:
[0040] .
[0041] Furthermore, the fusion fitness function is: :
[0042] ;
[0043] In the formula, This represents the candidate segmentation threshold vector to be optimized. This represents a segmentation quality item, used to measure the uniformity of pixel grayscale within each segmented region defined by the segmentation threshold vector. , The pixel ratio of the k-th class. Let V be the grayscale variance of the k-th class pixel. Indicates the preset threshold number; and These are weighting coefficients, used to balance segmentation quality and feature consistency, respectively. The feature consistency reward term for neural gas networks is defined as follows:
[0044] ;
[0045] in, This represents the adaptive matching sensitivity parameter; Represents the candidate segmentation threshold vector The d-th segmentation threshold The distance to the nearest feature anchor point w extracted by the neural gas network.
[0046] Furthermore, the specific steps of S5 include: performing binarization processing on the segmented image based on the optimal segmentation threshold to extract oil film candidate regions; using ROI masks to remove background interference and retain targets within the oil film candidate regions; extracting the edges of the ROI masks using the Sobel operator and expanding the edge range using morphological dilation operations, deleting the dilated edges from the oil film candidate regions, and obtaining the final oil film detection results.
[0047] According to another aspect of the present invention, an oil film detection system based on region sensing and structure guidance is proposed, the system being used to implement the aforementioned oil film detection method based on region sensing and structure guidance; the system includes:
[0048] The data preprocessing module is configured to preprocess the acquired raw radar image data.
[0049] A feature point detection module is configured to perform feature point detection on the preprocessed image using an improved KAZE feature detector; the improved KAZE feature detector improves the diffusion mode to a region diffusion mode based on local consistency.
[0050] The region of interest extraction module is configured to convert the detected discrete feature points into a continuous probability density field, and extract high-density regions from the continuous probability density field as regions of interest, thereby generating an image of interest.
[0051] The optimal segmentation module is configured to obtain the optimal segmentation threshold using a mirage particle swarm optimization algorithm guided by a neural gas network, and to segment the interest image using the optimal segmentation threshold to obtain a segmented image based on the optimal segmentation threshold.
[0052] An oil film detection module is configured to post-process the segmented image based on the optimal segmentation threshold to obtain the final oil film detection result.
[0053] The beneficial technical effects of this invention are:
[0054] This invention proposes an oil film detection method and system based on region perception and structure guidance, mainly comprising: First, preprocessing the acquired raw radar image data to effectively improve the image signal-to-noise ratio and the separability of oil film features; then, using an improved KAZE feature detector to detect feature points in the preprocessed image, by improving the diffusion mode of the KAZE algorithm to obtain denser and continuous feature points, which can better characterize the oil film region and provide a more stable and reliable basis for subsequent ROI extraction; then, converting the detected discrete feature points into a continuous probability density field, and extracting high-density regions as regions of interest from the continuous probability density field, thereby generating an interest image; and finally, combining kernel density estimation... The algorithm employs adaptive threshold segmentation to automatically and accurately extract continuous regions of interest from feature point distributions, reducing background interference. These two steps achieve region perception. Then, an optimal segmentation threshold is obtained using a mirage particle swarm optimization algorithm guided by a neural gas network. This optimal threshold is then used to segment the image of interest, resulting in a segmented image. This algorithm innovatively integrates unsupervised feature learning (neural gas network) with heuristic global optimization (improved mirage particle swarm optimization), utilizing prior knowledge of image structure to guide the search process. This significantly improves the accuracy, efficiency, and robustness of finding the optimal segmentation threshold in complex images, making it particularly suitable for low-contrast, high-noise scenes. This invention automates the processing from raw radar images to oil slick detection results, providing an effective technical tool for real-time monitoring and assessment of marine oil spills. Attached Figure Description
[0055] 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:
[0056] Figure 1 This is a flowchart of an oil film detection method based on region perception and structure guidance according to an embodiment of the present invention;
[0057] Figure 2 This is a technical block diagram of an oil film detection method based on region perception and structure guidance according to an embodiment of the present invention;
[0058] Figure 3 This is an example of radar image data in an embodiment of the present invention;
[0059] Figure 4 This is an example of the preprocessing result in an embodiment of the present invention;
[0060] Figure 5 This is an example of ROI extraction results based on KAZE feature point density analysis in an embodiment of the present invention;
[0061] Figure 6 This is an example of NGN feature preprocessing results in an embodiment of the present invention;
[0062] Figure 7 This is an example of the oil film segmentation result of the N-MGPSO algorithm in an embodiment of the present invention;
[0063] Figure 8 This is an example of the final oil film detection result in an embodiment of the present invention. Detailed Implementation
[0064] 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.
[0065] This invention proposes an oil film detection method based on region sensing and structure guidance, such as... Figures 1-2 As shown, the method includes:
[0066] S1. Preprocess the acquired raw radar image data;
[0067] S2. Feature point detection is performed on the preprocessed image using an improved KAZE feature detector; the improved KAZE feature detector improves the diffusion mode to a region diffusion mode based on local consistency;
[0068] S3. The detected discrete feature points are converted into a continuous probability density field, and high-density regions are extracted from the continuous probability density field as regions of interest, thereby generating an image of interest.
[0069] S4. Obtain the optimal segmentation threshold using a mirage particle swarm optimization algorithm guided by a neural gas network, and segment the interest image using the optimal segmentation threshold to obtain a segmented image based on the optimal segmentation threshold.
[0070] S5. Post-process the segmented image based on the optimal segmentation threshold to obtain the final oil film detection result.
[0071] First, in S1, the acquired raw radar image data is preprocessed.
[0072] According to an embodiment of the present invention, the raw image data acquired by the shipborne radar is as follows: Figure 3 As shown. Due to the presence of certain system noise and random interference in the original image data, preprocessing is required to improve the signal-to-noise ratio and the separability of target features. Preprocessing includes: coordinate transformation, detection and suppression of co-frequency interference, speckle noise filtering, grayscale correction, and contrast enhancement. The specific steps are as follows: First, the original radar data is mapped to a standard image grid by transforming from polar coordinates to rectangular coordinates; then, spatial convolution is performed using row vector operators to adaptively detect co-frequency interference and suppress interference based on adjacent non-noise pixels; next, in the lower two-thirds of the image, a dual thresholding method using grayscale and area thresholds is applied based on the image's grayscale statistical characteristics to identify large-area speckle noise, and median filtering is performed within a local window to eliminate residual noise; then, the pixel intensity distribution of the entire image is systematically corrected using a grayscale adjustment matrix; finally, a local window-limited contrast adaptive histogram equalization algorithm is used to significantly enhance the local contrast of the oil film feature region, thereby improving the detectability and segmentation effect of the region of interest.
[0073] After the above preprocessing, noise and interference in the original radar image are effectively suppressed, and the overall quality and feature separability are improved, providing a reliable data foundation for subsequent oil film detection and quantitative analysis. Relevant schematic diagrams during the preprocessing process are shown below. Figure 4 As shown. Figure 4 (a) is the image after coordinate transformation; (b) is the image after suppressing co-frequency interference; (c) is the image after suppressing speckle noise; and (d) is the image after grayscale correction and local contrast enhancement.
[0074] Then, in S2, the improved KAZE feature detector is used to detect feature points on the preprocessed image.
[0075] According to an embodiment of the present invention, in order to achieve ROI extraction based on feature point density analysis, the present invention first employs the KAZE algorithm for feature point detection. The KAZE algorithm constructs a scale space through nonlinear diffusion filtering, and its core is described by the Perona-Malik equation as follows:
[0076] ;
[0077] In the formula, This represents the image corresponding to the scale control factor s in scale space. The larger the scale control factor s, the higher the smoothness of the image. Representing an image At pixel position The gradient vector at a given location reflects the edge strength at that position; div(.) is the divergence operator, used to describe the degree of divergence of the gradient field; The conduction function, used to control the diffusion intensity, is defined as:
[0078] ;
[0079] In the formula, For the image The image obtained after Gaussian smoothing. Represents the image after Gaussian smoothing At pixel position The gradient vector at that point; This is the gradient threshold. This mechanism can preserve edges while smoothing uniform regions.
[0080] To enhance the representational ability of feature points for the Region of Interest (ROI) and overcome the problem of sparse and isolated feature points caused by the default single-scale diffusion mode, this invention makes a key improvement to the diffusion mode of the KAZE algorithm, adjusting it to a region diffusion mode based on local consistency. The core of this improvement lies in: in the transfer function... A local grayscale consistency factor was introduced. This allows for the construction of a new transmission function for the sensing region. as follows:
[0081] ;
[0082] ;
[0083] In the formula, To enhance the coefficient, For adjustment coefficients, This represents the local grayscale standard deviation. Within areas with uniform and continuous texture (… Small), Approaching (Larger), thus enhancing the conductivity (diffusion ability) of the region, allowing the diffusion process to penetrate deeper and smoother within the region, promoting a more uniform generation of feature points within the region. At edges or areas of drastic texture changes ( big), Approaching 1, the original function of transductive regression Control, primarily suppressing diffusion to preserve the edges.
[0084] The enhanced regional conductivity described above allows the diffusion process to propagate more effectively within uniform regions. This indirectly reduces over-screening of strong gradient edges, allowing points with weaker gradient magnitudes but still characterizing texture structure within the region to be preserved in the nonlinear scale space and detected as stable feature points. This improved method can obtain a denser and more continuous set of feature points, providing a sufficient and stable sample basis for subsequent density analysis.
[0085] Furthermore, to provide a stable sample base for density analysis, this embodiment of the invention designs an adaptive Top-N filtering strategy. Based on the image information capacity, it adaptively filters the number of feature points, stabilizing the number of feature points within a reasonable range. Specifically, the top N feature points with the highest response values are selected from the initial detection results obtained from KAZE feature detection to form the final effective feature point set: ;in Represents a feature point, i=1 2 N, where N represents the total number of feature points. This strategy enables adaptive adjustment of the number of feature points, providing a stable and reliable input for subsequent density analysis.
[0086] Then, in S3, the detected discrete feature points are transformed into a continuous probability density field, and high-density regions are extracted from the continuous probability density field as regions of interest, thereby generating an image of interest.
[0087] According to embodiments of the present invention, the feature points obtained by the KAZE algorithm for feature point detection are discrete feature point sets, which cannot directly represent continuous Regions of Interest (ROIs). To transform the feature point distribution into a spatially continuous visually saliency representation, embodiments of the present invention employ kernel density estimation technology to map discrete feature points into a continuous probability density field. High-value regions in the density field correspond to feature point clusters and can be considered as candidate ROIs.
[0088] Kernel density estimation is a nonparametric density estimation method that assigns a kernel function (such as a Gaussian kernel) to each feature point and superimposes the kernel function contributions of all feature points across the entire image plane. The density value at any location can be obtained by combining the adaptively determined kernel function bandwidth. Ultimately, discrete feature points are mapped to a continuous, smooth probability density field, where high-density regions correspond to candidate oil film regions where feature points cluster. For the effective feature point set P, any location on the image plane... density value at Defined as the sum of the kernel function contributions of all feature points at that location:
[0089] ;
[0090] In the formula, h is the bandwidth of the kernel function, which is a key parameter controlling the smoothness of the density field; For pixels With feature points The squared Euclidean distance between them, after being normalized by the bandwidth h, controls the decay rate of the density contribution.
[0091] The bandwidth *h* of the kernel function directly affects the estimation quality of the density field: if *h* is too large, the density field will be overly smoothed, and the region boundaries will be blurred; if *h* is too small, the density field will exhibit discretized peaks, failing to form continuous regions. To quantify the spatial dispersion of feature points, their coordinate standard deviations in the row and column directions can be calculated separately. Subsequently, by calculating the combined value of these two standard deviations (e.g., taking the root mean square of the sum of squares), the overall dispersion measure of the feature point distribution is obtained. The bandwidth *h* of the kernel density estimation is a key parameter controlling the smoothness of the density field. To adaptively determine the optimal bandwidth, the Silverman criterion can be used, which is calculated based on the combined standard deviation of the feature point distribution and the number of feature points. To prevent bandwidth inaccuracy in extreme distribution cases, reasonable upper and lower limits can be set for the bandwidth to ensure a balance between smoothness and local detail in the density field.
[0092] After obtaining the continuous probability density field, in order to extract high-density regions from the continuous probability density field as ROIs and then generate interest images, the embodiments of the present invention are processed according to the following process.
[0093] First, to eliminate the problem of density value dimension caused by the difference in the number of feature points in different images, the continuous probability density field is normalized. The normalized density field intuitively reflects the likelihood probability of each pixel belonging to the ROI region, which is convenient for subsequent threshold segmentation.
[0094] Based on a normalized density field, the Otsu's maximum inter-class variance method is used to determine the optimal segmentation threshold. This method requires no manual intervention and automatically finds the threshold that maximizes the distinction between the foreground (ROI) and background regions. A binary mask is generated based on the optimal segmentation threshold. Finally, the generated binary mask is multiplied pixel-by-pixel with the preprocessed image to retain image information in high-density areas and mask the background areas, resulting in the final interest image. The ROI extraction results based on KAZE feature point density analysis are shown below. Figure 5 As shown. Figure 5 (a) shows the KAZE feature point detection results (red dots indicate the displayed partial results); (b) shows the continuous probability density field generated by kernel density estimation; and (c) shows the ROI region.
[0095] Then, in S4, the optimal segmentation threshold is obtained by using a mirage particle swarm optimization algorithm guided by a neural gas network, and the interest image is segmented using the optimal segmentation threshold to obtain a segmented image based on the optimal segmentation threshold.
[0096] According to an embodiment of the present invention, the mirage particle swarm optimization algorithm guided by a neural gas network is named N-MGPSO, where N represents the neural gas network, representing the first stage of the algorithm—feature preprocessing. This network, acting as an unsupervised feature extractor, first analyzes the input image, learning the essential structure of its grayscale distribution and key pattern points (i.e., feature anchor points), providing reliable prior knowledge for subsequent optimization. MG represents mirage guidance, representing the core improvement mechanism in the algorithm's basic optimization framework. It is integrated into PSO (Particle Swarm Optimization), dynamically generating virtual guidance points by simulating the mirage phenomenon, effectively expanding the search range, preventing premature convergence, and improving the performance of the basic optimizer. PSO represents particle swarm optimization, representing the second stage of the algorithm—the global optimization engine. As the backbone search algorithm, it is responsible for finding the optimal segmentation threshold in the solution space. N-MGPSO constructs a collaborative framework of "unsupervised feature learning - heuristic global optimization". It extracts essential structural features of images as prior knowledge through neural gas networks and designs a multi-level guidance mechanism to deeply integrate them into the improved particle swarm optimization process, thereby improving segmentation accuracy.
[0097] For an input image, the goal of multi-threshold image segmentation is to find a set of optimal thresholds, arranged sequentially into a vector, that divides the image's grayscale range into multiple contiguous regions, with the number of regions exceeding the number of thresholds by one. The core objective of the N-MGPSO algorithm is to find a threshold vector that minimizes the value of a composite objective function within a pre-defined search space through an optimization process. This composite objective function considers both the quality evaluation metrics of traditional image segmentation and the image structure consistency information extracted by the neural gas network model. The optimal threshold vector is the one that minimizes the fusion fitness function among all possible candidate threshold vectors. The search space is a multi-dimensional space, with dimensions equal to the number of thresholds to be found. The value range of each dimension is determined by its corresponding lower and upper bounds. The fusion fitness function is the core evaluation criterion of the algorithm. It utilizes both the input image itself and the prior knowledge provided by the neural gas network model learned from that image to evaluate the merits of candidate threshold vectors, thereby guiding the optimization search process. These will be explained in detail below.
[0098] 1) Training and Use of Neural Gas Network (NGN): The NGN model is an unsupervised neural network model based on competitive learning, which excels at capturing the essential distribution and topological structure of high-dimensional data under unsupervised conditions. In this embodiment of the invention, it is used as a feature preprocessor to extract stable structural representations from noisy images. For a given normalized grayscale image, the NGN model flattens it into a set of feature vectors. The NGN consists of M neurons, each associated with a weight vector and connected to other neurons. The connections to other neurons are represented by a connection matrix Z, and an age matrix A is used to track the lifetime of the connections.
[0099] The training process of the NGN model follows the "winner-takes-all" competition principle, and its training process is as follows: a) For any input vector, calculate its weight vector with all M neurons in the network. The distance between these neurons is calculated; these neurons are sorted in ascending order of distance to obtain the sorted list (j0, j1, ..., j...). M-1 (a) where j0 represents the nearest neuron (the winner), j1 is the second nearest neuron, and so on, updating the weights of all neurons according to the order: b) Check the connection between the winner j0 and the second nearest neuron j1. If the connection matrix Z=0, establish the connection between them and initialize the age matrix of the connection; if the connection already exists with Z=1, directly reset its age matrix: ; This represents the connection matrix between the winner j0 and the next nearest neuron j1; The age matrix represents the relationship between the winner j0 and the next nearest neuron j1; iterate through all neurons in the connection matrix that satisfy Z=1 (all neurons connected to the winner j0), and increase the age of these connections; if the age of a connection exceeds a set age threshold, delete the connection; c) after multiple iterations, the weights of the neurons... It converges to the feature points of the probability density function of the input data, especially the peak region of the gray-level histogram.
[0100] After training, the network weight set The convergence is achieved to the key locations in the input data distribution. A quantized image is generated by mapping each pixel to its nearest neuron and using a label mapping method. This quantized image effectively filters out noise in homogeneous regions while preserving key edge and structural information. The extracted weight set... The feature anchor point set constituting the image grayscale distribution serves as prior knowledge, providing a high-quality initial search region for subsequent optimization stages. The feature extraction results based on NGN are as follows: Figure 6 As shown.
[0101] One of the core innovations of the N-MGPSO algorithm lies in its approach: instead of treating the neural gas network as an isolated pre-filter, it uses it as an intelligent guiding source. Through a multi-layered, deep fusion strategy, prior knowledge of the image's structure is injected into each stage of the MG-PSO optimization framework. This fusion strategy aims to solve the problem of blind searching in complex image segmentation by traditional optimization algorithms, achieving a fundamental shift from "random exploration" to "knowledge-guided intelligent exploration."
[0102] Before fusion, NGN needs to complete unsupervised feature learning on the input interest image; after training convergence, NGN outputs two sets of key information, which constitute a prior knowledge base to guide subsequent optimization: 1) Feature anchor set This refers to the weight vector of M neurons. These weight values are linearly mapped to the gray-level dynamic range of the image, representing the central location of salient patterns (modalities) in the image's gray-level histogram. They are a quantitative expression of the image's essential structure. 2) Network convergence state parameters: mainly including the final learning rate. This parameter is an intrinsic indicator of NGN training stability and feature extraction reliability; The smaller the value, the more fully the network converges and the better the learned feature anchor set. The more stable and reliable it is.
[0103] 2) MG-PSO is an improved form based on standard Particle Swarm Optimization (PSO). The core innovation of this algorithm lies in the introduction of a mirage guidance mechanism, effectively solving the problems of premature convergence, rapid loss of population diversity, and insufficient search capability for complex multimodal functions commonly found in traditional PSO for image segmentation threshold optimization. Traditional PSO particle updates rely solely on two guidance information: the individual's historical optimal position and the population's global optimal position. This dual-guidance mechanism easily leads to rapid aggregation of all particles in the later stages of iteration, trapping them in local optima. The MG-PSO algorithm proposed in this invention introduces a third type of dynamic guidance source—the mirage point—on top of the traditional dual-guidance mechanism. The mirage point is a virtual, non-historical guidance point that is dynamically generated over time. Its design is inspired by the mirage phenomenon in nature; it is not a real "water source" (global optimal solution), but it can provide new exploration directions for the "traveler" (search particles), effectively preventing the population from overexploiting known areas and neglecting unknown potential optimal areas.
[0104] The mathematical model of the algorithm is as follows: Let the search space dimension be D and the particle population size be N. p In the t-th iteration, each particle i has a position vector. Velocity vector Individual historical best position And the global optimal position G(t) of the population, the optimization objective is to minimize the fusion fitness function. ; where, position vector Velocity vector Individual historical best position The definition of the global optimal position G(t) of the population is as follows:
[0105] ;
[0106] In the formula, Let represent the position vector of particle i in the D-dimensional search space at the t-th iteration, where This represents the value of the particle in the j-th dimension, where j = 1, 2, ..., D.
[0107] ;
[0108] In the formula, This represents the velocity vector of particle i in each dimension at the t-th iteration, which determines its next search direction and step size.
[0109] ;
[0110] In the formula, This represents the position of particle i with the best fitness in its history up to the t-th iteration; This represents the component of the optimal position in the j-th dimension.
[0111] ;
[0112] In the formula, the global optimal position of the population is... This represents the position of the particle swarm with the best fitness among all particles in the t-th iteration, where It is the fitness function, representing the objective that needs to be minimized.
[0113] The particle position update formula is: .
[0114] To ensure that particles move reasonably within the search space, their velocities need to be constrained.
[0115] ;
[0116] In the formula, This represents the d-th dimension velocity component of particle i in the t-th iteration; it is the velocity vector. One of the specific values; This is a sign function, its function is to preserve the direction of velocity; This indicates taking the minimum value; This represents the maximum allowed value of the d-th dimension velocity component. , and Let be the upper and lower bounds of the d-th dimension, respectively. This is the speed limit factor.
[0117] In this embodiment, after extracting a set of feature anchor points representing grayscale distribution from the input image of interest using a neural gas network, a particle swarm optimization algorithm incorporating a mirage guidance mechanism is used based on the feature anchor point set to search for the optimal segmentation threshold by minimizing the fusion fitness function; that is, the core improvement of MG-PSO lies in the introduction of a mirage guidance term into its velocity update equation, and the generation of mirage points is the key to the algorithm maintaining its exploration capability.
[0118] The mirage guidance mechanism is implemented through the following velocity update equation:
[0119] ;
[0120] In the formula, Let represent the velocity vector of particle i at the (t+1)th iteration; This represents the inertial weight, used to control the motion inertia of particle i; , , All represent learning factors, used to modulate the individual cognitive coefficient, social cognitive coefficient, and mirage guidance coefficient, respectively; , , Both represent random numbers that are uniformly distributed within the interval [0,1]. This represents the mirage point assigned to particle i; This represents the individual historical best position of particle i; G(t) represents the position vector of particle i; G(t) represents the global optimal position of the population.
[0121] In this embodiment, the mirage point The generation process employs a dual-strategy adaptive generation mechanism, which dynamically adjusts the bias of the generation strategy based on the optimization process. Specifically, it includes:
[0122] First, to optimize the strategy by focusing on exploration in the early stages and development in the later stages, the probability of strategy selection is... Designed to adapt to the number of iterations The formula for a decreasing function is:
[0123] ;
[0124] In the formula, and These represent the probability of strategy selection at the beginning and end of the iteration, respectively; This represents the maximum number of iterations.
[0125] Then, generate a random decision variable ξ ~Uniform(0,1). Let ξ represent a random variable that follows a uniform distribution; if the random decision variable ξ is less than or equal to ξ... Then, mirage points are generated according to the elite perturbation guidance strategy. Otherwise, mirage points will be generated using a diversity-guided exploration strategy. .
[0126] The elite perturbation guidance strategy is as follows: An elite particle position is randomly selected from the set of elite particles with the highest current fitness ranking (a subset of particles whose fitness value ranks highest among all particles in the current iteration). And apply a decaying random perturbation. :
[0127] ;
[0128] ;
[0129] In the formula, and Indicates the upper and lower bounds of the search space; A random vector whose dimensions follow a standard normal distribution, used to provide the random direction of the perturbation; This represents element-wise multiplication; The amplitude of the attenuated disturbance: , This represents the initial value of the perturbation amplitude. This strategy aims to perform a fine-grained search (development) of currently promising areas.
[0130] The diversity exploration guidance strategy is as follows: Randomly and uniformly sample a point within the global search space:
[0131] ;
[0132] This strategy aims to break the clustering patterns that the population may form and inject new search directions (exploration) into unexplored areas.
[0133] In this embodiment, to further improve algorithm performance, the key control parameters of MG-PSO are all designed to vary with the number of iterations. Adaptive adjustment. This includes inertia weights. A linear decreasing strategy is adopted, with a large initial value favoring global exploration and a small final value favoring local development. The formula is as follows:
[0134] ;
[0135] In the formula, , These are the maximum and minimum values of the inertia weight, respectively. The growth rate of the cognitive coefficient; This represents the initial value of the individual's cognitive coefficient.
[0136] Cognitive and social coefficients and It can be set to a constant, or a slow increment strategy can be used to enhance the development capabilities in the later stages of iteration. The formula is:
[0137] ;
[0138] In the formula, Indicates the growth rate of the social cognition coefficient; This represents the initial value of the social cognition coefficient.
[0139] Mirage guidance coefficient This is the most distinctive parameter of this algorithm; its baseline value is not fixed but coupled with the convergence state of the front-end NGN. The final learning rate of the NGN... This reflects the stability of the feature structure it has learned. The baseline value is proportional to it, ensuring that the guiding strength of the optimization process matches the reliability of feature learning; at the same time, It also increases with the number of iterations. Attenuation causes the effect of mirages to gradually weaken in the later stages of optimization. The calculation formula is:
[0140] ;
[0141] In the formula, The baseline value representing the mirage guiding coefficient; and These represent the final training value and the reference baseline value of the learning rate of the neural gas network, respectively. This indicates a decrease in rate.
[0142] In the core iteration of MG-PSO, this is achieved by modifying its mirage point generation mechanism. Furthermore, the mirage generation strategy is extended to form a dual-channel guiding source. When the random decision variable ξ is less than or equal to... At that time, a mirage appeared. Generated with equal probability (or adjustable proportion) from the following two channels: first, through NGN guidance, randomly from the mapped NGN weight set. Select a feature anchor point Generate a virtual boot point guided by NGN: Secondly, following the elite perturbation guidance strategy, the algorithm selects from the current elite particle set. The introduction of the "NGN structural channel" allows the algorithm to not only conduct local exploration around the currently found high-quality solutions (elite particles) during iteration, but also continuously receive inspiration from the global static structure of the image (NGN anchor points). This is equivalent to setting up some image-based prior "landmarks" during the optimization process. Even if the population stagnates in a certain area, these landmarks can provide traction to escape the local attraction domain, structurally ensuring global exploration capabilities.
[0143] In this embodiment, the goal of the algorithm is to find the optimal... Make the fitness function Minimum fusion fitness function with consistent fusion features for:
[0144] ;
[0145] ;
[0146] In the formula, is the candidate segmentation threshold vector to be optimized; K is the preset number of thresholds, which is set according to the grayscale complexity of the oil film, for example, K=2~4, used to control the segmentation fineness. The larger K is, the more grayscale regions can be divided. This represents the segmentation quality item, which is measured by the segmentation threshold vector. Uniformity of pixel grayscale within each defined segmentation region (class); The pixel ratio of the k-th class; Let V be the grayscale variance of the k-th class of pixels; and These are weighting coefficients used to balance segmentation quality and feature consistency; The NGN feature consistency reward term is defined as follows:
[0147] ;
[0148] In the formula, For adaptive matching sensitivity parameters; The d-th segmentation threshold in the candidate segmentation threshold vector To the nearest NGN extracted feature anchor point The distance is defined as: When the segmentation threshold Approaching feature anchor point hour, The value increases through the multiplier. A reward is given by decreasing the fitness value F. Furthermore, a random penalty is imposed on invalid thresholds. The oil film segmentation results based on the N-MGPSO algorithm are as follows: Figure 7 As shown.
[0149] Finally, in S5, the segmented image based on the optimal segmentation threshold is post-processed to obtain the final oil film detection result.
[0150] According to an embodiment of the present invention, after obtaining the segmentation result using the N-MGPSO algorithm, the segmentation quality needs to be further optimized through an edge processing step. Specifically, the segmentation result is first binarized to extract candidate oil film regions; then, a ROI mask is used to remove background interference and retain the target within the region of interest; next, the edges of the ROI mask are extracted using the Sobel operator, and morphological dilation is used to expand the edge range and enhance edge continuity; finally, the dilated edges are deleted from the segmentation result, effectively eliminating the influence of ROI edge noise and artifacts, thereby obtaining a clearer and more accurate oil film segmentation result. The final oil film detection result is as follows: Figure 8 As shown.
[0151] Another embodiment of the present invention proposes an oil film detection system based on region perception and structure guidance, the system being used to implement the oil film detection method based on region perception and structure guidance described in the above embodiment; the system includes:
[0152] The data preprocessing module is configured to preprocess the acquired raw radar image data.
[0153] A feature point detection module is configured to perform feature point detection on the preprocessed image using an improved KAZE feature detector; the improved KAZE feature detector improves the diffusion mode to a region diffusion mode based on local consistency.
[0154] The region of interest extraction module is configured to convert the detected discrete feature points into a continuous probability density field, and extract high-density regions from the continuous probability density field as regions of interest, thereby generating an image of interest.
[0155] The optimal segmentation module is configured to obtain the optimal segmentation threshold using a mirage particle swarm optimization algorithm guided by a neural gas network, and to segment the interest image using the optimal segmentation threshold to obtain a segmented image based on the optimal segmentation threshold.
[0156] An oil film detection module is configured to post-process the segmented image based on the optimal segmentation threshold to obtain the final oil film detection result.
[0157] The function of the oil film detection system based on region perception and structure guidance described in this embodiment of the invention can be explained by the aforementioned oil film detection method based on region perception and structure guidance. Therefore, for the parts not described in detail in the system embodiment, please refer to the above method embodiment, and they will not be repeated here.
[0158] 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 method for detecting oil film based on region perception and structure guidance, characterized in that, include: S1. Preprocess the acquired raw radar image data; S2. Feature point detection is performed on the preprocessed image using an improved KAZE feature detector; the improved KAZE feature detector modifies the diffusion pattern to a region diffusion pattern based on local consistency; the region diffusion pattern based on local consistency includes: in the transfer function used to control the diffusion intensity Introducing a local grayscale consistency factor Then the new transmission function is constructed. for: ; In the formula, Represents the image after Gaussian smoothing At pixel position The gradient vector at that point, Indicates the scale control factor; Indicates the gradient threshold; , Indicates the enhancement coefficient. This represents the adjustment coefficient. Indicates the local grayscale standard deviation; S3. The detected discrete feature points are transformed into a continuous probability density field, and high-density regions are extracted from the continuous probability density field as regions of interest, thereby generating an interest image. Specific steps include: using a kernel density estimation method to calculate the density value at any pixel location on the image plane based on the detected feature point set, thereby obtaining a continuous probability density field; normalizing the continuous probability density field to obtain a normalized density field; based on the normalized density field, using the Otsu's maximum inter-class variance method to determine the optimal segmentation threshold between the region of interest and the background region, and generating a binary mask based on the optimal segmentation threshold; performing a pixel-by-pixel multiplication of the binary mask with the preprocessed image to generate the interest image. S4. Obtain the optimal segmentation threshold using a mirage particle swarm optimization algorithm guided by a neural gas network, and segment the interest image using the optimal segmentation threshold to obtain a segmented image based on the optimal segmentation threshold; the specific steps include: extracting a set of feature anchor points representing gray-level distribution from the input interest image using a neural gas network; based on the feature anchor point set, using a particle swarm optimization algorithm that incorporates a mirage guidance mechanism, searching for the optimal segmentation threshold by minimizing the fusion fitness function; S5. Post-process the segmented image based on the optimal segmentation threshold to obtain the final oil film detection result.
2. The oil film detection method based on region perception and structure guidance according to claim 1, characterized in that, The preprocessing described in S1 includes the following steps performed sequentially: coordinate transformation, detection and suppression of co-frequency interference, speckle noise filtering, grayscale correction, and contrast enhancement.
3. The oil film detection method based on region perception and structure guidance according to claim 1, characterized in that, The mirage guidance mechanism described in S4 is implemented through the following velocity update equation: ; In the formula, Let represent the velocity vector of particle i at the (t+1)th iteration; Let represent the velocity vector of particle i at the t-th iteration; This represents the inertial weight, used to control the motion inertia of particle i; , , All represent learning factors, used to modulate the individual cognitive coefficient, social cognitive coefficient, and mirage guidance coefficient, respectively; , , Both represent random numbers that are uniformly distributed within the interval [0,1]. This represents the mirage point assigned to particle i; This represents the individual historical best position of particle i; G(t) represents the position vector of particle i; G(t) represents the global optimal position of the population.
4. The oil film detection method based on region perception and structure guidance according to claim 3, characterized in that, The inertial weight With the number of iterations The formula for adaptive adjustment is: ; In the formula, , These are the maximum and minimum values of the inertia weight, respectively. Indicates the maximum number of iterations; Learning factor , , With the number of iterations The formulas for adaptive adjustment are as follows: ; ; ; In the formula, This indicates the growth rate of an individual's cognitive coefficient; This represents the initial value of the individual's cognitive coefficient; Indicates the growth rate of the social cognition coefficient; This represents the initial value of the social cognition coefficient; The baseline value representing the mirage guiding coefficient; and These represent the final training value and the reference baseline value of the learning rate of the neural gas network, respectively. This indicates a decrease in rate.
5. The oil film detection method based on region perception and structure guidance according to claim 4, characterized in that, The mirage point The generation process includes: Calculate the probability of strategy selection The formula is: ; In the formula, and These represent the probability of strategy selection at the beginning and end of the iteration, respectively; Generate a random decision variable ξ ~ Uniform(0,1); Represents a random variable that follows a uniform distribution; If the random decision variable ξ is less than or equal to Then, mirage points are generated according to the elite perturbation guidance strategy or the NGN guidance strategy. Otherwise, mirage points will be generated using a diversity-guided exploration strategy. Among them, mirage points are generated according to the elite perturbation guidance strategy. The formula is: ; In the formula, This indicates the position of a randomly selected elite particle. This indicates a random perturbation. ,in Indicates the amplitude of the decaying disturbance: , This represents the initial value of the disturbance amplitude. and These represent the upper and lower bounds of the search space, respectively. This represents a random vector whose dimensions follow a standard normal distribution, used to provide the random direction of the perturbation. This represents element-wise multiplication; Generate mirage points according to NGN guidance strategy. The formula is: ; In the formula, This represents a feature anchor point randomly selected from the set of feature anchor points; Generate mirage points using a diversity-guided exploration strategy. For example: Randomly and uniformly sample a point within the global search space, the formula is: 。 6. The oil film detection method based on region perception and structure guidance according to claim 3, characterized in that, The fusion fitness function is: : ; In the formula, This represents the candidate segmentation threshold vector to be optimized. This represents a segmentation quality item, used to measure the uniformity of pixel grayscale within each segmented region defined by the segmentation threshold vector. , The pixel ratio of the k-th class. Let V be the grayscale variance of the k-th class pixel. Indicates the preset threshold number; and These are weighting coefficients, used to balance segmentation quality and feature consistency, respectively. The feature consistency reward term for neural gas networks is defined as follows: ; in, This represents the adaptive matching sensitivity parameter; Represents the candidate segmentation threshold vector The d-th segmentation threshold The distance to the nearest feature anchor point w extracted by the neural gas network.
7. The oil film detection method based on region perception and structure guidance according to claim 1, characterized in that, The specific steps of S5 include: binarizing the segmented image based on the optimal segmentation threshold to extract oil film candidate regions; removing background interference using ROI masks and retaining targets within the oil film candidate regions; extracting the edges of the ROI masks using the Sobel operator and expanding the edge range using morphological dilation operations; deleting the dilated edges from the oil film candidate regions to obtain the final oil film detection results.
8. An oil film detection system based on region sensing and structure guidance, characterized in that, The system is used to implement the oil film detection method based on region sensing and structure guidance as described in any one of claims 1-7; the system includes: The data preprocessing module is configured to preprocess the acquired raw radar image data. A feature point detection module is configured to perform feature point detection on the preprocessed image using an improved KAZE feature detector; the improved KAZE feature detector improves the diffusion mode to a region diffusion mode based on local consistency. The region of interest extraction module is configured to convert the detected discrete feature points into a continuous probability density field, and extract high-density regions from the continuous probability density field as regions of interest, thereby generating an image of interest. The optimal segmentation module is configured to obtain the optimal segmentation threshold using a mirage particle swarm optimization algorithm guided by a neural gas network, and to segment the interest image using the optimal segmentation threshold to obtain a segmented image based on the optimal segmentation threshold. An oil film detection module is configured to post-process the segmented image based on the optimal segmentation threshold to obtain the final oil film detection result.
Citation Information
Patent Citations
Sea surface oil spill detection method and system based on Faster RCNN
CN113901945A
Oil film detection method and system based on hierarchical self-organizing network and scale self-adaption
CN120259803A