A target detection method and system in a sea fog environment
By jointly training a gated shared feature extraction and target-guided defogging network, the problems of artifacts and noise in target detection under sea fog conditions are solved, achieving high-precision target recognition and improving the efficiency of maritime search and rescue.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHEAST UNIV
- Filing Date
- 2025-06-18
- Publication Date
- 2026-06-23
AI Technical Summary
In sea fog environments, existing technologies struggle to avoid introducing artifacts and noise during image dehazing while simultaneously improving target detection accuracy. This is especially true when targets are obscured in dense fog or uneven haze conditions, where existing methods cannot effectively enhance target detection precision.
A gated shared feature extraction network is used to generate sea fog features and features of the objects to be detected. A target-guided defogging network is used to optimize the sea fog in the target area. The target detection network and the defogging network are jointly trained to generate high-resolution images of the target area.
It effectively distinguishes between sea fog features and the features of the object to be detected, reduces artifacts and noise during the defogging process, improves the accuracy and precision of target detection, and enhances the ability to identify maritime targets.
Smart Images

Figure CN120726289B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and specifically to a target detection method and system in a sea fog environment. Background Technology
[0002] Sea fog, a common marine meteorological phenomenon, significantly reduces visibility at sea, hindering search and rescue operations for people in distress at sea using target detection methods. Specifically, it manifests as decreased image contrast, blurred target edges, and loss of feature information. This attenuation of visual information affects the visibility and recognizability of targets at sea, thus increasing the difficulty of identifying distressed targets.
[0003] Currently, research on target detection under hazy conditions mainly includes: image restoration-based "dehazing before detection" methods and domain-adaptive methods. The image restoration-based "dehazing before detection" method preprocesses the degraded image using a dehazing algorithm before target recognition. However, this method inevitably introduces visually invisible artifacts and noise during image dehazing, reducing the accuracy of subsequent target detection. The effectiveness of domain-adaptive methods is limited by two key factors: the difference in data distribution between the source and target domains and the feature shift between domains. For images with dense fog and uneven haze interference, the target is obscured, resulting in significant loss of detail and texture features, thus this method cannot improve target detection accuracy. Therefore, a target detection method capable of accurately locating maritime targets in sea fog environments is needed to improve rescue efficiency. Summary of the Invention
[0004] Purpose of the invention: The purpose of this invention is to provide a target detection method and system in sea fog environments, which can accurately identify maritime targets under sea fog interference and improve the efficiency of maritime search and rescue.
[0005] Technical solution: To achieve the above objectives, the present invention provides a target detection method in a sea fog environment, comprising the following steps:
[0006] S1. Obtain sea fog images and construct a dataset;
[0007] S2. Construct a gated shared feature extraction network and use it to generate sea fog features F in the image. f and the features of the object to be detected;
[0008] S3. Construct a target detection network and use it to identify target features F from the features of the object to be detected. d ;
[0009] S4. Generate F containing only target features. d The mask image corresponding to the image;
[0010] S5. Construct a target-guided dehazing network and use a mask image to guide the target-guided dehazing network to optimize the sea fog around the target features in the image, thereby obtaining the enhanced feature map of the target.
[0011] S6. Identify the target location information in the enhanced feature map.
[0012] Preferably, the gated shared feature extraction network embeds multi-level differentiable attention gate modules into the residual path of the ResNet50 network. The embedding method is as follows: differentiable attention gate modules Gate1-Gate4 are integrated at the outputs of the four residual stages conv2_x to conv5_x of the ResNet50 network, respectively. Gate1 is connected to the output layer of conv2_x to generate sea fog features, and Gate2-Gate4 are connected to the output layers of conv3_x to conv5_x, respectively, to generate features of the object to be detected.
[0013] Preferably, the target detection network is composed of a YOLOv8 neural network detection head.
[0014] Preferably, the target-guided dehazing network is a dual-branch residual structure, wherein the convolutional block attention module, pointwise convolution and ReLU activation function constitute the first branch, and 1x1 convolution constitutes the second branch.
[0015] Preferably, the method of using a mask image to guide the target-guided dehazing network to optimize the sea fog around the target features in the image to obtain the enhanced feature map is as follows: the mask image and the sea fog features are input into the target-guided dehazing network, wherein the mask image is processed by the convolutional block attention module to obtain an attention coefficient; the sea fog features are processed by the second branch to obtain an intermediate feature, the intermediate feature is input into the convolutional block attention module, and after being added point by point with the attention coefficient, it is processed by point-by-point convolution and ReLU activation function to generate a feature map; the sea fog features and the feature map are residually connected to obtain the enhanced feature map of the target.
[0016] Preferably, the method for identifying the target location information in the enhanced feature map is as follows: after passing the feature map through three sets of convolutional layers, ReLU activation function, Batch Normalization and upsampling operation, a high-definition fog-free image around the target area is generated, thereby determining the target's location at sea.
[0017] Preferably, the method for acquiring sea fog images is as follows: an atmospheric scattering model is used to perform image fogging processing on sea surface images containing objects under normal conditions.
[0018] I(x)=J(x)t(x)+A(1-t(x))
[0019] Where t(x)=exp(-βd(x)) is the transmittance, I(x) is the image after fogging, J(x) is the image without fog, A is atmospheric light, β is the scattering coefficient, and d(x) is the scene depth.
[0020] Preferably, the gated shared feature extraction network, the object detection network, and the target-guided dehazing network are jointly trained. The training method is as follows: the dataset is divided into a training set and a test set. In each training round, a batch of sea fog images are input. The gated shared feature extraction network outputs sea fog features and object features to be detected based on the input sea fog images. The object detection network identifies the target features in the object features to be detected. The target-guided dehazing network generates a feature map of the target region enhancement based on the image mask map corresponding to the target features and the sea fog features. During the training process, the loss functions of the object detection network and the target-guided dehazing network are jointly optimized until the change in training loss within 20 epochs is less than ±5%, at which point the training is completed.
[0021] Preferably, the method for jointly optimizing the loss function is as follows:
[0022]
[0023] Among them, L I L is the training loss function for the target-guided dehazing network. d Let be the training loss function for the object detection network.
[0024] The target detection system for sea fog environments described in this invention includes the following modules:
[0025] Dataset building module: Acquire sea fog images and build datasets;
[0026] Feature Extraction Module 1: Constructing a gated shared feature extraction network to generate sea fog features F in the image. f and the features of the object to be detected;
[0027] Feature Extraction Module 2: Constructing an object detection network and using it to identify target features F from the features of the object to be detected. d ;
[0028] Mask image generation module: Generates a mask image containing only target features F d The mask image corresponding to the image;
[0029] Target enhancement module: Construct a target-guided dehazing network, and use a mask image to guide the target-guided dehazing network to optimize the sea fog around the target features in the image, so as to obtain the enhanced feature map of the target;
[0030] Target location information recognition module: Recognizes the target location information in the enhanced feature map.
[0031] Beneficial Effects: This invention has the following advantages: 1. This invention introduces a gated shared feature extraction network, which effectively solves the feature interference problem caused by the inconsistency of optimization targets in the tasks of sea fog defogging and target detection. It reduces the high-frequency details that may be lost in the defogging task, while protecting the semantic information required for the target detection task from distortion. It achieves effective differentiation and high-quality extraction of sea fog features and the features of the object to be detected, laying the foundation for subsequent processing; 2. By using a target-guided defogging network to specifically optimize the sea fog in the target area and its surroundings, instead of performing blurring or distortion defogging on the entire image, it reduces artifacts and noise introduced by defogging, preserves the key details of the target, and thus improves the accuracy of target detection. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating the method.
[0033] Figure 2 Diagram of the network structure for gating shared feature extraction;
[0034] Figure 3 Dehazing network structure diagram for target;
[0035] Figure 4 A comparison of different methods for identifying targets in sea fog images. Detailed Implementation
[0036] The technical solution of the present invention will be described in detail below with reference to the embodiments and accompanying drawings.
[0037] like Figure 1 As shown, the detection method of the present invention includes the following:
[0038] 1. Obtain sea fog images and construct a dataset.
[0039] II. Generating Sea Fog Features in Image F using a Gated Shared Feature Extraction Network f and the features of the object to be detected.
[0040] like Figure 2 As shown, the gated shared feature extraction network embeds a multi-level differentiable attention gate module into the residual path of the ResNet50 network. This module consists of three parts: dynamic feature allocation, task feature decoupling, and hierarchical weight constraints. Specifically, the embedding method is as follows: Differentiable attention gate modules (Gate1-Gate4) are integrated at the outputs of the four residual stages (conv2_x to conv5_x) of the ResNet50 network. Gate1 connects to the output layer of conv2_x to generate the sea fog feature F.f The features include overall scene brightness information, color shift distribution, fog concentration estimation, atmospheric light parameters, low-frequency structure information, and transmission map related features; Gate2-Gate4 connect the output layers of conv3_x to conv5_x respectively to generate the features of the object to be detected, including local edge details, texture features, target shape contour, mid-to-high frequency semantic information, and multi-scale spatial features.
[0041] The dynamic feature allocation generates gated weights through a spatial-channel attention mechanism, which are then fused with the output values of the residual block, as shown in the following expression:
[0042]
[0043] Where α and β are learnable parameters, M c With M s These are the calculation results for channel and spatial attention, respectively.
[0044] The task feature decoupling is achieved by using gating weights to reconstruct cross-task features based on the different features required by each task. The expression is as follows:
[0045]
[0046] Among them, F det To detect the features of the branches, F dehaze For the features of the dehazing branch, i∈{1,2,3,4} corresponds to the gating level. ReLU is used to enhance positive activation, and Sigmoid is used to suppress negative interference.
[0047] The hierarchical weight constraint refers to applying L1 regularization constraints to low-level gating, forcing shallow features to flow more towards the dehazing branch, and applying inverse constraints to high-level gating, guiding deep features to prioritize serving the detection task. The expression is as follows:
[0048]
[0049] in, For low-level gating constraints, For high-level gating constraints, λ is the weighting coefficient.
[0050] III. Constructing an object detection network and using it to identify target features F from the features of the object to be detected. d .
[0051] The target detection network consists of a YOLOv8 neural network detection head.
[0052] IV. Generating F containing only target features d The mask image corresponding to image F
[0053] V. Construct a target-guided defogging network using a mask image. The guidance target guides the dehazing network to optimize the sea fog around the target features in image F, while suppressing excessive dehazing in irrelevant areas.
[0054] like Figure 3 As shown, the target-guided dehazing network is a dual-branch residual structure, in which the convolutional block attention module, pointwise convolution and ReLU activation function constitute the first branch, and 1x1 convolution constitutes the second branch.
[0055] mask image and sea fog characteristics F f The input is fed into the target guided dehazing network, where the mask image... An attention coefficient is calculated by the convolutional block attention module (the attention coefficient is 0 if the target is not present in the mask image, otherwise it is not 0). Sea fog feature F f An intermediate feature F is obtained through the second branch calculation. a The input is then fed into the attention module of the convolutional block, where it is added point by point with the attention coefficients. After further processing by point-by-point convolution and the ReLU activation function, the feature map F' is generated.
[0056] The sea fog feature F f After performing a residual connection with feature map F', the enhanced feature map F of the target is obtained.
[0057] 6. The feature map F” is processed through three sets of convolutional layers, ReLU activation function, BatchNormalization and upsampling operations to restore the spatial resolution and detail information of the image, generating a fog-free image with high clarity around the target area, thereby determining the target's position at sea.
[0058] This invention jointly trains the aforementioned gated shared feature extraction network, target detection network, and target-guided dehazing network, enabling them to mutually promote each other and jointly accomplish the task of "accurately detecting targets in sea fog images and generating clear dehazed images of target regions".
[0059] 1. Construct a dataset and use an atmospheric scattering model to apply fogging to sea surface images containing objects under normal conditions, simulating real foggy scenes using interval random parameters:
[0060] I(x)=J(x)t(x)+A(1-t(x))
[0061] Where t(x) = exp(-βd(x)) is the transmittance, I(x) is the image after fogging, J(x) is the image without fog, A is atmospheric light, β is the scattering coefficient, and d(x) is the scene depth. The scattering coefficient β ranges from [0.1, 0.7], and the atmospheric light A ranges from [0.4, 1.2].
[0062] 2. The dataset is divided into training and testing sets. Multiple epochs of training are performed on the entire training set until the model performance reaches a satisfactory level or converges on the validation set. In each training epoch, a batch of sea fog images are input. The gated shared feature extraction network outputs sea fog features and object features to be detected based on the input sea fog images. The object detection network identifies the target features within the object features. The target-guided dehazing network generates an enhanced feature map of the target region based on the image mask map corresponding to the target features and the sea fog features, facilitating subsequent image dehazing processing.
[0063] During training, the loss functions of the object detection network and the object-guided dehazing network are jointly optimized to avoid large differences in gradient descent directions between tasks, which could lead to the final model failing to converge; freezing
[0064] The joint optimization of the multi-task loss function refers to the geometric mean training optimization strategy, which does not require the introduction of weights and additional modules and can minimize the training burden. The expression is as follows:
[0065]
[0066] Among them, L I L is the training loss function for the target-guided dehazing network. d Let be the training loss function for the object detection network.
[0067] After training, the parameters of the target-guided defogging network are frozen, and performance is tested using a test set.
[0068] This invention uses four images as an example, such as... Figure 4 As shown, for each column, Figure (a) is a foggy image with target annotation information (GT, control group); Figure (b) is the detection result using the FFA-Net+YOLOv8 method (first using the FFA-Net image dehazing method to dehaze the image, then using the YOLOv8 target detection method to detect the target); Figures (c) to (d) are the detection results using the multi-task learning methods TogetherNet and DSNet, respectively; and Figure (e) is the detection result using the method of this invention. Comparing the detection results, it can be seen that for each column, the method of this invention has the fewest missed detections and false detections of targets in the foggy image.
Claims
1. A target detection method in a sea fog environment, characterized in that, Includes the following steps: S1. Obtain sea fog images and construct a dataset; S2. Construct a gated shared feature extraction network and use it to generate sea fog features in the image. and the features of the object to be detected; S3. Construct an object detection network and use it to identify target features among the features of the object to be detected. ; S4. Generate a generator that only contains target features. The mask image corresponding to the image; S5. Construct a target-guided dehazing network and use a mask image to guide the target-guided dehazing network to optimize the sea fog around the target features in the image, thereby obtaining the enhanced feature map of the target. S6. Identify the target location information in the enhanced feature map; The gated shared feature extraction network embeds multi-level differentiable attention gate modules into the residual path of the ResNet50 network. The embedding method is as follows: differentiable attention gate modules Gate1-Gate4 are integrated at the outputs of the four residual stages conv2_x to conv5_x of the ResNet50 network, respectively. Gate1 is connected to the output layer of conv2_x to generate sea fog features, and Gate2-Gate4 are connected to the output layers of conv3_x to conv5_x, respectively, to generate features of the object to be detected. The target-guided dehazing network is a dual-branch residual structure, wherein the first branch consists of a convolutional block attention module, pointwise convolution, and ReLU activation function, and the second branch consists of a 1x1 convolution. The method for using a mask image to guide a target-guided dehazing network to optimize the sea fog surrounding the target features in an image, and obtaining the enhanced feature map of the target, is as follows: The mask image and the sea fog features are input into the target-guided dehazing network. The mask image is processed by the convolutional block attention module to calculate an attention coefficient; the sea fog features are processed by the second branch to calculate an intermediate feature. The intermediate feature is input into the convolutional block attention module, added point by point with the attention coefficient, and then processed by point-by-point convolution and ReLU activation function to generate a feature map; the sea fog features and the feature map are then residually concatenated to obtain the enhanced feature map of the target.
2. The target detection method according to claim 1, characterized in that, The target detection network consists of a YOLOv8 neural network detection head.
3. The target detection method according to claim 1, characterized in that, The method for identifying the target location information in the enhanced feature map is as follows: after passing the feature map through three sets of convolutional layers, ReLU activation function, Batch Normalization and upsampling operation, a high-definition fog-free image around the target area is generated, thereby determining the target's location at sea.
4. The target detection method according to claim 1, characterized in that, The method for obtaining sea fog images is as follows: An atmospheric scattering model is used to perform fogging processing on sea surface images containing objects under normal conditions. , in, Transmittance, The image after fogging. For fog-free images, Atmospheric light, The scattering coefficient is... For scene depth.
5. The target detection method according to claim 1, characterized in that, The gated shared feature extraction network, target detection network, and target-guided dehazing network are jointly trained. The training method is as follows: the dataset is divided into a training set and a test set. In each round of training, a batch of sea fog images are input. The gated shared feature extraction network outputs sea fog features and object features to be detected based on the input sea fog images. The target detection network identifies the target features in the object features to be detected. The target-guided dehazing network generates a feature map of the target region enhancement based on the image mask map corresponding to the target features and the sea fog features. During training, the loss functions of the object detection network and the object-guided dehazing network are jointly optimized until the training loss changes by less than ±5% over 20 epochs, at which point training is complete.
6. The target detection method according to claim 5, characterized in that, The method for jointly optimizing the loss function is as follows: , in, The training loss function of the dehazing network is used to guide the target. Let be the training loss function for the object detection network.
7. A target detection system for sea fog environments, characterized in that, Includes the following modules: Dataset building module: Acquire sea fog images and build datasets; Feature Extraction Module 1: Constructing a gated shared feature extraction network to generate sea fog features in images. and the features of the object to be detected; Feature Extraction Module 2: Constructing an object detection network to identify target features from the features of the object to be detected. ; Mask image generation module: Generates images containing only target features. The mask image corresponding to the image; Target enhancement module: Construct a target-guided dehazing network, and use a mask image to guide the target-guided dehazing network to optimize the sea fog around the target features in the image, so as to obtain the enhanced feature map of the target; Target location information recognition module: Recognizes the target location information in the enhanced feature map; The gated shared feature extraction network embeds multi-level differentiable attention gate modules into the residual path of the ResNet50 network. The embedding method is as follows: differentiable attention gate modules Gate1-Gate4 are integrated at the outputs of the four residual stages conv2_x to conv5_x of the ResNet50 network, respectively. Gate1 is connected to the output layer of conv2_x to generate sea fog features, and Gate2-Gate4 are connected to the output layers of conv3_x to conv5_x, respectively, to generate features of the object to be detected. The target-guided dehazing network is a dual-branch residual structure, wherein the first branch consists of a convolutional block attention module, pointwise convolution, and ReLU activation function, and the second branch consists of a 1x1 convolution. The method for using a mask image to guide a target-guided dehazing network to optimize the sea fog surrounding the target features in an image, and obtaining the enhanced feature map of the target, is as follows: The mask image and the sea fog features are input into the target-guided dehazing network. The mask image is processed by the convolutional block attention module to calculate an attention coefficient; the sea fog features are processed by the second branch to calculate an intermediate feature. The intermediate feature is input into the convolutional block attention module, added point by point with the attention coefficient, and then processed by point-by-point convolution and ReLU activation function to generate a feature map; the sea fog features and the feature map are then residually concatenated to obtain the enhanced feature map of the target.