CN-113989613-B - Light-weight high-precision ship target detection method coping with complex environment
Abstract
The invention relates to the technical field of target detection, and discloses a light-weight high-precision ship target detection method for coping with complex environments, aiming at the defects of ship target detection in the existing complex environments. According to the method, firstly, the model is subjected to light weight transformation and model optimization to reduce the model parameter quantity, secondly, the improved model is trained to obtain a weight file for detection, then, a sea fog environment distinguishing and physical model defogging module is constructed to cope with a complex environment, then, the sea fog distinguishing module and the defogging module are added into a detection module, and finally, the detection module and the trained model weight file are used for carrying out real-time detection on a complex environment video stream of a ship target. The method can realize real-time and high-precision detection of the ship in a complex environment.
Inventors
- LIU TAO
- WANG SHUO
- JIN XIN
Assignees
- 上海海事大学
- 中国人民解放军海军大连舰艇学院
Dates
- Publication Date
- 20260508
- Application Date
- 20211013
Claims (5)
- 1. The light-weight high-precision ship target detection method for the complex environment is characterized by comprising the following steps of: the method comprises the steps of 1, modifying an original network by using a lightweight network, and replacing a YOLOv s backbone feature extraction network by a CSPDARKNET network to a MobileNetv3-small network; Step 2, designing a variable convolution module, and replacing two common convolution modules close to a detection head with the variable convolution module, wherein the variable convolution module is designed by sequentially connecting a variable convolution layer, a batch normalization layer and an activation function layer to construct the variable convolution module, wherein a convolution kernel of a variable convolution network has the capacity of adapting to a target shape to generate space deformation, and the convolution kernel can be dynamically adjusted according to the identified target, so that the image characteristics of objects with different scales or shapes are captured; Step 3, optimizing the Loss function, namely optimizing a frame regression Loss part of the Loss function guiding the network to perform optimization from CIOU-Loss to Focal Loss EIOU; training and verifying the YOLOv s model improved in the step 1-3, optimizing network parameters, obtaining a weight file for detection, and verifying; step 5, designing a sea fog environment judging module, using the ambiguity of the image and the structural similarity of the image as indexes for judging whether the environment is foggy, and judging that the environment is foggy if the image is foggy according to the two indexes; Step 6, constructing an image defogging module, and estimating the ambient light and the global atmosphere light by using a defogging algorithm based on a physical model so as to recover a defogging image; And 7, performing ship target detection, namely performing sea fog judgment on the input video stream, performing ship detection by directly using the weight file obtained in the step 4 if no sea fog exists, performing ship detection after defogging if fog exists, and automatically marking a ship target in the ship target video stream.
- 2. The method for detecting the target of the light-weight high-precision ship for coping with the complex environment according to claim 1, wherein a penalty term formula of Focal Loss EIOU in the step 3 is as follows: (3); wherein, gamma is a parameter for controlling the suppression degree of abnormal values, Is the resulting overlap ratio of the prediction frame and the anchor frame, (2); Wherein, the And Is the width and height of the smallest circumscribed rectangular box covering the prediction box and the anchor box, Represents the diagonal distance of the smallest bounding rectangle that can contain both the prediction box and the anchor box, 、 、 Respectively, overlap loss, center distance loss and width-height loss, Represented as a function of the calculated euclidean distance for the two inputs, And Representing the center points of the prediction and anchor frames respectively, And Representing the widths of the prediction frame and the anchor frame respectively, And Representing the heights of the prediction box and the anchor box, respectively.
- 3. The method for detecting a light-weight high-precision ship target according to claim 1, wherein the image ambiguity in step 5 is calculated using the laplace operator, and the method is For the Laplacian, then for discrete digital images The second partial derivative is as follows: (4); the laplace operator is expressed as: (5); The corresponding Laplace operator matrix is: (6); and converting the first frame image into a single-channel gray level image, then carrying out convolution operation with a Laplacian operator, finally calculating the output variance, and if the variance is smaller than a certain value, treating the image as foggy.
- 4. The method for detecting the target of the ship with the light weight and high precision in the complex environment according to claim 1, wherein the structural similarity of the images in the step 5 is evaluated by three aspects of brightness, contrast and structure, and for a given two images x and y, the structural similarity of the two images is defined as: (7); Wherein, the , The brightness is compared with that of the light, The contrast ratio is compared and, Comparing the structures; ; average value and standard deviation of x and y, respectively; As a result of the covariance, Are all constant and are used for the preparation of the high-voltage power supply, And calculating a structural similarity value between the two images, wherein the smaller the structural similarity value is, the larger the difference between the two images is, namely, the worse the quality of the input environment image is, and when the structural similarity value is smaller than a certain value, the image is regarded as foggy.
- 5. The method for detecting the target of the light-weight high-precision ship for coping with the complex environment according to claim 1, wherein the specific process of estimating the ambient light and the global atmosphere light by using the defogging algorithm based on the physical model in the step 6 to recover the defogging image is as follows: In the field of computer vision, the effect of sea fog on images is typically simulated using the following model: (8); wherein H (x) is an original image to be defogged, F (x) is a defogging image, x is a spatial coordinate of an image pixel, r is an atmospheric scattering coefficient, d is a scene depth, A is global atmospheric light, The transmittance at x is indicated and, Referred to as ambient light; By using Representing ambient light, equation (8) may be rewritten as: (9); therefore, the haze-free image F (x) can be restored by calculating the ambient light L (x) and the global atmospheric light a from the original image H (x); estimating ambient light L (x) and global atmospheric light A by using a defogging algorithm based on a physical model; (1) Estimating ambient light L (x): When the transmittance is represented by t (x), the expression (8) can be rewritten as: (10); From the formula (10): (11); Taking the minimum value in the H (x) three channels and marking as M (x): (12); thus, equation (11) can be transformed into: (13); the right side of equation (13) is subjected to mean filtering: (14); Wherein the method comprises the steps of Representing the sliding window size of the mean filter, Ω (x) represents pixel x The average filtered results reflect the general trend of t (x) and thus yield a rough estimate of the transmission t (x): (15); Wherein the method comprises the steps of ; In order to solve the problem that the defogging image has dark overall picture, the average value of the image is adjusted I.e. , wherein, Is the average of all pixels in M (x), Is an adjusting factor, so that a calculation formula of the transmissivity can be obtained: (16); the available ambient light is: (17); (2) Estimating global atmospheric light: the range of values of the expression on the left side of the intermediate expression in the expression (14) is 0,1, and can be obtained And also have Therefore, the value range of the global atmosphere light can be determined as The method comprises the following steps: (18); Wherein, the Due to Is difficult to obtain, for the sake of algorithm rapidity 0.5, Global atmospheric light: (19) and restoring the haze-free image F (x) by using a physical model according to the obtained ambient light L (x) and the global atmosphere light A: (20)。
Description
Light-weight high-precision ship target detection method coping with complex environment Technical Field The invention relates to the technical field of target detection, in particular to a light-weight high-precision ship target detection method for coping with complex environments. Background With the vigorous development of the water transportation industry, the water traffic safety situation faces serious examination. As an important carrier for waterway transportation, accurate identification of the ship type and detection of the ship position are of great significance for sensing waterway traffic conditions, guaranteeing ship navigation safety and early warning of water illegal behaviors. Accurate and efficient detection of ship targets is the basis for follow-up advanced visual tasks such as ship behavior recognition and track tracking. Compared with road vehicle detection, the real-time detection of the marine vessel target in the complex environment is more challenging due to complex navigation environment, sea fog, water vapor and other bad weather influences. The conventional target detection algorithm is mainly divided into a target detection algorithm of a conventional method and a target detection algorithm based on deep learning, wherein the conventional target detection algorithm is generally divided into three steps, namely, firstly, an image is input, a candidate region is generated on the image, secondly, artificial features are extracted from the candidate region, and finally, a classifier is trained and image classification is carried out. The target detection algorithms based on deep learning are mainly divided into two types, one type is a target detection algorithm based on candidate areas, such as R-CNN, fast R-CNN and Fast R-CNN, and the type of algorithm firstly selects candidate areas of an input image and then classifies and carries out position regression on the candidate areas to realize target detection. The other type is a regression-based target detection algorithm, such as SSD and YOLO, which omits the candidate region generation step, directly integrates the feature extraction, target classification and position regression processes into a convolutional neural network, and converts the target detection process into an end-to-end regression problem. Currently, in the field of water traffic, the following defects still exist in research on the problem of ship target detection in a complex environment: (1) The method is suitable for single scene, and is difficult to solve the problem of ship target detection in complex environments such as sea fog. The existing target detection algorithm has the problems of low detection precision, poor model generalization capability and the like when facing complex environments such as sea fog and the like because the input image is not subjected to defogging pretreatment before target detection. (2) The model weight file is too huge and is difficult to be deployed on a micro-computing power and low-power consumption platform. In the existing target detection model, the weight file of YOLOv4 is about 244M, and the weight file of the smallest YOLOv s model in the Yolov5 series is about 15M, which limits the deployment of the model in a micro-computing force platform to a great extent. Disclosure of Invention The invention provides a light-weight high-precision ship target detection method for complex environments based on deep learning. In order to achieve the above purpose, the present invention adopts the following technical scheme: the invention provides a light-weight high-precision ship target detection method for coping with complex environments, which specifically comprises the following steps: The method comprises the steps of 1, modifying an original network by using a lightweight network, and replacing a YOLOv s backbone feature extraction network with a MobileNetv-small network with a smaller parameter by a CSPDARKNET network with a larger parameter; And 2, designing a variable convolution module, and replacing two common convolution modules close to the detection head with the variable convolution module, wherein a convolution kernel of a variable convolution network (DCN) has the capacity of adapting to the shape of a target to generate spatial deformation, and the convolution kernel can be dynamically adjusted according to the identified target so as to capture the image characteristics of objects with different scales or shapes. And 3, optimizing the Loss function, namely optimizing a frame regression Loss part of the Loss function guiding the network to perform optimization from CIOU-Loss to Focal Loss EIOU, and separating a high-quality anchor frame from a low-quality anchor frame from the gradient perspective by Focal Loss EIOU, so that the problem of sample unbalance in a boundary frame regression task is further optimized, and the regression process is focused on the high-quality anchor frame. Training and verifying the