A lightweight high-precision ship target detection method for complex environment
By modifying and optimizing the loss function using a lightweight network, and combining it with sea fog detection and image defogging modules, the problems of low accuracy and difficult model deployment in complex environments for ship target detection are solved, achieving high-precision and lightweight ship target detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI MARITIME UNIVERSITY
- Filing Date
- 2021-10-13
- Publication Date
- 2026-05-08
AI Technical Summary
Existing ship target detection algorithms have low detection accuracy in complex environments, poor model generalization ability, and excessively large model weight files, making them difficult to deploy on low-computing-power, low-power platforms.
A lightweight network modification was adopted, replacing the CSPDarkNet53 network with MobileNetv3-small. A variable convolution module was designed and the loss function was optimized to Focal Loss EIOU. A fog environment judgment and image dehazing module were introduced into the model, and a physics-based dehazing algorithm was used to restore fog-free images.
It achieves high-precision ship target detection in complex environments such as sea fog, with a recognition accuracy of 94% and an average recognition speed of 253 frames/second. The model weight file is reduced by 40%, making it suitable for micro-computing platforms.
Smart Images

Figure CN113989613B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and in particular to a lightweight, high-precision method for detecting ship targets in complex environments. Background Technology
[0002] With the booming development of the water transport industry, maritime traffic safety faces severe challenges. As a crucial carrier of waterway transportation, accurate identification of vessel types and detection of vessel positions are of paramount importance for understanding waterway traffic conditions, ensuring safe navigation, and providing early warnings of maritime violations. Accurate and efficient detection of vessel targets is fundamental for subsequent advanced vision tasks such as vessel behavior recognition and trajectory tracking. Compared to road vehicle detection, real-time detection of maritime vessels in complex environments, including those affected by sea fog and water vapor, presents a greater challenge.
[0003] Existing object detection algorithms are mainly divided into traditional methods and deep learning-based methods. Traditional object detection algorithms generally consist of three steps: first, inputting an image and generating candidate regions; second, extracting manually generated features from the candidate regions; and finally, training a classifier and classifying the image. Deep learning-based object detection algorithms are mainly divided into two categories: one is candidate region-based algorithms, such as R-CNN, Fast R-CNN, and Faster R-CNN. These algorithms first select candidate regions from the input image, then classify and regress their locations to achieve object detection. The other is regression-based algorithms, such as SSD and YOLO. These algorithms omit the candidate region generation step and directly integrate feature extraction, object classification, and location regression into a single convolutional neural network, transforming the object detection process into an end-to-end regression problem.
[0004] Currently, in the field of water transportation, research on ship target detection in complex environments still has the following shortcomings:
[0005] (1) The applicable scenarios are limited, making it difficult to solve the problem of ship target detection in complex environments such as sea fog. Existing target detection algorithms suffer from low detection accuracy and poor model generalization ability when facing complex environments such as sea fog because they do not perform dehazing preprocessing on the input image before target detection.
[0006] (2) The model weight file is too large, making it difficult to deploy on platforms with low computing power and low power consumption. Among the existing target detection models, the weight file of YOLOv4 is about 244M, and the weight file of the smallest YOLOv5s model in the YOLOv5 series is about 15M. This greatly limits the deployment of the model on platforms with low computing power. Summary of the Invention
[0007] To address the above problems, this invention provides a lightweight, high-precision ship target detection method based on deep learning for handling complex environments.
[0008] To achieve the above objectives, the present invention employs the following technical solutions:
[0009] This invention provides a lightweight, high-precision method for detecting ship targets in complex environments, specifically including the following steps:
[0010] Step 1, Model Lightweighting Modification: Modify the original network using a lightweight network, replacing the backbone feature extraction network of YOLOv5s from the CSPDarkNet53 network with a large number of parameters with the MobileNetv3-small network with a small number of parameters.
[0011] Step 2: Design a variable convolution module and replace the two ordinary convolution modules near the detection head with a variable convolution module; the convolution kernel of the variable convolution network (DCN) has the ability to adapt to the shape of the target and undergo spatial deformation, and can dynamically adjust the convolution kernel according to the target to capture the image features of objects of different scales or shapes.
[0012] Step 3, optimize the loss function: optimize the bounding box regression loss part of the loss function that guides the network optimization from CIOU-Loss to Focal Loss EIOU; Focal Loss EIOU separates high-quality anchor boxes from low-quality anchor boxes from the perspective of gradient, further optimizing the sample imbalance problem in the bounding box regression task, and making the regression process focus on high-quality anchor boxes.
[0013] Step 4, Model Training and Validation: Train the YOLOv5s model improved in Steps 1-3, optimize the network parameters, obtain the weight file for detection, and validate it.
[0014] Step 5: Design a fog environment judgment module. Use the blurriness of the image and the structural similarity of the image as indicators to judge whether there is fog in the environment. If both indicators indicate that the image is foggy, then the environment is foggy.
[0015] Step 6: Construct an image dehazing module, using a physical model-based dehazing algorithm to estimate ambient light and global atmospheric light, thereby recovering a haze-free image;
[0016] Step 7, perform ship target detection: determine sea fog on the input video stream. If there is no fog, directly use the weight file obtained in step 4 to perform ship detection. If there is fog, perform ship detection after defogging and automatically mark ship targets in the ship target video stream.
[0017] Furthermore, the design of the variable convolution module in step 2 is specifically as follows: the variable convolution layer, the batch normalization layer, and the activation function layer are connected sequentially to construct the variable convolution module.
[0018] Furthermore, the formula for the penalty term of Focal Loss EIOU in step 3 is as follows:
[0019] L Focl-EIOU =IOU γ L EIOU (3)
[0020] Where γ is a parameter controlling the degree of outlier suppression, and IOU is the overlap ratio between the generated predicted bounding box and the anchor box.
[0021]
[0022] Among them, c w and c h It represents the width and height of the smallest bounding rectangle that covers both the prediction box and the anchor box, where c represents the diagonal distance of the smallest bounding rectangle that can simultaneously contain both the prediction box and the anchor box, and L represents the width and height of the bounding rectangle. IOU L dis L asp These represent the overlap loss, center distance loss, and width / height loss, respectively. ρ is a function used to calculate the Euclidean distance between the two inputs, and b and b' represent the distance between them. gt w and w' represent the center points of the predicted bounding box and the anchor box, respectively. gt Let h and h represent the widths of the prediction box and the anchor box, respectively. gt These represent the heights of the prediction box and the anchor box, respectively.
[0023] Furthermore, in step 5, the blurriness of the image is calculated using the Laplacian operator, let ▽ 2 If f is the Laplace operator, then its second-order partial derivative for a discrete digital image f(i,j) is:
[0024]
[0025] Therefore, the Laplace operator is expressed as:
[0026]
[0027] The corresponding Laplacian operator matrix is:
[0028]
[0029] The first frame image is converted into a single-channel grayscale image, then convolved with the Laplacian operator, and finally the variance of the output is calculated. If the variance is less than a certain value, the image is considered to be foggy.
[0030] In step 5, the structural similarity of images is evaluated through three aspects: brightness, contrast, and structure. For two given images x and y, their structural similarity is defined as:
[0031] SSIM(x,y)=[l(x,y) α c(x,y) β ][s(x,y)] γ (7)
[0032] in,
[0033] l(x,y) compares brightness, c(x,y) compares contrast, and s(x,y) compares structure.
[0034] α,β,γ>0;μ x ,μ y ,σ x ,σ y Let x and y be the mean and standard deviation, respectively.
[0035] σ xy The covariance is C1, C2, and C3, which are all constants.
[0036] Calculate the structural similarity value between two images. The smaller the value, the greater the difference between the two images, that is, the worse the quality of the input environment image. If the structural similarity value is less than a certain value, the image is considered to be foggy.
[0037] Furthermore, the specific process of using a physical model-based dehazing algorithm in step 6 to estimate ambient light and global atmospheric light, thereby recovering the haze-free image, is as follows:
[0038] In the field of computer vision, the impact of sea fog on images is typically simulated using the following model:
[0039] H(x)=F(x)e -rd(x) +A(1-e -rd(x) (8)
[0040] Where H(x) is the original image to be dehazed, F(x) is the haze-free image, x is the spatial coordinate of the image pixel, r is the atmospheric scattering coefficient, d is the scene depth, A is the global atmospheric light, and e is the atmospheric scattering coefficient. -rd(x) A(1-e) represents the transmittance at point x. -rd(x) This is called ambient light;
[0041] Let L(x) represent ambient light, then equation (8) can be rewritten as:
[0042]
[0043] Therefore, as long as the ambient light L(x) and global atmospheric light A are calculated from the original image H(x), the fog-free image F(x) can be recovered.
[0044] A physical model-based defogging algorithm is used to estimate ambient light L(x) and global atmospheric light A;
[0045] (1) Estimate ambient light L(x):
[0046] Let t(x) represent the transmittance, then equation (8) can be rewritten as:
[0047] H(x)=F(x)t(x)+A(1-t(x)) (10)
[0048] From equation (10), we can see that:
[0049]
[0050] Take the minimum value among the three channels of H(x) and denote it as M(x):
[0051]
[0052] Therefore, equation (11) can be transformed into:
[0053]
[0054] Apply mean filtering to the right side of equation (13):
[0055]
[0056] Where s a Ω(x) represents the sliding window size of the mean filter, and Ω(x) represents the s-value of pixel x. a ×s a In the vicinity of the target region, the result after mean filtering can reflect the general trend of t(x), thus yielding a rough estimate of the transmittance t(x):
[0057]
[0058] in δ = 1 - ψ, ψ ∈ [0, 1], therefore δ ∈ [0, 1];
[0059] To address the issue of an overall dark image after dehazing, δ is adjusted based on the image's mean, i.e., δ = ρm av , where m av ρ is the mean of all pixels in M(x), and ρ is an adjustment factor; therefore, the formula for calculating transmittance can be obtained:
[0060]
[0061] The ambient light can be obtained as follows:
[0062] L(x) = min(1-min(ρm) av ,0.9)M ave (x),M(x)) (17)
[0063] (2) Estimating global atmospheric light:
[0064] In equation (14), the range of values for the expression on the left side should be [0, 1], which leads to the conclusion that A ≥ max(M). ave (x)), and A≤max(max) c∈r,g,b (H c (x)));Therefore, the range of values for global atmospheric light can be determined to be max(M) ave (x))≤A≤max(max c∈r,g,b (H c (x))), that is:
[0065] A = εmax(max) c∈r,g,b (H c (x)))+(1-ε)max(M ave (x)) (18)
[0066] Where 0 ≤ ε ≤ 1, and since the exact value of ε is difficult to obtain, for the sake of algorithm speed, ε is taken as 0.5, so the global atmospheric light is:
[0067]
[0068] Based on the obtained ambient light L(x) and global atmospheric light A, the fog-free image F(x) is reconstructed using a physical model:
[0069]
[0070] Compared with the prior art, the present invention has the following advantages:
[0071] 1. The method proposed in this invention achieves a ship identification accuracy of 94% after defogging treatment, with an average identification speed of 253 frames / second, which meets the requirements for real-time ship target detection and can efficiently and accurately detect ships in real-time under sea fog weather conditions.
[0072] 2. This invention replaces the YOLOv5s backbone feature extraction network, which has a large number of parameters, with the MobileNetv3-small network, which has fewer parameters, thus achieving a lightweight transformation of the model. A variable convolutional module is constructed by sequentially connecting the variable convolutional layer, batch normalization layer, and activation function layer, and the two ordinary convolutional modules near the detection head are replaced with variable convolutional modules. The bounding box regression loss part of the loss function that guides network optimization is optimized from CIOU-Loss to Focal Loss EIOU, separating high-quality and low-quality anchor boxes, further optimizing the sample imbalance problem in the bounding box regression task, and focusing the regression process on high-quality anchor boxes. Through the above modifications to the model, the number of model parameters is reduced, resulting in a 40% smaller weight file size after training compared to the previous lightweight version, making it easier to deploy on platforms with low computing power and low power consumption.
[0073] 3. This invention designs a sea fog environment judgment module and establishes a sea fog environment judgment method, using image blurriness and image structural similarity as indicators for sea fog judgment. Furthermore, this invention also designs an image defogging module, using a physics-based defogging algorithm to estimate ambient light and global atmospheric light, thereby recovering a fog-free image. Therefore, the method of this invention can be used for real-time detection of ship targets in complex environments such as sea fog, improving the detection accuracy in such environments. Attached Figure Description
[0074] Figure 1 This is a flowchart of the present invention;
[0075] Figure 2 This is a diagram of the improved YOLOv5s network structure in this invention;
[0076] Figure 3 This is a diagram illustrating the ship inspection results of this invention in foggy weather. Detailed Implementation
[0077] The technical solutions of the present invention will be described in detail below with reference to the embodiments and accompanying drawings. It should be noted that those skilled in the art can make several modifications and improvements without departing from the principle of the present invention, and these should also be considered to fall within the protection scope of the present invention.
[0078] Lightweight, high-precision ship target detection for complex environments: The specific process is as follows Figure 1 As shown:
[0079] (1) Lightweighting of the model:
[0080] First, through parameter analysis, the backbone feature extraction network of YOLOv5s was replaced by the parameter-intensive CSPDarkNet53 network with the parameter-efficient MobileNetv3-small network. The MobileNetv3 network integrates the ideas of three models: depthwise separable convolution, inverse residual structure with linear bottleneck, and a lightweight attention model based on the Squeeze and Excitation (SE) structure. Furthermore, it uses the h-swish activation function instead of the original swish activation function. The expression for the h-swish activation function is as follows:
[0081]
[0082] Then, a lightweight attention model based on the SE structure is applied to other parts of the network. The SE model structure considers the relationships between channels to improve network performance. It can explicitly establish the interdependencies between feature channels, learn the importance of each feature channel, and increase the weight of useful features according to this importance, while suppressing features that are not useful for the current task.
[0083] (2) Design a variable convolution module:
[0084] A variable convolutional (DBH) module was constructed by sequentially connecting a variable convolutional layer, a batch normalization layer, and an activation function layer, and the two ordinary convolutional modules near the detection head were replaced with the variable convolutional module.
[0085] (3) Optimize the loss function: replace CIOU-Loss with Focal Loss EIOU.
[0086] The original YOLOv5 used CIOU-Loss as the loss function for bounding box regression. While CIOU-Loss considers the overlap area, center distance, and aspect ratio of the bounding box regression, it does not reflect the aspect ratio as a true measure of the difference between the width and height and their confidence scores. To address this issue, EIOU-Loss decomposes the aspect ratio loss term into the difference between the predicted width and height and the minimum bounding box width and height, accelerating convergence and improving regression accuracy. The EIOU loss function consists of three parts: overlap loss, center distance loss, and width / height loss. The first two parts follow the method in CIOU, but the width / height loss directly minimizes the difference in width and height between the predicted box and the anchor box, resulting in faster convergence. The penalty term formula is as follows:
[0087]
[0088] Among them, C w and C hIt represents the width and height of the smallest bounding rectangle that covers both the prediction box and the anchor box, where c represents the diagonal distance of the smallest bounding rectangle that can simultaneously contain both the prediction box and the anchor box, and L represents the width and height of the bounding rectangle. IOU L dis L asp These represent the overlap loss, center distance loss, and width / height loss, respectively. ρ represents the function used to calculate the Euclidean distance between the two inputs, and b and b' represent the values of the two inputs. gt Let w and w represent the center point of the predicted bounding box and the anchor box, respectively. gt These represent the width, h, and h of the prediction box and anchor box, respectively. gt These represent the heights of the prediction box and the anchor box, respectively.
[0089] Focal Loss EIOU, from the perspective of gradient, separates high-quality anchor boxes from low-quality anchor boxes, further optimizing the sample imbalance problem in bounding box regression tasks and focusing the regression process on high-quality anchor boxes. Its penalty term formula is as follows:
[0090] L Focl-EIOU =IOU γ L EIOU (3)
[0091] Where γ is a parameter that controls the degree of outlier suppression, and IOU is the overlap rate between the generated prediction box and the anchor box. According to the above formula: the higher the IOU, the greater the loss, and the better the regression target, the greater the loss, which helps to improve the regression accuracy.
[0092] The improved YOLOv5s network structure diagram is as follows: Figure 2 As shown.
[0093] (4) Model training:
[0094] The publicly available SeaShips ship dataset was chosen for use. SeaShips is a large ship dataset covering six common ship types (ore carriers, bulk carriers, general cargo ships, container ships, fishing boats, and passenger ships). All images were acquired by a video surveillance system along the coastline surrounding Hengqin Island, encompassing images of ships of different sizes, from different viewing directions, under different lighting levels, and with varying degrees of occlusion. The experiment used 7000 ship images from the publicly available portion of the SeaShips dataset, of which 6000 images were used as the training set, 600 as the validation set, and 400 as the test set.
[0095] The input image size was uniformly set to 640*640 JPG images, the batch size was set to 48, the epoch was set to 200, and the learning rate was set to 0.01. The learning rate of the network was adjusted by simulating the cosine annealing strategy. After training, the weight file was obtained. It was verified that the size of the obtained weight file was reduced by 40% compared with that before the lightweight improvement.
[0096] (5) Design a sea fog environment judgment module:
[0097] Due to the relative invariance of the video background environment, to meet the requirements of real-time detection, the first frame of the input video stream is first evaluated for image sharpness to determine if the image is foggy. Image blurriness and structural similarity to a reference image are used as criteria for determining whether an image is foggy. If both criteria indicate fog, the next step of dehazing is performed.
[0098] The Laplacian operator is used to calculate the blur of an image; the Laplacian operation is a linear combination of partial derivative operations. Let ▽ 2 If f is the Laplace operator, then its second-order partial derivative for a discrete digital image f(i,j) is:
[0099]
[0100] Therefore, the Laplace operator is expressed as:
[0101]
[0102] The corresponding Laplacian operator matrix is:
[0103]
[0104] First, the first frame image is converted into a single-channel grayscale image, then convolved with the Laplacian operator, and finally the variance of the output is calculated. If the variance is less than a certain value, the image is considered to be foggy.
[0105] Structural similarity (SSIM) reflects the similarity between two images. When two images are a sharp image and a blurry image, respectively, their structural similarity can serve as a measure of image quality. The basic idea of structural similarity is to evaluate the similarity between two images through three aspects: brightness, contrast, and structure. For two images x and y, their structural similarity is defined as:
[0106] SSIM(x,y)=[l(x,y) α c(x,y) β ][s(x,y)] γ (7)
[0107] in:
[0108] l(x,y) compares brightness, c(x,y) compares contrast, and s(x,y) compares structure.
[0109] α,β,γ>0;
[0110] μ x ,μ y ,σ x ,σ y Let x and y be the mean and standard deviation, respectively.
[0111] σ xy For covariance;
[0112] C1, C2, and C3 are all constants.
[0113] A clear, fog-free image from the dataset is fixed as the reference image x, and the first frame of the input video stream is used as y. The structural similarity value between the two images is calculated. The smaller the value, the greater the difference between the two images, indicating a poorer quality of the input environment image. If the structural similarity value is less than a certain value, the image is considered to be foggy.
[0114] (6) Construct an image dehazing module:
[0115] In the field of computer vision, the impact of sea fog on images is typically simulated using the following model:
[0116] H(x)=F(x)e -rd(x) +A(1-e -rd(x) (8)
[0117] Where H(x) is the original image to be dehazed, F(x) is the haze-free image, x is the spatial coordinate of the image pixel, r is the atmospheric scattering coefficient, d is the scene depth, A is the global atmospheric light, and e is the atmospheric scattering coefficient. -rd(x) A(1-e) represents the transmittance at point x. -rd(x) This is called ambient light. Let L(x) represent ambient light, then equation (8) can be rewritten as:
[0118]
[0119] Therefore, as long as the ambient light L(x) and global atmospheric light A are calculated from the original image H(x), the fog-free image F(x) can be recovered. A dehazing algorithm based on a physical model is used to estimate the ambient light and global atmospheric light.
[0120] Estimate ambient light:
[0121] Let t(x) represent the transmittance, then equation (8) can be rewritten as:
[0122] H(x)=F(x)t(x)+A(1-t(x)) (10)
[0123] From equation (10), we can see that:
[0124]
[0125] Take the minimum value among the three channels of H(x) and denote it as M(x):
[0126]
[0127] Therefore, equation (11) can be transformed into:
[0128]
[0129] Apply mean filtering to the right side of equation (13):
[0130]
[0131] Where s a Ω(x) represents the sliding window size of the mean filter, and Ω(x) represents the s-value of pixel x. a ×s a The neighboring region. The result after mean filtering can reflect the general trend of t(x), thus yielding a rough estimate of the transmittance:
[0132]
[0133] in δ = 1 - ψ, ψ ∈ [0, 1], therefore δ ∈ [0, 1].
[0134] To address the issue of an overall dark image after dehazing, δ is adjusted based on the image's mean, i.e., δ = ρm av , where m av ρ is the mean value of all pixels in M(x), and ρ is an adjustment factor. Therefore, the formula for calculating transmittance can be obtained:
[0135]
[0136] The ambient light can be obtained as follows:
[0137] L(x) = min(1-min(ρm) av ,0.9)M ave (x),M(x)) (17)
[0138] Estimate global atmospheric light
[0139] In equation (14), the range of values for the expression on the left side should be [0, 1], which leads to the conclusion that A ≥ max(M). ave (x)), and A≤max(max) c∈r,g,b (H c (x))). Therefore, the range of values for global atmospheric light can be determined to be max(M). ave (x))≤A≤max(max c∈r,g,b (H c(x))), that is:
[0140] A = εmax(max) c∈r,g,b (H c (x)))+(1-ε)max(M ave (x)) (18)
[0141] Where 0 ≤ ε ≤ 1, and since the exact value of ε is difficult to obtain, for the sake of algorithm speed, ε is taken as 0.5, so the global atmospheric light:
[0142]
[0143] Based on the obtained ambient light L(x) and global atmospheric light A, the fog-free image F(x) is reconstructed using a physical model:
[0144]
[0145] (7) Use the method in step (5) to determine the sea fog in the input video stream. If there is no fog, use the weight file obtained in step (4) to detect ships directly. If there is fog, use the defogging method in step (6) to defog the video stream and then use the weight file obtained in step (4) to detect ships. Automatically mark ship targets in the ship target video stream.
[0146] The method of this invention achieves a ship identification accuracy of 94% after defogging treatment, with an average identification speed of 253 frames / second, meeting the requirements for real-time ship target detection and enabling efficient and accurate ship detection in real-time under sea fog weather conditions. Figure 3 This image shows the ship inspection results of the present invention in foggy weather, demonstrating the effectiveness of the method.
Claims
1. A lightweight, high-precision method for detecting ship targets in complex environments, characterized in that, Specifically, the following steps are included: Step 1, Model Lightweighting Modification: Modify the original network using a lightweight network, replacing the backbone feature extraction network of YOLOv5s from the CSPDarkNet53 network with the MobileNetv3-small network; Step 2: Design a variable convolution module and replace the two ordinary convolution modules near the detection head with a variable convolution module. The design of the variable convolution module is as follows: connect the variable convolution layer, the batch normalization layer and the activation function layer in sequence to construct a variable convolution module. The convolution kernel of the variable convolution network has the ability to adapt to the shape of the target and undergo spatial deformation. It can dynamically adjust the convolution kernel according to the target to be identified, thereby capturing the image features of objects of different scales or shapes. Step 3, optimize the loss function: optimize the bounding box regression loss part of the loss function that guides the network optimization from CIOU-Loss to Focal Loss EIOU; Step 4, Model Training and Validation: Train the YOLOv5s model improved in Steps 1-3, optimize the network parameters, obtain the weight file for detection, and validate it. Step 5: Design a fog environment judgment module. Use the blurriness of the image and the structural similarity of the image as indicators to judge whether there is fog in the environment. If both indicators indicate that the image is foggy, then the environment is foggy. Step 6: Construct an image dehazing module, using a physical model-based dehazing algorithm to estimate ambient light and global atmospheric light, thereby recovering a haze-free image; Step 7, perform ship target detection: determine sea fog on the input video stream. If there is no fog, directly use the weight file obtained in step 4 to perform ship detection. If there is fog, perform ship detection after defogging and automatically mark ship targets in the ship target video stream.
2. The lightweight, high-precision ship target detection method for complex environments according to claim 1, characterized in that, The formula for the penalty term of Focal Loss EIOU in step 3 is as follows: (3); in, γ Parameters for controlling the degree of outlier suppression. It is the overlap rate between the generated predicted bounding box and the anchor box. (2); in, and It is the width and height of the smallest bounding rectangle that covers the prediction box and the anchor box. This represents the diagonal distance of the smallest bounding rectangle that can simultaneously contain both the prediction box and the anchor box. , , These represent the overlap loss, center distance loss, and width / height loss, respectively. It is represented as a function that calculates the Euclidean distance between two input quantities. and These represent the center points of the prediction box and the anchor box, respectively. and These represent the widths of the prediction box and the anchor box, respectively. and These represent the heights of the prediction box and the anchor box, respectively.
3. The lightweight, high-precision ship target detection method for complex environments according to claim 1, characterized in that, In step 5, the blurriness of the image is calculated using the Laplacian operator. If it is the Laplacian operator, then for discrete digital images Its second-order partial derivative is: (4); Therefore, the Laplace operator is expressed as: (5); The corresponding Laplacian operator matrix is: (6); The first frame image is converted into a single-channel grayscale image, then convolved with the Laplacian operator, and finally the variance of the output is calculated. If the variance is less than a certain value, the image is considered to be foggy.
4. The lightweight, high-precision ship target detection method for complex environments according to claim 1, characterized in that, In step 5, the structural similarity of the images is evaluated using three aspects: brightness, contrast, and structure. For a given two images... x , y The structural similarity between the two is defined as: (7); in, , Compare brightness, Compare contrast, Comparative structures; ; Let x and y be the mean and standard deviation, respectively. For covariance, All are constants. Calculate the structural similarity value between two images. The smaller the value, the greater the difference between the two images, that is, the worse the quality of the input environment image. If the structural similarity value is less than a certain value, the image is considered to be foggy.
5. The lightweight, high-precision ship target detection method for complex environments according to claim 1, characterized in that, The specific process of using a physical model-based dehazing algorithm in step 6 to estimate ambient light and global atmospheric light, thereby recovering the haze-free image, is as follows: In the field of computer vision, the impact of sea fog on images is typically simulated using the following model: (8); in, H(x) The original image to be dehazed. F(x) For fog-free images, x These are the spatial coordinates of the image pixels. r Atmospheric scattering coefficient, d For scene depth, A For global atmospheric light, express x Transmittance at that location It is called ambient light; use If we represent ambient light, then equation (8) can be rewritten as: (9); Therefore, as long as we start from the original image H(x) Ambient light is calculated L(x) and global atmospheric light A This allows the fog-free image to be recovered. F(x) ; A physical model-based dehazing algorithm is used for ambient light. L(x) and global atmospheric light A Make an estimate; (1) Estimating ambient light L(x) : use t(x) Let transmittance be the denoting factor, then equation (8) can be rewritten as: (10); From equation (10), we can see that: (11); Pick H(x) The minimum value among the three channels is denoted as... M(x) : (12); Therefore, equation (11) can be transformed into: (13); Apply mean filtering to the right side of equation (13): (14); in This indicates the size of the sliding window for mean filtering. Ω(x) Represents pixels x of The mean-filtered result can reflect the neighborhood of the target area. t(x) The general trend was observed, thus yielding the transmittance. t(x) Rough estimate: (15); in ; To address the issue of an overall dark image after dehazing, adjustments were made based on the image's average value. ,Right now ,in, yes M(x) The mean of all pixels in the image. It is an adjustment factor; therefore, the formula for calculating transmittance can be obtained: (16); The ambient light can be obtained as follows: (17); (2) Estimating global atmospheric light: In equation (14), the range of values for the expression on the left side should be [0, 1]. Therefore, we can derive... And there are Therefore, the range of values for global atmospheric light can be determined as follows: ,Right now: (18); in, ,because The exact value is difficult to obtain; therefore, for the sake of algorithm speed, we take... Since it is 0.5, the global atmospheric light is: (19) Based on the obtained ambient light L(x) and global atmospheric light A Using a physical model to recover a fog-free image F(x) : (20)。
Citation Information
Patent Citations
Remote sensing image ship detection method based on block extraction
CN111027511A
Large ship identification method based on combination of Faster R-CNN and dark channel defogging algorithm
CN111798388A