Visible light water surface target detection method based on frequency domain and space domain feature enhancement
By fusing frequency and spatial domain features and employing a multi-scale detection architecture, the problem of low target detection accuracy in complex water surface scenarios is solved. This enables efficient identification and interference suppression of small targets at long distances, improving the reliability and consistency of detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies struggle to effectively distinguish water surface targets from interference such as wave reflections and water wave artifacts in complex water surface scenarios, and their ability to capture the features of small targets at a distance is insufficient, resulting in low detection accuracy.
By acquiring and preprocessing visible light water surface scene images, high-frequency features in the frequency domain are extracted and fused with global and local features in the spatial domain to generate dual-domain fusion features. Combined with a multi-scale detection architecture, target edge details are extracted and global semantic association analysis is performed to eliminate interfering candidates and perform overlapping target decoupling processing to generate the final detection result.
It improves the detection accuracy and reliability in complex water surface scenarios, enhances the ability to identify small targets at a distance, reduces false detections and missed detections, and provides higher precision water surface target detection results.
Smart Images

Figure CN121640182A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision and target detection technology, and more specifically, to a visible light water surface target detection method and apparatus based on frequency domain spatial domain feature enhancement. Background Technology
[0002] Visible light surface target detection is widely used in smart ocean construction, maritime safety supervision, and environmental monitoring. Its core requirement is to accurately identify targets such as ships, buoys, and floating objects from complex water surface images, providing data support for maritime operations, disaster assessment, and ecological protection. With the popularization of unmanned monitoring equipment, the requirements for the real-time performance and robustness of surface target detection are becoming increasingly stringent, especially in complex scenarios such as long-range small targets, dense obstructions, and dynamic water surface interference, where high-precision detection solutions are urgently needed.
[0003] In existing technologies, a typical water surface target detection scheme employs a single spatial domain feature extraction architecture. It uses a convolutional neural network to perform multi-scale feature mining on water surface images, combining anchor box matching and classification regression to achieve target localization and recognition. This scheme first preprocesses the image to reduce noise interference, then extracts spatial features at different levels through a feature pyramid network, and finally outputs the target category and location information through a detection head.
[0004] However, this scheme has obvious technical drawbacks: relying solely on spatial domain features makes it difficult to effectively distinguish water surface targets from interference such as wave reflections and water wave artifacts, and it lacks the ability to capture features of small targets at a distance, resulting in low detection accuracy in complex water surface scenarios and failing to meet the needs of high-precision monitoring. Summary of the Invention
[0005] To address the aforementioned technical issues, this application provides a visible light water surface target detection method based on frequency domain spatial domain feature enhancement, thereby alleviating the problem of low detection accuracy in complex water surface scenarios in existing technologies.
[0006] The technical solutions provided in this application are as follows: A visible light water surface target detection method based on frequency domain and spatial domain feature enhancement includes the following steps: Step 1: Obtain a visible light water surface scene image, preprocess it to obtain a preprocessed water surface image, extract high-frequency features in the frequency domain of the image from the preprocessed water surface image and generate high-frequency enhancement features in the spatial domain accordingly, and extract global and local features in the spatial domain from the preprocessed water surface image to fuse with the high-frequency features in the frequency domain of the image to generate dual-domain fusion features. Step 2: Based on the constructed multi-scale detection architecture, extract shallow small target features from the dual-domain fusion features and perform global semantic association analysis to obtain deep global association features. Combine the shallow small target features to generate multi-scale target candidate features. Step 3: Remove interfering candidates such as wave reflection and water wave artifacts from the multi-scale target candidate features to generate the initial target detection results; Step 4: Perform overlapping target decoupling processing on the initial target detection results to obtain overlapping target candidate pairs, so as to generate the final detection results of visible light water surface targets.
[0007] Optionally, the preprocessing of the visible light water surface scene image in step 1 specifically includes: Step 111: Normalize the grayscale of the visible light water surface scene image to unify the grayscale range of the image and generate a grayscale normalized image; Step 112: Perform noise filtering on the grayscale normalized image to reduce random noise interference on the water surface and generate a noise-filtered image as a preprocessed water surface image.
[0008] A visible light water surface target detection device based on frequency domain and spatial domain feature enhancement, comprising: The preprocessing and feature extraction module is used to acquire visible light water surface scene images, preprocess them to obtain preprocessed water surface images, extract high-frequency features in the frequency domain of the image from the preprocessed water surface images and generate high-frequency enhanced features in the spatial domain accordingly, and extract global and local features in the spatial domain from the preprocessed water surface images to fuse with the high-frequency features in the frequency domain of the image to generate dual-domain fusion features. The multi-scale candidate generation module is used to extract shallow small target features from the dual-domain fusion features based on the constructed multi-scale detection architecture, and to obtain deep global association features by performing global semantic association analysis. The shallow small target features are then combined to generate multi-scale target candidate features. The interference removal module is used to remove interference candidates such as wave reflection and water wave artifacts from multi-scale target candidate features and generate initial target detection results. The overlap decoupling and result generation module is used to perform overlap target decoupling processing on the initial target detection results to obtain overlapping target candidate pairs and generate the final detection results of visible light water surface targets.
[0009] The technical solution provided in this application has the following technical advantages: This application obtains preprocessed water surface images through preprocessing, simultaneously extracts high-frequency features in the frequency domain and global-local features in the spatial domain, and fuses them to generate dual-domain fusion features. This solves the problem that traditional single spatial domain feature extraction struggles to distinguish between the target and water surface interference. High-frequency features in the frequency domain can accurately capture key information such as target edges and textures, effectively suppressing high-frequency noise interference such as wave reflections and water wave artifacts. Global-local features in the spatial domain take into account both local target details and global scene correlations. The dual-domain fusion features formed by fusing these two features possess richer representational capabilities, making the model more adaptable to complex water surface scenes.
[0010] A multi-scale detection architecture is constructed based on dual-domain fusion features. It enhances the capture of distant small targets through shallow small target features and improves the extraction of global correlation information of targets through deep global correlation features. Compared with traditional multi-scale detection schemes, this architecture better matches the "globally sparse, locally dense" distribution characteristics of water surface targets. The shallow feature layer's small-scale detection head can retain more high-resolution detail information and has better recognition capabilities for distant targets that occupy a small proportion of the target. The deep long-distance dependency extraction module strengthens the global correlation between the target and the background through window segmentation and interactive fusion, reducing missed detections in densely occluded scenes and improving the recognizability of multi-scale target candidate features.
[0011] By eliminating interference candidates such as wave reflections and water wave artifacts from multi-scale target candidate features, the problem of false detection caused by dynamic water surface interference is specifically solved. By constructing interference judgment parameters by calculating edge ambiguity and gray-level variance, interference candidates such as reflections and artifacts can be accurately identified. Compared with the traditional indiscriminate screening method, the screening logic is more in line with the visual characteristics of water surface interference, making the reliability of the initial target detection results higher.
[0012] The initial target detection results are processed to decouple overlapping targets. By using high-frequency edge feature completion and position calibration, overlapping targets are effectively separated, solving the problem of inaccurate segmentation of overlapping targets in traditional methods. High-frequency edge information from dual-domain fusion features is used to reconstruct the texture of overlapping regions, ensuring the accuracy of overlapping target boundaries. The calibrated target positions more closely match actual physical locations. The final visible light water surface target detection results exhibit high reliability and consistency in complex scenarios, providing stronger data support for applications such as maritime safety supervision and environmental monitoring. Attached Figure Description
[0013] Figure 1 This application provides an embodiment of a visible light water surface target detection method based on frequency domain spatial domain feature enhancement.
[0014] Figure 2 This application provides an embodiment of a visible light water surface target detection device based on frequency domain spatial domain feature enhancement.
[0015] Figure 3 This is an electronic device according to an embodiment of the present application. Detailed Implementation
[0016] like Figure 1 The image shows an embodiment of the visible light water surface target detection method based on frequency domain and spatial domain feature enhancement, comprising the following steps: Step 1: Obtain a visible light water surface scene image, preprocess it to obtain a preprocessed water surface image, extract high-frequency features in the frequency domain of the image from the preprocessed water surface image and generate high-frequency enhancement features in the spatial domain accordingly, and extract global and local features in the spatial domain from the preprocessed water surface image to fuse with the high-frequency features in the frequency domain of the image to generate dual-domain fusion features. Step 2: Based on the constructed multi-scale detection architecture, extract shallow small target features from the dual-domain fusion features and perform global semantic association analysis to obtain deep global association features. Combine the shallow small target features to generate multi-scale target candidate features. Step 3: Remove interfering candidates such as wave reflection and water wave artifacts from the multi-scale target candidate features to generate the initial target detection results; Step 4: Perform overlapping target decoupling processing on the initial target detection results to obtain overlapping target candidate pairs, so as to generate the final detection results of visible light water surface targets.
[0017] Optionally, the preprocessing of the visible light water surface scene image in step 1 specifically includes: Step 111: Normalize the grayscale of the visible light water surface scene image to unify the grayscale range of the image and generate a grayscale normalized image; Step 112: Perform noise filtering on the grayscale normalized image to reduce random noise interference on the water surface and generate a noise-filtered image as a preprocessed water surface image.
[0018] In this application, steps 111 and 112 address the problem of blurred target features caused by uneven illumination, strong water surface reflection, and random noise (wave texture, ambient stray light) in visible light water surface scenes (such as marine monitoring and inland river security). Through scene-adaptive grayscale normalization and noise filtering mechanisms, key features such as the edge and texture of the water surface target are accurately preserved while unifying the grayscale range of the image. This provides a pre-processed image with a high signal-to-noise ratio for subsequent frequency domain and spatial domain feature extraction, adapting to the detection needs of distant small targets and densely occluded scenes.
[0019] Preferably, the specific implementation process of step 111 is as follows: First, the visible light water surface scene image is divided into regions, uniformly divided into multiple sub-regions according to the image pixel coordinates (the size of the sub-regions is dynamically adjusted according to the image resolution, usually from 64×64 pixels to 256×256 pixels, for example, a 1920×1080 pixel image is divided into 30×18 64×64 pixel sub-regions). Each sub-region corresponds to a local area in the water surface scene, avoiding local feature distortion caused by global normalization. The gray mean μ and gray standard deviation σ of each sub-region are calculated. Based on the gray statistical values of the sub-regions, an adaptive normalization mapping of the scene is constructed. The target gray range of the normalization mapping is dynamically adjusted according to the light intensity of the water surface scene (the target range is set to 50-200 when the light is strong and 80-180 when the light is weak). The pixel grayscale values within each sub-region are normalized. A mapping formula is used to transform the original grayscale values to the target range. A grayscale smoothing factor is introduced between sub-regions (the difference in normalization results between adjacent sub-regions does not exceed 10) to avoid abrupt grayscale changes at sub-region boundaries. The normalization results of all sub-regions are then stitched together to generate a grayscale-normalized image. This image unifies the overall grayscale range while preserving local grayscale differences between the target and background, providing a clear grayscale foundation for subsequent feature extraction.
[0020] Preferably, the specific technical implementation of the normalization calculation of pixel gray values within the sub-region and the gray smoothing between sub-regions in step 111 is as follows: First, for each sub-region, based on the calculated gray mean μ and gray standard deviation σ, a sub-region-specific mapping formula is constructed. This mapping formula takes the original pixel gray value as input and maps it to the preset target gray range [G_min, G_max] through linear transformation. In the mapping process, a standard deviation correction term is introduced, that is, the difference between the original gray value and the gray mean of the sub-region is divided by the gray standard deviation, and then multiplied by the span of the target range. Finally, the minimum value of the target range is added to ensure the uniformity of gray distribution within the sub-region. For example, when the gray mean μ of the sub-region is 120, the standard deviation σ is 30, and the target range is [60, 180], the mapping result of an original gray value of 150 is 60 + (150-120) / 30×(180-60)=180. The mapping operation is performed on all pixels in each sub-region to obtain a sub-region normalized image. The gray values of each sub-region normalized image fall within the target range, and the gray value difference between the target and the background within the sub-region is preserved. Then, grayscale smoothing processing between sub-regions is initiated. All adjacent sub-region pairs (including horizontally adjacent, vertically adjacent, and diagonally adjacent sub-regions) are traversed. The grayscale difference at the overlapping boundary of the normalized image of the adjacent sub-regions is calculated. If the grayscale difference at a certain boundary exceeds a preset threshold (usually 10, which can be dynamically adjusted according to the overall contrast of the image), the grayscale value of the pixel at the boundary is adjusted by gradient adjustment. The adjustment method is to extend a preset number of pixels (usually 3-5 pixels, such as 4 pixels) from the boundary to both sides of the sub-region to form a transition zone. The grayscale value of the pixel in the transition zone is corrected according to a linearly decreasing weight, so that the grayscale value of the adjacent sub-regions transitions smoothly in the transition zone. For example, if the grayscale value of the pixel at the boundary of the left sub-region is 180 and that of the right sub-region is 165, and the difference of 15 exceeds the threshold of 10, then the pixel on the left in the transition zone decreases by gradients of 180, 177, 174, and 171, and the pixel on the right is connected by gradients of 168 and 165, ensuring that the difference in the normalized result of the adjacent sub-regions does not exceed the threshold. After normalizing all sub-regions and smoothing adjacent sub-regions, the normalized images of all sub-regions are stitched together according to the pixel coordinates of the original image to generate a complete grayscale normalized image. This image not only unifies the overall grayscale range but also eliminates grayscale abrupt changes at the boundaries of sub-regions. At the same time, it preserves key grayscale features such as the edges and textures of the water surface targets, providing a high-quality image foundation for subsequent noise filtering and feature extraction.
[0021] Preferably, in the specific technical implementation of step 112, a noise filtering model specifically for water surface scenes is first constructed. This model includes a texture preservation branch and a noise suppression branch, adapting to the coexistence of noise and target texture in water surface scenes. The texture preservation branch uses a direction-sensitive convolution kernel, with the kernel direction aligned with the edge texture direction of the water surface target (such as ship outlines or buoy edges). The kernel weights are dynamically adjusted by calculating the texture gradient direction of pixels to enhance the preservation of target texture features. The noise suppression branch uses adaptive median filtering, with the filter window size dynamically adjusted according to the grayscale fluctuation of pixels (5×5 pixels when grayscale fluctuation is large, and 3×3 pixels when fluctuation is small), focusing on suppressing randomly distributed salt-and-pepper noise and Gaussian noise. The grayscale normalized image is processed in parallel by two branches. The texture preservation branch outputs a texture enhancement feature map, and the noise suppression branch outputs a noise reduction image. The two are then weighted and fused according to pixel position, with the fusion weights allocated according to the texture confidence of the pixels (the texture enhancement feature map accounts for 60%-70% of the weight when the texture confidence is high). After fusion, the image undergoes edge sharpening. By calculating the gradient magnitude of pixels, the grayscale difference between the target edge and the background is enhanced, ultimately generating a noise-filtered image. This image reduces random noise interference on the water surface while fully preserving the edge and texture features of the target. It serves as a preprocessed water surface image for subsequent frequency and spatial domain feature extraction.
[0022] Optionally, step 1 involves extracting high-frequency features in the image frequency domain and generating high-frequency enhanced features in the spatial domain, specifically including: Step 113: Convert the pixel domain information of the preprocessed water surface image into a frequency domain complex matrix and separate its real and imaginary components to generate a frequency domain separation matrix; Step 114: Calculate the amplitude spectrum of the frequency domain separation matrix to filter and retain the high-frequency components corresponding to the target edges and textures from the amplitude spectrum, and generate high-frequency component filtering results; Step 115: Perform frequency-channel weighting on the high-frequency component screening results to enhance the target-related high-frequency signals and generate high-frequency weighted features; Step 116: Reassemble the high-frequency weighted features and the low-frequency components in the frequency domain separation matrix into a new frequency domain complex matrix, and convert it into a spatial domain high-frequency enhancement feature through inverse Fourier transform.
[0023] In steps 113 to 116 of this application, to address the problem that the target edge texture is easily interfered with by wave reflection and water wave artifacts in visible light water surface scenes (such as marine monitoring and inland river security), the application uses precise conversion from pixel domain to frequency domain, adaptive screening of target-related high-frequency components, targeted weighting enhancement, and frequency domain reconstruction inverse transformation to suppress dynamic interference from the water surface while preserving the key high-frequency features of the target. This generates spatial domain high-frequency enhancement features that combine detail recognition and anti-interference capabilities, providing high signal-to-noise ratio frequency domain feature support for subsequent dual-domain fusion and target detection.
[0024] Preferably, the specific implementation process of step 113 is as follows: First, a preprocessed water surface image is acquired. This image has undergone grayscale normalization and noise filtering to reduce basic interference. Its pixel domain information exists in the form of a two-dimensional pixel matrix. The rows and columns of the matrix correspond to the vertical and horizontal pixel coordinates of the image, respectively, and the matrix elements are the grayscale values of the corresponding pixels. A two-dimensional fast Fourier transform is performed on this two-dimensional pixel matrix to convert the grayscale distribution information of the pixel domain into a frequency domain complex matrix. The rows and columns of the frequency domain complex matrix correspond to the horizontal and vertical frequency components of the frequency domain, respectively. Each element in the matrix is in complex form, containing a real part and an imaginary part. The real part reflects the magnitude of the corresponding frequency component, and the imaginary part reflects the phase information of the corresponding frequency component. Through channel separation, the real and imaginary parts of the frequency domain complex matrix are extracted to form two matrices with the same dimensions as the frequency domain complex matrix: a real matrix and an imaginary matrix. These two matrices together form a frequency domain separation matrix. The frequency domain separation matrix completely preserves the amplitude and phase information of the preprocessed water surface image in the frequency domain, laying the foundation for subsequent high-frequency component selection.
[0025] Preferably, in the specific technical implementation of step 114, the amplitude of each frequency component is calculated based on the real and imaginary parts of the frequency domain separation matrix. The amplitude calculation results constitute a frequency domain amplitude spectrum matrix, where the rows and columns still correspond to the horizontal and vertical frequency components in the frequency domain, and the matrix elements represent the amplitude of the corresponding frequency component. Combining the target features of the water surface scene, a scene-adaptive high-frequency threshold calculation model is designed. This model takes the grayscale mean and variance of the frequency domain amplitude spectrum matrix as input and dynamically adjusts the threshold size according to the complexity of the water surface scene. Scene complexity is calculated through the texture roughness of the preprocessed water surface image (a texture roughness higher than a preset value is considered high complexity). In high-complexity scenes, the threshold is lowered to retain more target edge details, while in low-complexity scenes, the threshold is increased to reduce redundant high-frequency noise. Based on the calculated high-frequency threshold, the frequency domain amplitude spectrum matrix is filtered to retain high-frequency components with amplitudes higher than the threshold that correspond to the target edge and texture, generating high-frequency component filtering results. These results are presented in the form of a frequency domain mask matrix, where 1 corresponds to the position of the retained high-frequency component and 0 corresponds to the position of the removed low-frequency component and interfering high-frequency component.
[0026] Preferably, the specific implementation process of step 115 is as follows: A frequency channel weight allocation model is constructed. This model includes a target frequency feature library and a weight learning layer. The target frequency feature library is constructed based on the frequency domain feature statistics of a large number of surface targets (ships, buoys, floating objects), storing typical frequency channel information corresponding to the edges and textures of different types of targets. The weight learning layer takes the high-frequency component screening results and the target frequency feature library as input. By calculating the similarity between the screened high-frequency components and typical frequency channels, an adaptive weight is assigned to each frequency channel. The higher the similarity, the greater the weight, thus strengthening the target-related high-frequency signals and weakening the high-frequency signals related to surface interference. The weight matrix output by the frequency channel weight allocation model is multiplied element-wise with the frequency domain complex matrix corresponding to the high-frequency component screening results to obtain the high-frequency weighted frequency domain complex matrix, i.e., the high-frequency weighted feature. This feature highlights the high-frequency information corresponding to the target edges and textures, suppresses high-frequency noise corresponding to interference such as wave reflections and water wave artifacts, and provides optimized high-frequency components for subsequent frequency domain reconstruction.
[0027] Preferably, in the specific implementation of step 116, low-frequency components not selected by the high-frequency component screening results are extracted from the frequency domain separation matrix to form a low-frequency component matrix. This matrix retains the overall grayscale distribution and low-frequency structural information of the preprocessed water surface image. The high-frequency weighted features and the low-frequency component matrix are recombined according to the frequency channel position to generate a new frequency domain complex matrix. The recombining process ensures that the high-frequency components and low-frequency components are accurately aligned on the corresponding frequency channels without destroying the integrity of the frequency domain information. An inverse two-dimensional fast Fourier transform is performed on the new frequency domain complex matrix to convert the frequency domain information back to the pixel domain, obtaining a spatial domain high-frequency enhancement feature. The pixel size of this feature is consistent with the preprocessed water surface image, which not only retains the clear details of the target edges and textures but also maintains the overall structure of the image. At the same time, it reduces the impact of dynamic water surface interference, providing high-quality frequency domain enhancement feature support for subsequent fusion with spatial domain global and local features, and adapting to the needs of long-distance small target detection in complex water surface scenes.
[0028] Optionally, step 1 extracts global and local features in the spatial domain, specifically including: Step 117: Input the preprocessed water surface image into the downsampling layer, and generate initial spatial features by downsampling the preprocessed water surface image through convolution with a preset stride. Step 118: Process the initial spatial features through multiple sets of residual blocks. Each set of residual blocks sequentially performs dimensionality reduction, feature extraction, and dimensionality increase operations to generate local detail features in the spatial domain. Step 119: Perform pyramid pooling on the local detail features of the spatial domain to obtain multi-scale global information through multiple pooling kernels of different sizes. The multi-scale global information is concatenated and then compressed through convolutional compression channels to generate global semantic features of the spatial domain. Step 120: Align the spatial domain local detail features and spatial domain global semantic features by pixel position, and assign feature weights through a channel attention mechanism. Then, perform adaptive fusion processing on the spatial domain local detail features and spatial domain global semantic features after feature weight alignment to generate spatial domain global local features that reflect the relationship between the target local texture and the global scene.
[0029] In steps 117 to 120 of this application, in response to the problem that targets in visible light water surface scenes (such as marine monitoring and inland waterway security) are globally sparse and locally dense, and are easily affected by waves and reflections, hierarchical feature extraction, multi-scale global information fusion and adaptive weight allocation are used to generate spatial domain global and local features that combine local texture details and global scene association. This provides strong spatial feature support for subsequent dual-domain fusion and adapts to the detection needs of distant small targets and densely occluded targets.
[0030] Preferably, the specific implementation process of step 117 is as follows: First, a preprocessed water surface image is acquired. This image has been normalized to reduce basic interference through grayscale normalization and noise filtering. The pixel dimension is H×W×1 (grayscale image), where H represents the vertical number of pixels in the preprocessed water surface image, corresponding to the height dimension of the water surface scene image (e.g., including the pixel range from the top of the image to the seabed or horizon), and W represents the horizontal number of pixels in the preprocessed water surface image, corresponding to the width dimension of the water surface scene image (e.g., including the pixel range of the sea surface or waterway from the left to the right of the image). The preprocessed water surface image is input into the designed adaptive downsampling layer. This downsampling layer contains two sets of parallel convolutional kernels—target-preserving convolutional kernels and dimensionality-reducing convolutional kernels. The target-preserving convolutional kernels use small-sized odd-numbered convolutional kernels, with a stride set to a value that halves the image resolution. The weights are initialized with a tilt towards the target edge texture direction to enhance the preservation of features such as ship outlines and buoy edges. The dimensionality-reducing convolutional kernels use the smallest-sized single-channel convolutional kernels, with a stride consistent with the target-preserving convolutional kernels, used to compress the channel dimension and reduce the computational load. Two sets of convolution operations are performed simultaneously on the preprocessed water surface image. The two sets of convolution results are then concatenated according to the channel dimension to generate an initial spatial feature with a preset number of channels adapted to subsequent feature extraction and a size that is half the resolution of the original image. This feature reduces the image resolution, preserves key target information, and lays the foundation for subsequent feature extraction.
[0031] Preferably, in the specific technical implementation of step 118, a water surface scene-specific residual block group is constructed, comprising multiple sets of cascaded residual blocks. Each set of residual blocks is designed with a three-stage structure of "dimensionality reduction-feature extraction-dimensionality increase" tailored to the characteristics of the water surface target features. In the dimensionality reduction stage, a minimum-size single-channel convolutional kernel is used to compress the number of channels in the initial spatial features to a preset ratio, reducing computational redundancy. In the feature extraction stage, a small-size odd-depth separable convolution is used, with the kernel weights dynamically adjusted according to the texture direction of the water surface target, enhancing the capture of local details of the target (such as ship railings and buoy textures) while suppressing interference from wave textures. In the dimensionality increase stage, the minimum-size single-channel convolutional kernel is used again to restore the number of channels to be consistent with the input. Each set of residual blocks introduces residual connections, adding the input features and the features processed in the three stages pixel by pixel to avoid gradient vanishing and enhance feature propagation. Multiple sets of residual blocks sequentially process the initial spatial features, ultimately generating local detail features in the spatial domain. These features accurately preserve the local texture and edge information of the target.
[0032] Preferably, the specific implementation process of step 119 is as follows: Local detail features in the spatial domain are obtained, with dimensions (H / 2)×(W / 2)×C (where C is the number of channels). A multi-scale pyramid pooling module is designed, containing multiple sets of pooling kernels of different sizes. The size of the pooling kernels is set according to the common scale distribution gradient of water surface targets. Small-sized pooling kernels capture local global information of near-field targets, while large-sized pooling kernels capture global association information of distant small targets. Multiple pooling operations are performed on the local detail features in the spatial domain to obtain multiple sets of global feature vectors of different scales, each with a dimension of 1×1×C. The multiple sets of global feature vectors are concatenated according to the channel dimension to generate a multi-scale global information concatenation result with a dimension of 1×1×(nC) (where n is the number of pooling kernel sets). The concatenation result is compressed using a set of minimum-size single-channel convolutional kernels to reduce the number of channels to the same level as the number of channels in the local detail features in the spatial domain, generating a global semantic feature in the spatial domain. This feature integrates global scene information at different scales and can reflect the overall association between the target and the water surface background.
[0033] Preferably, in the specific implementation of step 120, the spatial domain local detail features and spatial domain global semantic features are first aligned by pixel position. The spatial domain global semantic features are then upsampled (using bilinear interpolation) to the same size (H / 2)×(W / 2)×C as the spatial domain local detail features. A channel attention allocation model is constructed, which includes a feature response calculation layer and a weight generation layer. The feature response calculation layer calculates the response intensity of the two features in each channel (the response intensity is determined based on the variance and gradient value of the feature pixels). Target-related channels (such as edge texture channels) have higher response intensity, while background interference channels have lower response intensity. The weight generation layer generates channel weight vectors based on the response intensity, with weight values ranging from 0 to 1. Channels with high response intensity are assigned higher weights, and channels with low response intensity are assigned lower weights. The spatial domain local detail features and spatial domain global semantic features are then multiplied by the channel weight vectors channel by channel to obtain the weighted local detail features and the weighted global semantic features. Pixel-wise adaptive fusion is performed on the two sets of weighted features. The fusion coefficient is dynamically adjusted according to the target confidence of the pixel. Pixels with high target confidence are mainly local detail features, while background pixels are mainly global semantic features. Finally, a spatial domain global local feature is generated. This feature not only preserves the local texture details of the target, but also integrates global scene association information, providing high-quality spatial feature input for subsequent dual-domain fusion.
[0034] Optionally, the dual-domain fusion feature is generated in step 1, specifically as follows: Step 121: Perform channel-dimensional concatenation of the high-frequency enhanced features in the spatial domain and the global and local features in the spatial domain to generate a dual-domain feature concatenation result; Step 122: Strengthen the association mapping of key information in the dual-domain feature splicing result by feature attention weighting, so as to generate dual-domain fusion features that include high-frequency information in the frequency domain and global and local information in the spatial domain in the channel dimension.
[0035] In steps 121 and 122 of this application, in order to address the problem that target features in visible light water surface scenes (such as marine monitoring and inland waterway security) are easily interfered with by wave reflection and water wave artifacts, and that there is information separation between frequency domain and spatial domain features, the association mapping of key target association information in dual-domain features is strengthened by precise stitching of channel dimensions and scene-adaptive feature attention weighting. This generates dual-domain fusion features that combine high-frequency details in the frequency domain with global and local associations in the spatial domain, providing core feature support with high recognition and strong anti-interference for subsequent multi-scale target detection.
[0036] Preferably, the specific implementation process of step 121 is as follows: First, obtain the spatial domain high-frequency enhancement features and spatial domain global-local features. The spatial domain high-frequency enhancement features highlight high-frequency details such as target edges and textures, while the spatial domain global-local features reflect the relationship between the target's local texture and the global scene. Both are three-dimensional feature tensors, with the height and width of the tensor corresponding to the pixel coordinates of the image, and the channel dimension corresponding to the feature dimension (the number of channels for spatial domain high-frequency enhancement features is usually 64-256, such as 128 channels; the number of channels for spatial domain global-local features is consistent with this, ensuring splicing compatibility). The two feature tensors are spliced along their channel dimensions, maintaining precise alignment of the pixel coordinates in the height and width dimensions during the splicing process. That is, the frequency domain high-frequency features and spatial domain global-local features at the same pixel position are spliced accordingly, generating a dual-domain feature splicing result. The number of channels in the dual-domain feature splicing result is the sum of the number of channels in the two input features (e.g., 128 + 128 = 256 channels), and its height and width are consistent with the input features, fully preserving the frequency domain high-frequency information and spatial domain global-local information, laying the foundation for subsequent feature attention weighting.
[0037] Preferably, in the specific technical implementation of step 122, a water surface scene-specific feature attention weighting model is constructed. This model includes a channel association learning layer and an adaptive weight allocation layer, adapting to the association characteristics of dual-domain features in water surface scenes. The channel association learning layer takes the dual-domain feature concatenation result as input, and by calculating the mutual information between different channels, it mines the association strength between high-frequency channels in the frequency domain and global and local channels in the spatial domain. The mutual information calculation is based on the statistical regularity of water surface target features, strengthening the association between the frequency domain channel corresponding to the target edge and the local detail channel in the spatial domain, and weakening the association of channels related to water surface interference. The adaptive weight allocation layer generates a channel weight vector based on the channel association strength. The dimension of the weight vector is consistent with the number of channels in the dual-domain feature concatenation result. Each element corresponds to the weight value of a channel. Channels with high target association have larger weight values, while interference-related channels have smaller weight values (the weight value range is 0-1, for example, the target edge channel weight is set to 0.8-0.9, and the interference channel weight is set to 0.1-0.2). The concatenated dual-domain features are multiplied one-way by one with the channel weight vector to obtain the weighted dual-domain fusion features. The channel dimension of this feature contains the correlation mapping between high-frequency information in the frequency domain and global and local information in the spatial domain. It not only preserves the high-frequency details of the target, but also integrates the global correlation information in the spatial domain. This can effectively improve the recognition of target features in complex water surface scenes and provide high-quality feature input for the subsequent generation of multi-scale target candidate features.
[0038] Optionally, the multi-scale detection architecture constructed in step 2 is a feature pyramid network, specifically including: Step 221: Input the dual-domain fusion features into the feature pyramid network to generate multi-scale feature maps with multiple downsampling ratios; Step 222: Based on the small-scale detection head deployed in the shallow feature layer, perform pre-sized convolution processing on the multi-scale feature map to enhance the target edge features and determine the sample target size accordingly. Then, perform statistical clustering on the sample target size distribution through anchor box clustering to generate anchor box sizes that are suitable for distant small targets and generate shallow small target features accordingly. Step 223: Based on the deep feature layer embedding long-distance dependency extraction module, capture the global association between the target and the background on the multi-scale feature map to generate deep global association features; Step 224: Unify the dimensions of shallow small target features and deep global correlation features according to feature scale to generate scale-unified features; Step 225: Perform fusion processing on the scale-uniform features to generate multi-scale target candidate features that retain the discernibility of target features at different scales.
[0039] In steps 221, 222, 224, and 225 of this application, in response to the problems of high proportion and sparse features of distant small targets in visible light water surface scenes (such as marine monitoring and inland river security), and the susceptibility of target features of different scales to dynamic interference from the water surface, feature maps adapted to different scales are generated through a feature pyramid network with multi-level downsampling. Combined with a small-scale detection head, the feature capture of distant small targets is enhanced. After scale unification and fusion processing, multi-scale target candidate features with both recognizability and anti-interference ability are generated, providing accurate feature support for subsequent interference removal and target detection.
[0040] Preferably, the specific implementation process of step 221 is as follows: First, the dual-domain fusion feature is obtained. This feature is a three-dimensional feature tensor, where the height and width of the tensor correspond to the pixel coordinates of the image. The channel dimension contains the correlation mapping between high-frequency information in the frequency domain and global and local information in the spatial domain. The dual-domain fusion feature is input into a feature pyramid network, which includes a top-down feature transfer path and a bottom-up feature enhancement path. The bottom-up path downsamples the dual-domain fusion feature through multiple sets of convolutional blocks to generate intermediate feature maps with multiple downsampling ratios (the downsampling ratios are usually 2x, 4x, 8x, and 16x, for example, 4x, 8x, and 16x downsampled intermediate feature maps are obtained by downsampling the original feature map sequentially). The top-down path aligns the pixels of the high-magnification downsampled intermediate feature map with the low-magnification downsampled intermediate feature map through upsampling operations, and then performs feature fusion through convolutional blocks to strengthen the correlation between features at different scales. Finally, multi-scale feature maps with multiple downsampling ratios are generated. Each downsampling ratio corresponds to target features at different scales. Low-scale downsampling feature maps retain more target details, while high-scale downsampling feature maps contain richer global semantic information, adapting to the detection needs of targets at different scales in water surface scenes.
[0041] Preferably, in the specific technical implementation of step 222, a low-magnification downsampled feature map (such as a 4x downsampled feature map) from the multi-scale feature map is first selected as a shallow feature layer. This feature layer has high resolution and can preserve the detailed features such as edges and textures of distant small targets. A small-scale detection head is deployed in the shallow feature layer. This detection head contains two sets of concatenated convolutional kernels of a preset size (the kernel size is usually 3×3, and the number is 16-64, for example, 32). The shallow feature layer is convolved to enhance the target edge features and suppress the interference of the water surface background, generating an edge-enhanced feature map. Based on the edge enhancement feature map, the pixel size distribution of the target region is statistically analyzed to determine the sample target size range (e.g., the sample target size range for distant small targets is 10-30 pixels). A designed anchor frame clustering algorithm specific to water surface scenes is used to cluster the sample target size distribution. This algorithm dynamically divides clusters based on the statistical distance of the target size, and the center value of each cluster is used as the anchor frame size, generating multiple sets of anchor frame sizes and aspect ratios adapted to distant small targets (e.g., generating 3 sets of anchor frames with sizes of 10×10, 15×15, and 20×20 pixels, all with an aspect ratio of 1:1). The edge enhancement feature map is matched with the generated anchor frames, and valid anchor frames are selected by calculating the overlap between the anchor frames and the target region. Then, features are extracted and optimized from the valid anchor frames through classification and regression branches to generate shallow small target features. These features highlight the key features of distant small targets, improving the recognition of small targets.
[0042] Preferably, the specific implementation process of step 224 is as follows: Shallow small target features and deep global association features are obtained. The shallow small target features correspond to the target detail features of the low-magnification downsampled feature map, and the deep global association features correspond to the target global association features of the high-magnification downsampled feature map. The two have the same channel dimension but different sizes (e.g., the shallow small target feature size is 128×128 pixels, and the deep global association feature size is 32×32 pixels). The deep global association features are upsampled using interpolation (such as bilinear interpolation) to adjust their size to match the shallow small target features, generating size-aligned deep global association features. Simultaneously, the shallow small target features and the size-aligned deep global association features are standardized by channel dimension. By calculating the mean and variance of each channel, the feature values are mapped to the same numerical range, eliminating numerical differences between features at different scales. Based on the standardized features, the channel dimensions are fused and compressed using a 1×1 convolution kernel to ensure uniform feature dimensions and generate scale-uniform features. These features contain both the detailed features of shallow small targets and the global correlation information of deep targets, laying the foundation for subsequent feature fusion.
[0043] Preferably, in the specific technical implementation of step 225, a multi-scale feature fusion module is constructed. This module includes a spatial attention branch and a channel attention branch, adapting to the fusion requirements of features at different scales in water surface scenes. The spatial attention branch takes scale-uniform features as input, calculates the spatial weights of pixels, strengthens the feature response of the target region, weakens the interference of the water surface background, and generates spatial attention-weighted features. The channel attention branch calculates the feature importance of each channel, assigns adaptive weights to different channels, strengthens the features of target-related channels, and generates channel attention-weighted features. The spatial attention-weighted features and the channel attention-weighted features are added and fused pixel by pixel to generate fused features. Then, a set of convolutional blocks is used to perform nonlinear transformation on the fused features to strengthen the nonlinear expressive ability of the features, and finally generates multi-scale target candidate features. This feature retains the feature recognition of targets at different scales, can accurately capture the detailed features of small targets at a distance, and can effectively identify the global features of large-scale targets, while suppressing the influence of dynamic water surface interference, providing high-quality feature input for subsequent interference candidate elimination.
[0044] Optionally, step 223 includes: Step 2231: Divide the multi-scale feature map into windows. Each window contains a preset number of feature pixels. The window size is dynamically adjusted according to the target scale to generate the window partitioning result. Step 2232: Calculate the self-attention weights between feature pixels within each window partitioning result to strengthen the pixel association in the target region and weaken the pixel interference in the background region, thereby generating attention features within the window. Step 2233: Perform interactive fusion processing on cross-window attention features through window shifting operations to supplement global information of targets at window edges and thus generate cross-window interactive features; Step 2234: Perform residual connection between cross-window interaction features and multi-scale feature maps to generate deep global association features that highlight the global association between the target and the surrounding scene.
[0045] In step 223 of this application, in response to the problem that the global semantic information of deep feature maps is scattered in visible light water surface scenes (such as marine monitoring and inland river security), and the boundary between the target and the background is easily disturbed by the dynamics of the water surface, the global association between the target and the background is accurately captured through dynamic window division, attention enhancement within the window, cross-window feature interaction and residual connection, generating deep global association features that have both global semantics and local details, which are suitable for the detection needs of densely occluded targets and distant small targets in complex water surface scenes.
[0046] Preferably, the specific implementation process of step 2231 is as follows: First, a deep feature map (such as a 16x downsampled feature map) is obtained from the multi-scale feature map. This feature map contains rich global semantic information, but the local details of the target are relatively sparse. Based on the statistical distribution of the target scale in the water surface scene, a dynamic window partitioning rule is designed. The window size is dynamically adjusted according to the scale of the target region in the feature map. The deep feature map is traversed by sliding the window, and the target confidence of each candidate region is calculated (based on the feature response intensity). Regions with high target confidence correspond to small windows (window size is usually 8×8 pixels to 16×16 pixels, for example, 8×8 pixels) to preserve the local correlation of the target; background regions with low target confidence correspond to large windows (window size is usually 16×16 pixels to 32×32 pixels, for example, 24×24 pixels) to capture the global background correlation. The deep feature map is completely partitioned according to the dynamic window partitioning rule to ensure that no pixels are missed and there is no overlap, generating window partitioning results. Each window is an independent feature sub-map containing the feature information of the corresponding region.
[0047] Preferably, in the specific technical implementation of step 2232, a water surface scene-specific self-attention calculation model is constructed for the feature sub-image in each window segmentation result. This model includes a feature similarity calculation layer and a weight adaptive allocation layer. The feature similarity calculation layer calculates the similarity of the feature vectors of each pixel in the feature sub-image with other pixels. The similarity calculation is based on the cosine similarity criterion, strengthening the correlation between pixels in the target area (the feature vectors of pixels in the target area have higher similarity) and weakening the correlation between pixels in the background area (the feature vectors of pixels in the background area have lower similarity). The weight adaptive allocation layer introduces a water surface background suppression factor to correct the similarity result, reducing the weight ratio of interfering pixels such as water ripples and reflections (the weight coefficient of interfering pixels is set to 0.1-0.3, for example, 0.2), and increasing the weight ratio of target pixels (the weight coefficient of target pixels is set to 0.7-0.9, for example, 0.8). The corrected similarity result is used as the self-attention weight and fused pixel-by-pixel with the feature sub-image to generate an attention feature within the window. This feature highlights the feature response of the target area within the window and suppresses background interference.
[0048] Preferably, the specific implementation process of step 2233 is as follows: To solve the problem of target edge information fragmentation caused by window division, a bidirectional window shifting interaction mechanism is designed, including horizontal and vertical shifting. The attention features within the window are horizontally shifted by a distance equal to half the window's side length (e.g., 4 pixels for an 8×8 pixel window), causing the edge region features of adjacent windows to overlap. Similarly, a vertical shifting operation is performed to generate the shifted window attention features. The shifted window attention features are then fused pixel-by-pixel with the intra-window attention features of adjacent windows. The fusion weight is assigned based on the pixel's distance from the window center—the closer to the center, the greater the weight, ensuring the dominance of core features. After fusion, a cross-window interaction feature is generated. This feature supplements the global association information of the target at the window edge, eliminating feature fragmentation caused by window division and maintaining the continuity of target features globally.
[0049] Preferably, in the specific implementation of step 2234, cross-window interaction features and the original deep feature map are obtained. The pixel positions of the cross-window interaction features and the original deep feature map are aligned to ensure that the feature dimensions and spatial coordinates are perfectly matched. A residual connection module is constructed, using the cross-window interaction features as enhancement features and the original deep feature map as the base features. Residual fusion is performed by adding pixels one by one, preserving the global semantic information of the original deep feature map while incorporating the target enhancement information of the cross-window interaction features. After fusion, a set of 1×1 convolutional kernels is used for feature dimension compression and information integration, strengthening the global association between the target and the surrounding scene, generating deep global association features. These features contain rich global semantic information and highlight the feature responses of the target region, effectively supporting the generation of subsequent multi-scale target candidate features and improving the robustness of target detection in complex water surface scenes.
[0050] Optionally, step 3 specifically includes: Step 331: Based on historical water surface target size statistics, construct a set of anchor frames specifically for water surface scenarios to generate multiple sets of anchor frame sizes and aspect ratios that are adapted to ships, buoys, and floating objects, thereby generating a set of anchor frames specifically for the scenario. Step 332: Perform IoU matching between the multi-scale target candidate features and the scene-specific anchor box set to filter out positive sample anchor boxes; Step 333: Determine the target category using the positive sample anchor boxes of the classification branch pairs; Step 334: Fine-tune the position and size of the anchor boxes for positive samples using regression branches to generate a preliminary target candidate set; Step 335: Call the water surface dynamic interference suppression rule, calculate the edge ambiguity and gray scale variance of each candidate in the preliminary target candidate set, and generate interference judgment parameters; Step 336: Based on the interference judgment parameters, remove interference candidates with edge ambiguity higher than the threshold and gray-level variance lower than the threshold, and generate interference-removed candidates; Step 337: After removing interference, sort the candidates by confidence level and retain a preset number of candidates to generate an initial target detection result containing target category, confidence level and preliminary location coordinates.
[0051] In steps 331, 332, 333, 334, 336, and 337 of this application, the diverse target types (ships, buoys, floating objects, etc.) and large size differences in visible light water surface scenes (such as marine monitoring and inland waterway security) are addressed. These targets are also susceptible to interference from wave reflections and water wave artifacts. By constructing a scene-specific set of anchor frames, the adaptability between the anchor frames and the targets is improved. Initial target candidates are generated through IoU matching, category determination, and position fine-tuning. Then, through interference removal and confidence screening, initial target detection results with both accuracy and reliability are generated, laying the foundation for subsequent decoupling of overlapping targets.
[0052] Preferably, the specific implementation process of step 331 is as follows: First, historical water surface target data is collected. This data includes the size information (length and width pixel values) of targets such as ships, buoys, and floating objects under different water environments (ocean, lake, river), different weather conditions (sunny, cloudy, foggy), and different time periods (daytime, nighttime, twilight). The data volume needs to cover at least thousands of target samples (e.g., 2000 target samples). Statistical analysis is performed on the historical target sizes, and the size distribution patterns are calculated according to target type. For ship targets, the mean, variance, and quantiles of length and width are extracted. For buoy targets, the equivalent diameter distribution is statistically analyzed. For floating object targets, the size range of the minimum bounding rectangle is recorded. Based on statistical results, a water surface scene-specific anchor frame generation model is constructed. This model includes a size clustering layer and an aspect ratio optimization layer. The size clustering layer uses a density clustering algorithm to cluster target sizes, generating multiple sets of core sizes (usually 3-5 sets, for example, the core sizes for ships are 30×15, 60×30, and 120×60 pixels, and for buoys they are 10×10 and 20×20 pixels). The aspect ratio optimization layer assigns appropriate aspect ratios to each set of core sizes according to the physical characteristics of different target types (the aspect ratios for ships are 2:1, 3:1, and 4:1, for buoys it is 1:1, and for floating objects it is 1:1, 1.5:1, and 2:1). Finally, a scene-specific anchor frame set is generated. This anchor frame set can accurately adapt to different types and sizes of targets in the water surface scene, improving the accuracy of subsequent matching.
[0053] Preferably, in the specific technical implementation of step 332, firstly, multi-scale target candidate features and scene-specific anchor box sets are obtained. The multi-scale target candidate features contain feature information of targets at different scales, and the scene-specific anchor box sets contain multiple sets of anchor box sizes and aspect ratios adapted to different targets. For each scale of target candidate feature map, the corresponding anchor boxes in the scene-specific anchor box set are deployed by sliding according to pixel position, and the intersection-over-union ratio (IoU) between each anchor box and the target region in the feature map is calculated. A two-stage IoU threshold is set (the first-stage threshold is used to screen potential positive samples, usually 0.3-0.5, for example 0.4; the second-stage threshold is used to determine strong positive samples, usually 0.5-0.7, for example 0.6). Anchor boxes with an IoU higher than the second-stage threshold are directly identified as positive sample anchor boxes. Anchor boxes with an IoU between the two-stage threshold are further judged based on whether the target center position falls within the anchor box. If the center falls within the anchor box, it is identified as a positive sample anchor box. Anchor boxes with an IoU lower than the first-stage threshold are identified as negative sample anchor boxes and are removed. Finally, a set of positive sample anchor boxes is generated. This set accurately covers the target region in the feature map, providing an effective carrier for subsequent category determination and position fine-tuning.
[0054] Preferably, the specific implementation process of step 333 is as follows: A classification branch is configured for the positive sample anchor frame. This branch includes two sets of cascaded fully connected layers and one activation function layer. The number of neurons in the fully connected layers is set according to the number of target categories on the water surface (e.g., when there are 7 target categories including ships, buoys, and floating objects, the number of output neurons is 7). The feature vector corresponding to the positive sample anchor frame is input into the classification branch. The first set of fully connected layers performs dimensionality transformation and information integration on the feature vector. The second set of fully connected layers outputs the probability value of each anchor frame corresponding to each target category. The activation function layer uses the softmax function to normalize the probability values, obtaining the category confidence distribution. A category confidence threshold is set (usually 0.5-0.7, for example, 0.6). The category with the highest confidence and above the threshold is selected as the target category of the positive sample anchor frame, generating a category determination result. If the confidence of all categories is below the threshold, the anchor frame is marked as suspected interference and temporarily retained for further screening in subsequent interference removal steps.
[0055] Preferably, in the specific implementation of step 334, a regression branch is configured for the positive sample anchor boxes. This branch includes two fully connected layers and a regularization layer, used to predict the position offset (x-axis offset, y-axis offset) and size scaling factor (length scaling factor, width scaling factor) of the anchor boxes. The feature vector corresponding to the positive sample anchor boxes is input into the regression branch. The fully connected layers learn the mapping relationship between the anchor boxes and the target ground truth bounding boxes. The regularization layer suppresses overfitting through L2 regularization and outputs the predicted offset and scaling factor. Based on the prediction results, the position and size of the positive sample anchor boxes are fine-tuned. Position fine-tuning is achieved by adding the anchor box center coordinates to the x and y axis offsets, and size fine-tuning is achieved by multiplying the anchor box length and width by the corresponding scaling factor. After fine-tuning, the anchor boxes are validated for validity. Anchor boxes that exceed the image boundary or have abnormal sizes (length and width less than a preset minimum threshold, such as 5 pixels) are removed. Finally, a preliminary target candidate set is generated, which includes the target category, confidence level, and fine-tuned position and size information of each candidate target.
[0056] Preferably, the specific implementation process of step 336 is as follows: Obtain interference judgment parameters (including edge blur judgment results, grayscale variance judgment results, and interference candidate labeling results) and a preliminary target candidate set. The interference candidate labeling results have clearly identified interference candidates that simultaneously satisfy edge blur and low grayscale variance. Traverse the preliminary target candidate set, filter out non-interference candidates based on the interference candidate labeling results, and directly remove targets marked as interference candidates. Simultaneously, for suspected interference anchor boxes (anchor boxes with a category confidence level below the threshold but not marked as interference candidates), perform a secondary verification combining the edge blur judgment results and grayscale variance judgment results. If they satisfy either edge blur or low grayscale variance, they are also removed. Retain the non-interference candidates that pass the verification to generate interference-removed candidates. This candidate set has effectively removed interference such as wave reflection and water wave artifacts, retaining only true target candidates.
[0057] Preferably, in the specific implementation of step 337, the category confidence of the candidates after interference removal is extracted, and the candidates are sorted from high to low confidence. A threshold for the number of candidates to be retained is set, which is dynamically adjusted according to the sparsity of the targets in the image (the number of retained targets is small in sparse target scenes, usually 10-20, for example, 15; the number of retained targets is large in dense target scenes, usually 20-30, for example, 25), and the top N candidates (N is the retention threshold) are retained. The position coordinates of the retained candidates are sorted, and the fine-tuned anchor box position coordinates (x1, y1, x2, y2) are converted into absolute coordinates in the image pixel coordinate system. Finally, an initial target detection result containing the target category, confidence, and preliminary position coordinates is generated. This result provides accurate input data for subsequent overlapping target decoupling processing.
[0058] Optionally, step 335 includes: step 3351, calling the water surface dynamic interference suppression rule, calculating the edge gradient value of each candidate in the preliminary target candidate set, if the edge gradient value is lower than the preset gradient threshold, it is determined to be edge blurring, and generating an edge blurring determination result; step 3352, calculating the gray-level variance of each candidate region in the preliminary target candidate set, if the gray-level variance is lower than the preset variance threshold, it is determined to be reflection or artifact, and generating a gray-level variance determination result; step 3353, combining the edge blurring determination result and the gray-level variance determination result, only marking candidates that simultaneously satisfy edge blurring and low gray-level variance as interference candidates, generating interference candidate marking results, and using the interference candidate marking results as interference determination parameters.
[0059] The technical essence of steps 3351, 3352, and 3353 of this application lies in addressing the problem that interference such as wave reflection and water wave artifacts in visible light water surface scenes (such as marine monitoring and inland waterway security) are similar to the visual features of target candidates. By collaboratively calculating and logically fusing multi-dimensional interference judgment indicators (edge gradient and gray-level variance), the true target and interference candidates are accurately distinguished, and reliable interference judgment parameters are generated. This provides an accurate basis for subsequent interference removal and ensures the purity of the initial target detection results.
[0060] Preferably, the specific implementation process of step 3351 is as follows: First, a preliminary target candidate set is obtained, which includes the position coordinates, size, and category confidence information of each candidate. For each target candidate, a corresponding image sub-region is extracted based on its position coordinates and size. This sub-region is the candidate region, containing complete visual information of the target or interference. A water surface scene-specific edge gradient calculation model is constructed. This model uses a direction-sensitive gradient operator, with operator directions covering horizontal, vertical, and 45° and 135° diagonal directions, adapting to the multi-directional distribution characteristics of water surface target edges (such as ship outlines and buoy edges). The gradient values of each pixel in the candidate region in the four directions are calculated using this model, and the maximum value is taken as the edge gradient value of that pixel, generating a candidate region edge gradient map. The mean of the edge gradient map is calculated as the edge gradient value of the target candidate. At the same time, an adaptive gradient threshold is set according to the scene. This threshold is dynamically adjusted according to the light intensity of the water scene (the threshold is set to 15-25 when the light is strong, for example, 20; and set to 8-15 when the light is weak, for example, 12). If the edge gradient value is lower than the threshold, it is determined to be an edge blur, and an edge blur determination result is generated (marked in binary, 1 indicates edge blur and 0 indicates edge sharpness).
[0061] Preferably, in the specific technical implementation of step 3352, for each candidate in the preliminary target candidate set, its corresponding candidate region is extracted, and the variance of the grayscale values of all pixels in the region is calculated. The grayscale variance reflects the dispersion of the grayscale distribution in the region. The grayscale variance of real targets (such as ships and buoys) is usually high, while the grayscale variance of wave reflections and water wave artifacts is low. An adaptive threshold model for grayscale variance is constructed. This model takes the grayscale mean of the candidate region as input and adjusts the threshold size in combination with the dynamic interference intensity of the water surface scene (determined by statistical analysis of ripple density in the image). When the dynamic interference intensity is high, the threshold is set to 30-50, for example, 40; when the dynamic interference intensity is low, the threshold is set to 50-80, for example, 60. The calculated grayscale variance of the candidate region is compared with the adaptive threshold. If the grayscale variance is lower than the threshold, it is judged as reflection or artifact, and a grayscale variance judgment result is generated (labeled in binary, 1 represents reflection or artifact, and 0 represents normal target region).
[0062] Preferably, the specific implementation process of step 3353 is as follows: Obtain the edge blur determination result and the grayscale variance determination result, and construct an interference candidate logical determination model. This model uses an "AND" logic rule, marking a target candidate as an interference candidate only when both the edge blur determination result and the grayscale variance determination result are 1. Traverse all candidates in the initial target candidate set, applying this logic rule one by one to generate interference candidate marking results (presented in vector form, with a vector length consistent with the number of candidates in the initial target candidate set; a vector element of 1 indicates the corresponding candidate is an interference candidate, and 0 indicates a true target candidate). Use this interference candidate marking result as an interference determination parameter. This parameter accurately marks all interference candidates in the initial target candidate set, providing a clear and reliable basis for interference removal in step 336, ensuring that only interference candidates such as wave reflections and water wave artifacts are removed, while true target candidates are retained.
[0063] Optionally, step 4 specifically includes: Step 411: Calculate the IoU between target candidates in the initial target detection results. If the IoU is higher than the overlap threshold, they are determined to be overlapping targets and form overlapping target candidate pairs. Step 412: Extract high-frequency edge features of the corresponding regions of overlapping target candidate pairs from the dual-domain fusion features to generate high-frequency edge features of the overlapping regions; Step 413: Based on the edge direction and texture pattern of the non-overlapping area, the edge texture missing high-frequency edge features in the overlapping area is completed using the edge completion algorithm to generate the edge texture completion result. Step 414: Fuse the edge texture completion result with the initial features of the overlapping target to reconstruct the complete edge features of the overlapping target and generate complete edge reconstruction features; Step 415: Based on the complete edge reconstruction features, calibrate the position coordinates of each target in the overlapping target candidate pair to adjust the anchor frame position and separate the overlapping area to generate position-calibrated candidates. Step 416: Recalculate the confidence level and confirm the category of the candidates after position calibration to generate the final detection result of visible light water surface target.
[0064] In steps 411, 412, and 413 of this application, in response to the problem of missing edge textures and blurred positioning caused by dense overlapping of targets in visible light water surface scenes (such as marine monitoring and inland waterway security), the application accurately identifies overlapping target pairs, extracts high-recognition, high-frequency edge features, and completes missing textures by combining scene patterns. This provides complete edge evidence for the accurate separation of overlapping targets and ensures the accuracy of the final detection results.
[0065] Preferably, the specific implementation process of step 411 is as follows: First, obtain the initial target detection results, which include the category, confidence level, and preliminary position coordinates (represented by the pixel coordinates of the upper left and lower right corners of the rectangular bounding box) of each target candidate. Construct a target candidate association matrix, where the rows and columns of the matrix correspond to the target candidates in the initial target detection results, and the matrix elements are the intersection-overall reunification (IoU) values of two corresponding target candidates. Calculate the IoU of each target candidate with all other target candidates. The IoU calculation is based on the ratio of the overlapping area to the merged area of the bounding boxes of two target candidates. Set a scene-adaptive overlap threshold, which is dynamically adjusted according to the type of water surface target (the overlap threshold for ship targets is set to 0.3-0.5, for example, 0.4; for buoys and floating objects, it is set to 0.2-0.4, for example, 0.3). When the IoU of two target candidates is higher than the overlap threshold of the corresponding type, they are determined to be overlapping targets and form an overlapping target candidate pair. Perform traversal matching on all target candidates to avoid duplicate pairings, and finally generate a set of overlapping target candidate pairs. This set accurately marks all overlapping target combinations in the initial detection results.
[0066] Preferably, in the specific implementation of step 412, a set of dual-domain fusion features and overlapping target candidate pairs is obtained. The dual-domain fusion features contain the correlation mapping between high-frequency information in the frequency domain and global and local information in the spatial domain, possessing high target edge recognition accuracy. For each overlapping target candidate pair, based on the position coordinates of the two target candidates it contains, the feature extraction range covering the entire overlapping area and part of the non-overlapping area is determined (the expansion ratio is 10%-20% of the target bounding box side length, for example, 15%), ensuring complete inclusion of the edge information of the overlapping targets. Through an edge detection convolutional layer with a kernel size of 3×3, convolution operations are performed on the dual-domain fusion features within the feature extraction range to enhance the target edge features and suppress background interference, generating an edge enhancement feature map. Features of the corresponding overlapping target candidate pair region are extracted from the edge enhancement feature map. These features are the high-frequency edge features of the overlapping area, whose pixel dimension is consistent with the feature extraction range, and whose channel dimension retains the key information of the dual-domain fusion features, clearly reflecting the edge distribution of the overlapping area.
[0067] Preferably, the specific implementation process of step 413 is as follows: First, the high-frequency edge features of the overlapping area are analyzed to separate the non-overlapping area and the overlapping area. The non-overlapping area retains the complete edge texture of the target, while the overlapping area has missing edge texture. A water surface target edge texture completion model is constructed. This model includes an edge direction prediction layer and a texture generation layer. The edge direction prediction layer predicts the edge extension direction of the overlapping area (e.g., the straight extension of the ship's edge, the arc extension of the buoy's edge) based on the edge pixel coordinates of the non-overlapping area using a polynomial fitting algorithm. The texture generation layer generates the missing texture of the overlapping area with high consistency with the target texture based on the predicted edge direction and the texture rules of the non-overlapping area (e.g., the striped texture of the ship's edge, the speckled texture of the buoy's surface). The generated missing texture is fused with the overlapping area in the high-frequency edge features of the overlapping area to fill in the missing texture and generate an edge texture completion result. This result completely retains the edge texture information of the overlapping target, providing accurate texture support for subsequent target separation and position calibration.
[0068] In steps 414, 415, and 416 of this application, to address the issues of missing edge textures and ambiguous positioning of overlapping targets in visible light water surface scenes (such as marine monitoring and inland waterway security), feature fusion is used to reconstruct complete edges, accurately calibrate target positions, and reconfirm category confidence, thereby achieving effective separation and accurate identification of overlapping targets and ensuring the accuracy and reliability of the final detection results.
[0069] Preferably, the specific implementation process of step 414 is as follows: First, obtain the edge texture completion result and the initial features of the overlapping target. The edge texture completion result fills in the edge missing parts of the overlapping area, and the initial features of the overlapping target include the target's category, confidence level, and preliminary location information. Construct a dual-feature fusion model, which includes a feature alignment layer, a weight allocation layer, and a fusion layer, to adapt to the special characteristics of water surface target features. The feature alignment layer precisely aligns the edge texture completion result with the initial features of the overlapping target at pixel positions, ensuring a one-to-one correspondence between the edge features and the initial features of the same target. The weight allocation layer dynamically allocates weights based on feature importance. The weight of the edge texture completion result is adjusted according to the degree of overlap (the weight is set to 0.6-0.7, for example, 0.65, when the overlap is high; and set to 0.4-0.5, for example, 0.45, when the overlap is low). The weight of the initial feature is adjusted in the opposite way to ensure the dominance of key features. The fusion layer fuses the aligned dual features by weighted summation pixel by pixel to generate a complete edge reconstruction feature. This feature retains the original features of the non-overlapping areas of the target and supplements the complete edge texture of the overlapping areas, providing accurate feature support for target separation.
[0070] Preferably, in the specific technical implementation of step 415, complete edge reconstruction features and overlapping target candidate pairs are obtained. The complete edge reconstruction features contain complete edge information of the overlapping targets, and the overlapping target candidate pairs mark the target combinations that need to be separated. For each overlapping target candidate pair, the edge contour information of the corresponding region is extracted from the complete edge reconstruction features, and the true boundary of each target (such as the outline of a ship or the edge of a buoy) is determined by an edge detection algorithm. A position calibration model is constructed. This model uses the true boundary as a reference and calculates the offset (x-axis offset and y-axis offset) between the initial position coordinates of each target in the overlapping target candidate pair and the true boundary. At the same time, the size parameters (length and width) of the target are adjusted to ensure that the calibrated target boundary is consistent with the true boundary. Based on the calculated offset and size adjustment parameters, the position coordinates of each target in the overlapping target candidate pair are calibrated, and the anchor frame position is adjusted to completely separate the overlapping area, generating position-calibrated candidates. The boundaries of each target in this candidate set do not overlap and accurately fit the true contour of the target.
[0071] Preferably, the specific implementation process of step 416 is as follows: First, obtain the candidate targets after position calibration. These candidates include the calibrated position coordinates, dimensions, and original category confidence. Second, construct a confidence recalculation model. This model takes the complete edge reconstruction features as input, extracts deep features of the target through a convolutional neural network, and calculates a new category confidence based on the target's position calibration accuracy (the degree of overlap between the calibrated boundary and the true boundary). Higher position calibration accuracy results in a smaller confidence adjustment range, and vice versa (the adjustment range is ±0.1-±0.3, for example, +0.05 for high calibration accuracy and -0.2 for low accuracy). Third, reconfirm the category of the candidate targets after position calibration through a classification branch. The classification branch, based on the target texture, shape, and other features in the complete edge reconstruction features, re-determines the target category to ensure the accuracy of the category determination. The recalculated confidence and category confirmation results are updated to the candidates after position calibration, generating the final detection result of visible light water surface targets, which includes the target's accurate category, confidence, and location coordinates. This result effectively solves the problem of separating overlapping targets, and the category and confidence are more in line with the actual situation of the targets, adapting to the accurate detection needs in complex water surface scenarios.
[0072] like Figure 2 As shown, this is an embodiment of the visible light water surface target detection device based on frequency domain and spatial domain feature enhancement, comprising: The preprocessing and feature extraction module is used to acquire visible light water surface scene images, preprocess them to obtain preprocessed water surface images, extract high-frequency features in the frequency domain of the image from the preprocessed water surface images and generate high-frequency enhanced features in the spatial domain accordingly, and extract global and local features in the spatial domain from the preprocessed water surface images to fuse with the high-frequency features in the frequency domain of the image to generate dual-domain fusion features. The multi-scale candidate generation module is used to extract shallow small target features from the dual-domain fusion features based on the constructed multi-scale detection architecture, and to obtain deep global association features by performing global semantic association analysis. The shallow small target features are then combined to generate multi-scale target candidate features. The interference removal module is used to remove interference candidates such as wave reflection and water wave artifacts from multi-scale target candidate features and generate initial target detection results. The overlap decoupling and result generation module is used to perform overlap target decoupling processing on the initial target detection results to obtain overlapping target candidate pairs and generate the final detection results of visible light water surface targets.
[0073] This application also provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded and executed by a processor to implement the visible light water surface target detection method based on frequency domain spatial domain feature enhancement as described above.
[0074] like Figure 3 As shown, an electronic device according to an embodiment of this application is provided. The electronic device includes a processor and a memory. The memory stores at least one instruction or at least one program. The at least one instruction or the at least one program is loaded and executed by the processor to implement the visible light water surface target detection method based on frequency domain spatial domain feature enhancement as described above.
[0075] This application also provides a computer program product or computer program, which includes computer instructions. When the computer instructions are executed by a processor, they implement the visible light water surface target detection method based on frequency domain spatial domain feature enhancement as described above.
[0076] For specific examples of the aforementioned devices and products, please refer to the above. Figure 1 The records.
Claims
1. A visible light water surface target detection method based on frequency domain space domain feature enhancement, characterized in that, The method comprises the following steps: Step 1, obtaining a visible light water surface scene image, preprocessing the visible light water surface scene image to obtain a preprocessed water surface image, extracting image frequency domain high frequency features from the preprocessed water surface image and generating spatial domain high frequency enhanced features according to the image frequency domain high frequency features, and extracting spatial domain global and local features from the preprocessed water surface image to fuse the image frequency domain high frequency features and generate dual-domain fusion features; Step 2, extracting shallow small target features from the dual-domain fusion features by target edge detail extraction and generating deep global correlation features by global semantic correlation analysis to combine the shallow small target features, and generating multi-scale target candidate features; Step 3, removing sea wave reflection, water wave artifact and other interference candidates from the multi-scale target candidate features to generate an initial target detection result; Step 4, performing overlapping target decoupling processing on the initial target detection result to obtain overlapping target candidate pairs to generate a final visible light water surface target detection result.
2. The method of claim 1, wherein the method is based on frequency domain spatial domain feature enhancement for visible water surface target detection. The preprocessing of the visible light water surface scene image in step 1 comprises the following steps: step 111, performing gray scale normalization on the visible light water surface scene image to unify the gray scale range of the image and generating a gray scale normalized image; step 112, filtering noise from the gray scale normalized image to reduce water surface random noise interference and generating a noise filtered image as the preprocessed water surface image.
3. The method of claim 1, wherein the method is based on frequency domain spatial domain feature enhancement for visible water surface target detection. In step 1, the image frequency domain high frequency features are extracted and the spatial domain high frequency enhanced features are generated, which comprises the following steps: step 113, converting the pixel domain information of the preprocessed water surface image into a frequency domain complex matrix and separating the real part and the imaginary part to generate a frequency domain separation matrix; step 114, calculating the amplitude spectrum of the frequency domain separation matrix to filter and retain the high frequency components corresponding to the target edge and texture from the amplitude spectrum, generating a high frequency component filtering result to generate the spatial domain high frequency enhanced features.
4. The method of claim 1, wherein the method is based on frequency domain spatial domain feature enhancement for visible water surface target detection. In step 1, the spatial domain global and local features are extracted, which comprises the following steps: step 117, inputting the preprocessed water surface image into a down-sampling layer to generate an initial spatial feature by performing down-sampling on the preprocessed water surface image through convolution with a preset step size; step 118, processing the initial spatial feature through multiple groups of residual blocks to generate spatial domain local detail features; step 119, performing pyramid pooling on the spatial domain local detail features to obtain multi-scale global information through multiple groups of different size pooling kernels, and generating spatial domain global semantic features by concatenating the multi-scale global information and performing channel compression through convolution compression processing, to generate spatial domain global and local features reflecting the correlation between target local texture and global scene.
5. The method of claim 1, wherein the method is based on frequency space domain feature enhancement for visible water surface target detection. In step 1, the dual-domain fusion features are generated, which comprises the following steps: step 121, concatenating the spatial domain high frequency enhanced features and the spatial domain global and local features in the channel dimension to generate a dual-domain feature concatenation result; step 122, strengthening the correlation mapping of key information in the dual-domain feature concatenation result through feature attention weighting to generate dual-domain fusion features containing frequency domain high frequency information and spatial domain global and local information in the channel dimension.
6. The method of claim 1, wherein the method is based on frequency space domain feature enhancement for visible water surface target detection. The multi-scale detection architecture constructed in step 2 is a feature pyramid network, specifically comprising: step 221, inputting the dual-domain fusion features into the feature pyramid network to generate multi-scale feature maps with multiple down-sampling ratios; step 222, based on the small-scale detection head deployed in the shallow feature layer, performing preset size convolution processing on the multi-scale feature maps to strengthen the target edge features and determine the sample target size accordingly, and performing statistical clustering on the sample target size distribution through anchor box clustering to generate anchor box sizes suitable for long-distance small targets, and accordingly generating shallow small target features; step 223, based on the long-distance dependence extraction module embedded in the deep feature layer, capturing the global correlation between the target and the background on the multi-scale feature map to generate deep global correlation features to combine the shallow small target features to generate multi-scale target candidate features that retain the discriminability of different scale target features.
7. The method of claim 6, wherein the method further comprises: Step 223 comprises: step 2231, window partitioning of the multi-scale feature map, each window containing a preset number of feature pixels, the window size being dynamically adjusted according to the target scale, to generate window partitioning results; step 2232, calculating the self-attention weights between the feature pixels in each window partitioning result to strengthen the pixel correlation in the target area and weaken the pixel interference in the background area, and further generating window attention features; step 2233, through window shifting operation, interactively fusing the attention features across windows to supplement the global information of the target at the window edge, and further generating cross-window interaction features to generate deep global correlation features highlighting the global correlation between the target and the surrounding scene.
8. The method of claim 1, wherein the method is based on frequency space domain feature enhancement for visible water surface target detection. Step 3 specifically comprises: step 331, constructing a water scene exclusive anchor box set based on historical water surface target size statistics to generate multiple anchor box sizes and aspect ratios suitable for ships, buoys and floating objects, and further generating a scene exclusive anchor box set; step 332, performing IoU matching between the multi-scale target candidate features and the scene exclusive anchor box set to filter out positive sample anchor boxes; step 333, determining the target class through the classification branch pair of positive sample anchor boxes; step 334, fine-tuning the position and size of the positive sample anchor boxes through the regression branch to generate a preliminary target candidate set to generate the initial target detection result containing the target class, confidence and preliminary position coordinates.
9. The method of claim 1, wherein the method is based on frequency space domain feature enhancement for visible water surface target detection. Step 4 specifically comprises: step 411, calculating the IoU between the target candidates in the initial target detection result, and determining as overlapping targets if the IoU is higher than the overlap threshold and forming overlapping target candidate pairs; step 412, extracting high-frequency edge features of the overlapping target candidate pairs from the dual-domain fusion features to generate overlapping region high-frequency edge features; step 413, through the edge completion algorithm, according to the edge direction and texture regularity of the non-overlapping region, completing the missing edge texture of the overlapping region high-frequency edge features to generate an edge texture completion result to generate the final visible light water surface target detection result.
Citation Information
Patent Citations
Character action recognition analysis method and system based on infrared laser and deep learning
CN118747911A
Underwater target detection method based on multi-modal features and domain adaptation
CN120259864A
High-altitude parabolic object detection method based on Swinin-Transform and YOLOv8 fusion detection algorithm
CN120726453A
Unmanned aerial vehicle target detection method based on frequency-space joint attention and dynamic fusion
CN120976534A