Remote sensing image tailing pond recognition algorithm based on improved loss function
By introducing the RIOU-Focal loss function into the tailings pond identification algorithm, the problems of low efficiency and insufficient accuracy of traditional tailings pond identification methods are solved, and more efficient and reliable tailings pond identification is achieved.
Patent Information
- Application Number
- CN202411365489.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional tailings pond identification methods rely on field investigations, consume a lot of manpower and material resources, and in complex environments, remote sensing image interpretation efficiency is low and the results are prone to deviations.
An algorithm for identifying tailings ponds in remote sensing images based on an improved loss function is proposed, and the RIOU-Focal loss function is used to accelerate YOLOv5-RF model training and improve detection accuracy.
It improves the efficiency and accuracy of tailings pond identification, provides more reliable data support for the monitoring and management of tailings ponds, and reduces environmental and safety risks.
Smart Images

Figure CN119339235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer and equipment management and control, and in particular to a remote sensing image tailings pond identification algorithm based on an improved loss function. Background Art
[0002] Tailings ponds are built by building dams to block valley mouths or enclosing land. They are used to store industrial waste slag and tailings generated in the process of development and utilization of metal or non-metallic mineral resources. Tailings ponds are conducive to the recovery of retained mineral components and the recycling of water resources, but they can easily become a high-potential hazard source during the tailings storage process. The distribution of tailings ponds is complex, and the downstream is mostly densely populated residential areas. The tailings contain toxic pollutants and harmful heavy metals. Therefore, once the dam structure becomes unstable, it will trigger disasters such as mudslides, which will not only endanger human life and property safety, but also cause serious and irreversible damage to the ecosystem.
[0003] Traditional tailings pond identification mostly relies on field investigations by scientific researchers, which requires a lot of manpower, material resources and time. With the development of remote sensing technology, the advantages of remote sensing images such as high spatial resolution, high spectral resolution and large range of acquired objects have led many scholars to use remote sensing images for visual interpretation and identification of tailings ponds. They can be roughly divided into the following three categories: one is to use human-computer interaction methods for visual interpretation, the second is to use the exponential model method to identify tailings ponds, and the third is to use computer semi-automatic interpretation methods. However, the semi-automatic interpretation processing efficiency is low, and the interpretation results of tailings pond images in complex environments are prone to deviations;
[0004] Based on this, the present invention proposes a remote sensing image tailings pond identification algorithm based on an improved loss function. The proposed RIOU-Focal loss function can not only accelerate the YOLOv5-RF model training process, but also improve the final detection accuracy, and provide more reliable data support and technical means for the monitoring and management of tailings ponds. This is of great practical significance for improving the management efficiency of tailings ponds and preventing potential environmental and safety hazards. Summary of the invention
[0005] The purpose of the present invention is to provide a remote sensing image tailings pond identification algorithm based on an improved loss function to solve the shortcomings of the background technology.
[0006] In order to achieve the above object, the present invention provides the following technical solution: a remote sensing image tailings pond recognition algorithm based on an improved loss function, the recognition algorithm comprising the following steps:
[0007] The input layer receives remote sensing images of various resolutions, and the backbone network extracts the basic features of the remote sensing images and outputs multiple scale feature maps. The intermediate network further extracts and fuses features from multiple scale feature maps.
[0008] The head network uses feature maps of at least three different scales for prediction, and each scale of the feature map generates a bounding box, category probability, and confidence score through a 1×1 convolution;
[0009] After evaluating the YOLOv5-RF model with the improved RIOU-Focal loss function, the back propagation method is used to calculate the gradient of the RIOU-Focal loss function relative to the YOLOv5-RF model parameters based on the evaluation results. The parameters of the YOLOv5-RF model are iteratively adjusted multiple times based on the gradient until the convergence conditions are met and the target box is retained.
[0010] In a preferred embodiment, the backbone network extracts basic features of the remote sensing image and then outputs multiple scale feature maps, including the following steps:
[0011] Remote sensing images first pass through the initial convolutional layer to extract low-level features, including edges, textures, and shapes;
[0012] The feature map is divided into two parts through the cross-stage partial network, a convolution operation is performed on one part, and the other part remains unchanged, and finally the two parts of features are merged;
[0013] The backbone network outputs multi-scale feature maps at different network layers. The feature maps vary in resolution and richness of semantic information, including low-level feature maps, mid-level feature maps, and high-level feature maps.
[0014] The backbone network finally outputs feature maps of multiple scales, which will serve as input for subsequent object detection tasks.
[0015] In a preferred embodiment, the YOLOv5-RF model is evaluated by the improved RIOU-Focal loss function, comprising the following steps:
[0016] Get the RIOU loss value and Focal-Loss loss value of the YOLOv5-RF model, combine the RIOU loss value and the Focal-Loss loss value to obtain the RIOU-Focal loss function, the function expression is: Total_Loss = λ1×RIOU_Loss+λ2×Focal_Loss, where Total_Loss is the RIOU-Focal loss value, RIOU_Loss is the RIOU loss value, Focal_Loss is the Focal-Loss loss value, λ1 and λ2 are the weight coefficients of the RIOU loss value and the Focal-Loss loss value, respectively, and λ1+λ2=1;
[0017] The obtained RIOU-Focal loss value is compared with the preset loss threshold. If the RIOU-Focal loss value is less than or equal to the loss threshold, the YOLOv5-RF model is evaluated to be up to standard. If the RIOU-Focal loss value is greater than the loss threshold, the YOLOv5-RF model is evaluated to be unsatisfactory.
[0018] In a preferred embodiment, the YOLOv5-RF model uses a back propagation method to calculate the gradient of the RIOU-Focal loss function relative to the YOLOv5-RF model parameters based on the evaluation results, and iteratively adjusts the parameters of the YOLOv5-RF model based on the gradient, including the following steps:
[0019] Back propagation calculates the gradient of the loss function relative to the model parameters, and uses the chain rule to calculate the gradient of the RIOU-Focal loss function relative to the parameters of each network layer. The gradient of the RIOU-Focal loss function for bounding box regression prediction is calculated. The RIOU-Focal loss function is the Focal-Loss loss value. Assuming the YOLOv5-RF model parameter is θ, the gradient calculation formula is:
[0020] In the formula, Indicates the sensitivity of the loss function to the model parameters; Indicates the impact of RIOU_Loss loss value on each parameter; Represents the influence of Focal_Loss loss value on each parameter, λ1 and λ2 are the weight coefficients of RIOU loss value and Focal-Loss loss value respectively, and λ1+λ2=1;
[0021] Update the parameters by the parameter update formula to obtain θ new , forward propagation, loss calculation, gradient calculation and parameter update are repeated until the model converges or reaches the preset training rounds.
[0022] In a preferred embodiment, the parameter updating formula is: In the formula, θ new is the updated parameter, θ old is the parameter before updating, δ is the learning rate, Indicates the sensitivity of the loss function to the model parameters.
[0023] In a preferred embodiment, the head network uses at least three feature maps of different scales for prediction, and each feature map of the scale generates a bounding box, a class probability, and a confidence score through a 1×1 convolution, including the following steps:
[0024] The head network receives feature maps of multiple scales generated by the intermediate network. Each feature map corresponds to objects of different sizes, including high resolution, medium resolution, and low resolution.
[0025] A 1×1 convolution operation is applied to the feature map of each scale, and the depth of the feature map is compressed to the required number of channels through the convolution kernel to generate the corresponding prediction;
[0026] Generate the position parameters of the candidate bounding box based on any output channel YOLOv5-RF model. The position parameters are used to locate the position and size of the target in the image.
[0027] Based on other output channels, the YOLOv5-RF model predicts the category probability of each candidate bounding box through the Softmax function;
[0028] The confidence score is calculated through the Sigmoid function. The confidence score indicates the model's confidence that the currently predicted bounding box contains the target object.
[0029] The non-maximum suppression algorithm is applied to the candidate boxes of each scale for screening, and the prediction results of the retained feature maps of different scales are merged to form the final target detection result.
[0030] In a preferred embodiment, the candidate boxes of each scale are screened by applying a non-maximum suppression algorithm, including the following steps:
[0031] Apply the non-maximum suppression algorithm to screen the candidate boxes of each scale, obtain the confidence score, category probability and overlap of the candidate boxes of the current scale, and comprehensively calculate the confidence score, category probability and overlap to obtain the screening amplitude;
[0032] The filtering amplitude is compared with the filtering threshold. If the filtering amplitude is greater than or equal to the filtering threshold, the current scale candidate box is retained. If the filtering amplitude is less than the filtering threshold, the current scale candidate box is filtered out.
[0033] In a preferred embodiment, the intermediate network further extracts and fuses features from multiple scale feature maps, including the following steps:
[0034] Starting from the high-level feature map through the feature pyramid structure, the semantic information of the high-level feature map is propagated downward layer by layer and fused with the low-level feature map;
[0035] The intermediate network also includes bottom-up path aggregation, which enables low-level feature maps to be back-propagated into high-level feature maps;
[0036] After multi-level feature fusion, the feature map is further processed through convolutional layers, activation functions, and normalization layers;
[0037] Finally, the feature map processed by the intermediate network generates multiple scale outputs. The multiple scale output feature maps correspond to objects of different sizes, and each scale feature map is used for the subsequent head network.
[0038] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0039] The present invention receives remote sensing images of various resolutions through an input layer, and a backbone network extracts basic features of remote sensing images and then outputs multiple scale feature maps. The intermediate network further extracts and fuses features of multiple scale feature maps. The head network uses at least three feature maps of different scales for prediction. The feature map of each scale generates a bounding box, a category probability and a confidence score through a 1×1 convolution. After evaluating the YOLOv5-RF model through an improved RIOU-Focal loss function, the gradient of the RIOU-Focal loss function relative to the YOLOv5-RF model parameters is calculated using a back propagation method based on the evaluation result. The RIOU-Focal loss function proposed by the recognition algorithm can not only accelerate the YOLOv5-RF model training process, but also improve the final detection accuracy, and provide more reliable data support and technical means for the monitoring and management of tailings ponds, which has important practical significance for improving the management efficiency of tailings ponds and preventing potential environmental and safety hazards. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0041] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Example 1: Please refer to Figure 1 As shown, the remote sensing image tailings pond recognition algorithm based on the improved loss function described in this embodiment includes the following steps:
[0044] Remote sensing images of various resolutions are received through the input layer, usually RGB three-channel images. The input size can be adjusted to adapt to different computing resources and detection requirements. Common input sizes are 640×640 or 1280×1280. This application uses 640×640. The backbone network (Backbone) extracts the basic features of the remote sensing image and outputs multiple scale feature maps. The backbone network is the backbone network, which is a deep convolutional neural network based on residual connections and cross-stage partial networks. It has powerful feature extraction capabilities. The feature map contains rich spatial and semantic information, which is suitable for subsequent target detection tasks.
[0045] The middle network (Neck) connects the backbone network and the head network (Detection-Head). The middle network further extracts and fuses features from feature maps of multiple scales. The middle network (Neck) is a path aggregation network (PANet) structure. It fuses feature maps by connecting horizontally and vertically to improve the diversity and robustness of feature map expression. The feature maps generated by the middle network are used to predict targets of different scales, thereby improving the detection capability of the YOLOv5-RF model for targets of different sizes.
[0046] The head network (Detection-Head) uses three feature maps of different scales for prediction, corresponding to the detection of large, medium and small objects respectively. The feature map of each scale generates a bounding box, category probability and confidence score through 1×1 convolution;
[0047] After evaluating the YOLOv5-RF model with the improved RIOU-Focal loss function, the YOLOv5;RF model uses the back propagation method to calculate the gradient of the RIOU-Focal loss function relative to the YOLOv5;RF model parameters based on the evaluation results, and iteratively adjusts the parameters of the YOLOv5;RF model multiple times based on the gradient until the convergence conditions are met and the most representative target box is retained.
[0048] This application receives remote sensing images of various resolutions through the input layer, and the backbone network extracts the basic features of the remote sensing images and outputs multiple scale feature maps. The intermediate network further extracts and fuses features from multiple scale feature maps. The head network uses at least three different scale feature maps for prediction. Each scale feature map generates a bounding box, category probability and confidence score through 1×1 convolution. After evaluating the YOLOv5-RF model through the improved RIOU-Focal loss function, the gradient of the RIOU-Focal loss function relative to the YOLOv5-RF model parameters is calculated using the back propagation method based on the evaluation results. The RIOU-Focal loss function proposed by the recognition algorithm can not only accelerate the YOLOv5-RF model training process, but also improve the final detection accuracy, providing more reliable data support and technical means for the monitoring and management of tailings ponds, which is of great practical significance for improving the management efficiency of tailings ponds and preventing potential environmental and safety hazards.
[0049] Remote sensing images of various resolutions are received through the input layer, usually RGB three-channel images. The input size can be adjusted to adapt to different computing resources and detection requirements. Common input sizes are 640×640 or 1280×1280. This application uses 640×640, including the following steps:
[0050] The input remote sensing image is adjusted to a fixed size of 640 × 640. If the resolution of the original image is high, it is adapted to the target size by downsampling or cropping; if it is small, it is enlarged by interpolation, and the image is normalized to scale the pixel value from [0, 255] to [0, 1] to ensure that the data is more stable during training.
[0051] In order to improve the robustness of the model, data augmentation techniques such as random flipping, rotation, cropping, color transformation, etc. are applied to generate diverse training samples.
[0052] The backbone network (Backbone) extracts the basic features of the remote sensing image and outputs multiple scale feature maps. The backbone network is a deep convolutional neural network based on residual connections and cross-stage partial networks. It has powerful feature extraction capabilities. The feature map contains rich spatial and semantic information and is suitable for subsequent target detection tasks. It includes the following steps:
[0053] Remote sensing images first pass through initial convolutional layers, which are usually used to extract low-level features such as edges, textures, and simple shapes;
[0054] The backbone network is an improved version of ResNet that utilizes residual connections, which can help the model transfer gradients more effectively, avoid the gradient vanishing problem, and improve the training efficiency and performance of the model. For example, in the task of detecting tailings ponds, low-level features may include the boundary lines of tailings ponds or obvious terrain changes.
[0055] The Cross-Stage Partial Network (CSP) divides the feature map into two parts, performs convolution operations on one part, and keeps the other part unchanged, and finally merges them. This can reduce the computational cost and further improve the feature expression ability, which is very important for processing remote sensing images in complex scenes because it can capture more spatial and semantic information.
[0056] The backbone network outputs multi-scale feature maps at different network layers. These feature maps vary in resolution and richness of semantic information:
[0057] Low-level feature maps (high resolution): retain more spatial details and are suitable for detecting small targets, such as small buildings or equipment in remote sensing images.
[0058] Mid-level feature maps: strike a balance between spatial details and semantic information, and are suitable for detecting medium-sized objects.
[0059] High-level feature maps (low resolution): contain richer semantic information and are suitable for detecting large targets, such as large tailings ponds or terrain changes in remote sensing images.
[0060] The backbone network finally outputs feature maps of multiple scales, which will serve as input for subsequent object detection tasks.
[0061] The middle network (Neck) connects the backbone network and the head network (Detection-Head). The middle network further extracts and fuses features from multiple scale feature maps. The middle network (Neck) is a path aggregation network (PANet) structure. It fuses feature maps by connecting horizontally and vertically to improve the diversity and robustness of feature map expression. The feature maps generated by the middle network are used to predict targets of different scales, thereby improving the detection ability of the YOLOv5-RF model for targets of different sizes. It includes the following steps:
[0062] The backbone network (such as CSPDarknet53) outputs feature maps of multiple scales, which contain spatial and semantic information at different resolutions. These feature maps represent layers with high resolution and low semantic information (suitable for small objects) and layers with low resolution and high semantic information (suitable for large objects).
[0063] Through the feature pyramid (FPN) structure, starting from the high-level feature map, the semantic information of the high-level feature map is propagated downward layer by layer and fused with the low-level feature map. In this process, the higher-level feature map is upsampled (usually using bilinear interpolation) and added or connected to the corresponding low-level feature map, thereby bringing rich semantic information into the higher-resolution feature map. For example, in remote sensing images, this step helps to transfer the overall features of a large-scale tailings pond to the low-level feature map in order to better detect its boundaries and shapes.
[0064] The intermediate network (Neck) also includes bottom-up path aggregation, which allows low-level feature maps (high resolution, low semantics) to be back-propagated to high-level feature maps. Through this bidirectional feature fusion (horizontal and vertical connections), the intermediate network (Neck) can fuse more information in feature maps of all levels, so that the feature maps of each layer have higher expression diversity and robustness. For example, this structure can enhance the detection ability of small targets because low-level spatial information can be passed to high-level feature maps through upsampling.
[0065] After multi-level feature fusion, the feature map can be further processed through convolutional layers, activation functions (such as ReLU or Leaky-ReLU), and normalization layers (such as Batch-Normalization). These steps can further enhance the expressiveness of the feature map, enabling it to better adapt to the detection needs of targets of different scales.
[0066] Finally, the feature map processed by the intermediate network (Neck) will generate outputs of multiple scales. The multiple scale output feature maps correspond to targets of different sizes. The feature map of each scale will be used in the subsequent head network (Detection-Head) to predict the target object of the corresponding scale. For example, lower resolution feature maps will be used to detect large-scale structures in remote sensing images (such as large tailings ponds), while higher resolution feature maps are used to detect smaller targets (such as small buildings or vehicles).
[0067] The head network (Detection-Head) uses three feature maps of different scales for prediction, corresponding to the detection of large, medium and small objects respectively. The feature map of each scale generates a bounding box, category probability and confidence score through a 1×1 convolution, including the following steps:
[0068] The head network receives feature maps of multiple scales generated by the middle network (Neck). Each feature map corresponds to objects of different sizes, usually including high resolution (small objects), medium resolution (medium-sized objects), and low resolution (large objects). For example, in remote sensing images, high-resolution feature maps may be used to detect small buildings or vehicles, medium-resolution feature maps are used to detect medium-sized objects such as houses, and large feature maps are used to detect large-scale terrain changes or tailings ponds.
[0069] A 1×1 convolution operation is applied to the feature map of each scale. The main function of this step is to compress the depth of the feature map to the required number of channels through the convolution kernel to generate the corresponding prediction. The 1×1 convolution operation does not change the width and height of the feature map, but it changes its number of channels, thereby generating an output that matches the number of categories and bounding box parameters. For example, if the model is to predict 3 types of targets and each candidate box has 4 bounding box coordinates (x, y, w, h) and 1 confidence score, then the number of output channels at each position is 3 (category) + 4 (coordinate) + 1 (confidence) = 8.
[0070] Based on any output channel, the YOLOv5-RF model generates the position parameters (x, y, w, h) of the candidate bounding box, where: x, y: represent the coordinates of the center of the bounding box. w, h: represent the width and height of the bounding box. These parameters are used to locate the position and size of the target in the image. The position of the bounding box is usually obtained by offset calculation based on the feature map, and then mapped back to the coordinates of the original image.
[0071] Based on the other output channels, the YOLOv5-RF model predicts the class probability of each candidate bounding box. The class probability of each location is calculated by the Softmax function, which converts the score of each class into a probability value, indicating the likelihood that the target belongs to a specific class. For example, when detecting tailings ponds, buildings, and roads in remote sensing images, the model calculates the probabilities of these classes separately and selects the class with the highest probability as the final prediction.
[0072] The confidence score is calculated through a Sigmoid function, which indicates the model's confidence that the currently predicted bounding box contains the target object.
[0073] The non-maximum suppression (NMS) algorithm is applied to the candidate boxes of each scale to screen and only the most likely detection results are retained. This step ensures the accuracy and clarity of the detection results and avoids multiple detections of the same target. The prediction results of the retained feature maps of different scales are merged to form the final target detection results. These results cover targets of different sizes, making the model more robust in complex scenes. The final output includes the category, bounding box coordinates, and confidence score of each detected target. The predicted bounding box coordinates are mapped back to the original image and output together with the category and confidence score to generate the final target detection result.
[0074] Generate the position parameters of the candidate bounding box based on any output channel YOLOv5-RF model. The position parameters are used to locate the position and size of the target in the image, including the following steps:
[0075] After the input image is processed by the backbone network (Backbone) and the middle network (Neck), a multi-scale feature map is generated. Each position of the feature map (i.e., each grid cell) may predict one or more candidate bounding boxes. For example, after the input image is processed, 80×80, 40×40, and 20×20 feature maps may be generated, and each cell of these feature maps corresponds to a part of the input image.
[0076] Each grid cell predicts the position parameters of the bounding box through the output channel, including the center coordinates (x, y), width (w), and height (h). These parameters do not directly give the absolute coordinates of the bounding box, but are predicted relative to the position of the grid cell.
[0077] The center coordinates (x, y) of each candidate bounding box are calculated by adding an offset (tx, ty) to the coordinates of the upper left corner of the grid cell (cx, cy): Where σ(*) represents the Sigmoid function, which limits the output between 0 and 1 to ensure that the center coordinate falls within the range of the current grid cell. For example, if the grid size of the feature map is 20×20, then the size of each grid cell is 32×32 pixels. The offset (tx, ty) will determine the specific position of the target in the grid cell.
[0078] The width (w) and height (h) are predicted relative to the preset anchor box (anchorbox), usually calculated by the following formula: In the formula, p w 、p h is the width and height of the anchor box, tw and th are the relative scale parameters predicted by the model, in this way, the model is able to generate a bounding box suitable for the actual target size. The choice of the preset anchor box is usually determined based on the size distribution of the target in the training data.
[0079] The calculated (x, y, w, h) is mapped from the coordinate system of the feature map back to the coordinate system of the input image.
[0080] Based on other output channels, the YOLOv5-RF model predicts the category probability of each candidate bounding box through the Softmax function, including the following steps:
[0081] After the model generates multiple candidate bounding boxes on the feature map at each scale, each bounding box is associated with a set of feature vectors. This feature vector contains spatial and semantic information about the area covered by the candidate bounding box. These features are processed through convolutional layers and non-linear activation functions to extract features related to the category.
[0082] Each candidate bounding box predicts a category score through a specific output channel. Assuming there are C categories, the category prediction channel of each bounding box will output C score values. These scores are obtained by weighted summation of the model's convolutional layer and feature map information, and they represent the raw scores of each category.
[0083] The category score of each candidate bounding box is normalized through the Softmax function. The Softmax function converts a set of raw scores into probability values so that the sum of these probability values is 1, indicating the relative likelihood of each category: In the formula, s i is the raw score of the candidate bounding box on the i-th category, P(c i ) is the normalized probability. Through Softmax, the model can determine which category the candidate bounding box is most likely to belong to. is the normalization factor (denominator part), which is the exponential sum of all category scores. It ensures that the output of the Softmax function is a probability distribution, that is, the sum of the probabilities of all categories is 1.
[0084] Suppose the model outputs the following raw scores (logits) for a candidate bounding box to predict the probability that it belongs to three categories (A, B, C): A =2.0,s B =1.0,s C = 0.1, we can calculate the probability of each category and calculate the index score for each category:
[0085] Calculate the normalization factor: Compute the probability of each class: Finally, the Softmax function converts the normalized scores of the candidate bounding boxes into probability values, which represent the likelihood that the candidate bounding boxes belong to categories A, B, and C respectively.
[0086] Each candidate bounding box will eventually output C probability values, which represent the likelihood that the target belongs to each category. For example, in a remote sensing image, if the model detects a target area, the category probability of the area may include the probability distribution of categories such as buildings, roads, and tailings ponds. For each candidate bounding box, the category with the highest probability is selected as the predicted category of the bounding box.
[0087] The confidence score is calculated through the Sigmoid function. The confidence score indicates the model's confidence that the currently predicted bounding box contains the target object. The following steps are included:
[0088] During the detection process, the model generates a preliminary score (logit) for each candidate bounding box. This score is obtained by convolution operation of the feature map extracted by the backbone network (Backbone) and the middle network (Neck). The score represents the model's preliminary judgment on whether the bounding box contains the target object.
[0089] Each candidate bounding box outputs a raw score s through a specific output channel. This score is an unprocessed linear combination that reflects the model's initial confidence in whether there is an object in the bounding box.
[0090] The Sigmoid function is used to convert the original score s into a confidence score. The calculation formula is: Among them, σ(s) is the confidence score after processing by the Sigmoid function, which maps the original score to the range of [0, 1], indicating the probability that the candidate bounding box contains the target object. The role of the Sigmoid function is to convert the original score of any real value into a probability value, so as to better reflect the model's confidence in the candidate bounding box.
[0091] A confidence score close to 1 means that the model is highly confident that the current bounding box contains the target object; a confidence score close to 0 means that the model believes that the bounding box is likely to not contain any target. For example, if the confidence score is 0.9, it means that the model is very confident that the bounding box contains the target; if the confidence score is 0.2, the model believes that the bounding box is likely to not contain the target.
[0092] The non-maximum suppression algorithm is applied to the candidate boxes of each scale for screening, and the prediction results of the retained feature maps of different scales are merged to form the final target detection result, including the following steps:
[0093] Apply the non-maximum suppression algorithm to filter the candidate boxes of each scale, obtain the confidence score, category probability and overlap of the candidate boxes of the current scale, and calculate the confidence score, category probability and overlap to obtain the filtering amplitude. The expression is:
[0094] screen=e (α·Cf+β·P) -ln(γ·Df+1), where screen is the screening amplitude, Cf is the confidence score, P is the category probability, Df is the overlap, α, β, and Y are the proportional coefficients of the confidence score, category probability, and overlap, respectively, and α, β, and γ are all greater than 0;
[0095] The larger the screening amplitude, the better the overall performance of the current scale candidate box, and the more conducive to improving the accuracy of subsequent prediction results. Therefore, the screening amplitude is compared with the screening threshold. If the screening amplitude is greater than or equal to the screening threshold, the current scale candidate box is retained. If the screening amplitude is less than the screening threshold, the current scale candidate box is screened out.
[0096] The YOLOv5-RF model is evaluated using the improved RIOU-Focal loss function, which includes the following steps:
[0097] Get the RIOU loss value and Focal-Loss loss value of the YOLOv5-RF model, combine the RIOU loss value and the Focal-Loss loss value to obtain the RIOU-Focal loss function, the function expression is: Total_Loss = λ1×RIOU_Loss+λ2×Focal_Loss, where Total_Loss is the RIOU-Focal loss value, RIOU_Loss is the RIOU loss value, Focal_Loss is the Focal-Loss loss value, λ1 and λ2 are the weight coefficients of the RIOU loss value and the Focal-Loss loss value, respectively, and λ1+λ2=1;
[0098] Get the RIOU-Focal loss value. A smaller RIOU-Focal loss value indicates that the gap between the model's prediction and the true annotation is smaller, that is, the model performs better on the training data. A larger RIOU-Focal loss value indicates that the gap between the model's prediction and the true annotation is larger, that is, the model performs poorly on the training data. Compare the obtained RIOU-Focal loss value with the preset loss threshold. If the RIOU-Focal loss value is less than or equal to the loss threshold, the YOLOv5-RF model is evaluated to be up to standard. If the RIOU-Focal loss value is greater than the loss threshold, the YOLOv5-RF model is evaluated to be unsatisfactory.
[0099] The calculation expression of RIOU loss value is: Where Area_of_Overlap is the overlapping area between the predicted bounding box and the true bounding box, Area_of_Union is the union area between the predicted bounding box and the true bounding box, that is, the total area of the two minus the overlapping area, and Penalty_Term is used to adjust the rotation angle and shape mismatch penalty of the bounding box. This term can be determined according to the aspect ratio or rotation angle of the bounding box to reduce the prediction error caused by rotation or deformation.
[0100] The calculation expression of Focal_Loss loss value is: In the formula, p t is the predicted probability of the correct category, is a balancing factor used to control the weights of positive and negative samples, usually set to a constant, such as 0.25, and ω is an adjustment factor used to reduce the weights of easily classified samples, usually set to 2.0.
[0101] The YOLOv5-RF model uses the back propagation method to calculate the gradient of the RIOU-Focal loss function relative to the YOLOv5-RF model parameters based on the evaluation results, and iterates the parameters of the YOLOv5-RF model multiple times based on the gradient, including the following steps:
[0102] Back propagation calculates the gradient of the loss function with respect to the model parameters, uses the chain rule to calculate the gradient of the RIOU-Focal loss function with respect to the parameters of each network layer (such as convolution kernel, fully connected layer weights, etc.), and calculates the gradient of the RIOU-Focal loss function for bounding box regression prediction.
[0103] The RIOU-Focal loss function is the Focal-Loss loss value. Assuming that the YOLOv5-RF model parameter is θ, the gradient calculation formula is:
[0104] Definition: The gradient of the total loss function relative to the model parameter 0 indicates the sensitivity of the loss function to the model parameters and indicates how to adjust the parameters to reduce the loss;
[0105] Definition: The gradient of RIOU_Loss relative to the model parameter 0, indicating the impact of the RIOU_Loss loss value on each parameter, helps adjust the regression prediction of the bounding box;
[0106] Definition: The gradient of Focal_Loss relative to the model parameter 0, which indicates the impact of the Focal_Loss loss value on each parameter, helps adjust the weight of category prediction;
[0107] λ1 and λ2 are weight coefficients of RIOU loss value and Focal-Loss loss value respectively, and λ1+λ2=1.
[0108] The parameter update formula is: In the formula, θ new is the updated parameter, θ old is the parameter before updating, δ is the learning rate, Indicates the sensitivity of the loss function to the model parameters.
[0109] Forward propagation, loss calculation, gradient calculation, and parameter update are repeated until the model converges or reaches the preset training rounds.
[0110] Example 2: In this example, experiments and index evaluation were performed on the YOLOv5-RF model;
[0111] Experimental environment: The experiment uses the WindoWS10 operating system, the CPU model is Intel(R) Core(TM) i5-7200UCPU@2.50GHz, and the GPU model is (NVIDIA-GeForce-RTX3080, 10240MiB). During model training, multiple debugging is performed. In order to achieve the best tailings pond identification effect, the hyperparameters are set as shown in Table 1:
[0112] Table 1 Hyperparameter settings for YOLOv5-RF model training
[0113]
[0114] The detection accuracy and speed of the model are evaluated by indicators such as precision, recall, and mean average precision (mAP). These three indicators are widely used in the accuracy evaluation of intelligent recognition of image targets. In the tailings pond data set, P (Positive) and N (Negative) are used to represent positive samples and negative samples, T (True) and F (False) represent correct and wrong, and the specific meanings of TP, TN, FP, and FN are shown in Table 2:
[0115] Table 2 Prediction categories and their specific meanings
[0116]
[0117] Precision: Precision refers to the proportion of true positive samples among all the positive samples predicted by the model. Precision measures how many samples predicted as positive by the model are true positive samples, and is an indicator of the prediction accuracy of the model. The formula is as follows:
[0118] Recall: Recall refers to the proportion of all true positive samples that are successfully predicted as positive samples by the model. Recall measures the model's ability to identify positive samples and is an indicator of the model's coverage. The formula is as follows:
[0119] Mean Average Precision (mAP): In object detection tasks, in addition to the single classification metric, mAP is often used as an evaluation metric. mAP is the average of the areas under the precision-recall curve (PR curve) for each category, and is used to measure the overall performance of the object detection model. The higher the mAP value, the better the detection performance of the model. The formula is as follows: Where N represents the number of categories, AP i It represents the average precision of the i-th category. The average precision (AP) of each category can be calculated by discretizing the area under the PR curve.
[0120] Positioning loss (box_loss): Measures the error between the predicted box and the labeled box, usually measured by GIoU (Generalized-Intersection-over-Union). The smaller the value, the more accurate the positioning. Purpose: By minimizing the positioning loss, the model can accurately locate the target.
[0121] Confidence loss (obj_loss): Calculates the network's confidence in the target, usually using the binary cross entropy loss function. The smaller the value, the more accurate the model's ability to judge the target.
[0122] Training Results
[0123] Compared with the YOLOv5 model, the loss function of YOLOv5-RF converges much faster during training and prediction, and the convergence accuracy is significantly improved. This shows that the YOLOv5-RF model is more accurate in predicting the target position. The YOLOv5-RF model converges quickly and the convergence speed tends to be stable after 40 iterations. The model does not overfit, has better regression effect, and has a stronger feature recognition effect on tailings ponds.
[0124] The precision of the YOLOv5 model is 80.8%, and the recall rate is 68.3%. The precision of the YOLOv5-RF model is 82.8%, and the recall rate is 70.4%. The parameters are improved by 2% and 2.1% respectively compared with the original model. The above data show that the improved model has stronger generalization ability, higher robustness, and more stable model performance.
[0125] The study conducted test set verification on the original YOLOv5 and YOLOv5-RF models respectively. When there is a single obvious tailings pond in the image, both YOLOv5-RF and YOLOv5 models can detect it, but the confidence of the YOLOv5-RF model is above 80%, which is significantly improved by about 10%-20% compared with the YOLOv5 model. For tailings ponds that are very similar to the background, the YOLOv5 model may miss detections, but the YOLOv5-RF model can successfully detect them.
[0126] When there are multiple tailings ponds in remote sensing images, the YOLOv5 model often misses detections, but the YOLOv5-RF model can not only accurately identify each tailings pond, but also has a much higher confidence level than the YOLOv5 model. For multiple tailings ponds that are similar to the background, or tailings ponds that are in a reclamation state and extremely difficult to detect, YOLOv5 can hardly detect them, but the YOLOv5-RF model has a lower miss detection rate and can accurately identify tailings ponds in complex backgrounds.
[0127] Through the comparison experiments of the above two test sets, it can be seen that the YOLOv5-RF model can accurately locate the tailings pond and reduce false detection and missed detection. At the same time, the generalization ability of the model is greatly improved, that is, it can perform well for tailings pond data in various scenarios. Through comparative experiments, it can be seen that the YOLOv5-RF model has better robustness and can maintain stable performance in the face of background, occlusion and other situations in remote sensing images.
[0128] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0129] It should be understood that the term "and / or" in this article only describes the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0130] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0131] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0132] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A remote sensing image tailings pond identification algorithm based on an improved loss function, characterized by: The recognition algorithm comprises the following steps: The input layer receives remote sensing images of various resolutions, and the backbone network extracts the basic features of the remote sensing images and outputs multiple scale feature maps. The intermediate network further extracts and fuses features from multiple scale feature maps. The head network uses feature maps of at least three different scales for prediction, and each scale of the feature map generates a bounding box, category probability, and confidence score through a 1×1 convolution; After evaluating the YOLOv5-RF model with the improved RIOU-Focal loss function, the back propagation method is used to calculate the gradient of the RIOU-Focal loss function relative to the YOLOv5-RF model parameters based on the evaluation results. The parameters of the YOLOv5-RF model are iteratively adjusted multiple times based on the gradient until the convergence conditions are met and the target box is retained.
2. The remote sensing image tailings pond identification algorithm based on improved loss function according to claim 1, characterized in that: The backbone network extracts the basic features of the remote sensing image and outputs multiple scale feature maps, including the following steps: Remote sensing images first pass through the initial convolutional layer to extract low-level features, including edges, textures, and shapes; The feature map is divided into two parts through the cross-stage partial network, a convolution operation is performed on one part, and the other part remains unchanged, and finally the two parts of features are merged; The backbone network outputs multi-scale feature maps at different network layers. The feature maps vary in resolution and richness of semantic information, including low-level feature maps, mid-level feature maps, and high-level feature maps. The backbone network finally outputs feature maps of multiple scales, which will serve as input for subsequent object detection tasks.
3. The remote sensing image tailings pond identification algorithm based on improved loss function according to claim 2 is characterized in that: The YOLOv5-RF model is evaluated using the improved RIOU-Focal loss function, which includes the following steps: Get the RIOU loss value and Focal-Loss loss value of the YOLOv5-RF model, combine the RIOU loss value and the Focal-Loss loss value to obtain the RIOU-Focal loss function, the function expression is: Total_Loss = λ1×RIOU_Loss+λ2×Focal_Loss, where Total_Loss is the RIOU-Focal loss value, RIOU_Loss is the RIOU loss value, Focal_Loss is the Focal-Loss loss value, λ1 and λ2 are the weight coefficients of the RIOU loss value and the Focal-Loss loss value, respectively, and λ1+λ2=1; The obtained RIOU-Focal loss value is compared with the preset loss threshold. If the RIOU-Focal loss value is less than or equal to the loss threshold, the YOLOv5-RF model is evaluated to be up to standard. If the RIOU-Focal loss value is greater than the loss threshold, the YOLOv5-RF model is evaluated to be unsatisfactory.
4. The remote sensing image tailings pond identification algorithm based on improved loss function according to claim 3 is characterized in that: The YOLOv5-RF model uses the back propagation method to calculate the gradient of the RIOU-Focal loss function relative to the YOLOv5-RF model parameters based on the evaluation results, and iterates the parameters of the YOLOv5-RF model multiple times based on the gradient, including the following steps: Back propagation calculates the gradient of the loss function relative to the model parameters, and uses the chain rule to calculate the gradient of the RIOU-Focal loss function relative to the parameters of each network layer. The gradient of the RIOU-Focal loss function for bounding box regression prediction is calculated. The RIOU-Focal loss function is the Focal-Loss loss value. Assuming the YOLOv5-RF model parameter is θ, the gradient calculation formula is: In the formula, Indicates the sensitivity of the loss function to the model parameters; Indicates the impact of RIOU_Loss loss value on each parameter; Represents the influence of Focal_Loss loss value on each parameter, λ1 and λ2 are the weight coefficients of RIOU loss value and Focal-Loss loss value respectively, and λ1+λ2=1; Update the parameters by the parameter update formula to obtain θ new , forward propagation, loss calculation, gradient calculation and parameter update are repeated until the model converges or reaches the preset training rounds.
5. The remote sensing image tailings pond identification algorithm based on improved loss function according to claim 4 is characterized in that: The parameter update formula is: In the formula, θ new is the updated parameter, θ old is the parameter before updating, δ is the learning rate, Indicates the sensitivity of the loss function to the model parameters.
6. The remote sensing image tailings pond identification algorithm based on improved loss function according to claim 5 is characterized in that: The head network uses at least three feature maps of different scales for prediction. Each feature map of each scale generates a bounding box, category probability, and confidence score through a 1×1 convolution, including the following steps: The head network receives feature maps of multiple scales generated by the intermediate network. Each feature map corresponds to objects of different sizes, including high resolution, medium resolution, and low resolution. A 1×1 convolution operation is applied to the feature map of each scale, and the depth of the feature map is compressed to the required number of channels through the convolution kernel to generate the corresponding prediction; Generate the position parameters of the candidate bounding box based on any output channel YOLOv5-RF model. The position parameters are used to locate the position and size of the target in the image. Based on other output channels, the YOLOv5-RF model predicts the category probability of each candidate bounding box through the Softmax function; The confidence score is calculated through the Sigmoid function. The confidence score indicates the model's confidence that the currently predicted bounding box contains the target object. The non-maximum suppression algorithm is applied to the candidate boxes of each scale for screening, and the prediction results of the retained feature maps of different scales are merged to form the final target detection result.
7. The remote sensing image tailings pond identification algorithm based on improved loss function according to claim 6 is characterized in that: The non-maximum suppression algorithm is applied to the candidate boxes of each scale for screening, including the following steps: Apply the non-maximum suppression algorithm to screen the candidate boxes of each scale, obtain the confidence score, category probability and overlap of the candidate boxes of the current scale, and comprehensively calculate the confidence score, category probability and overlap to obtain the screening amplitude; The filtering amplitude is compared with the filtering threshold. If the filtering amplitude is greater than or equal to the filtering threshold, the current scale candidate box is retained. If the filtering amplitude is less than the filtering threshold, the current scale candidate box is filtered out.
8. The remote sensing image tailings pond identification algorithm based on improved loss function according to claim 7 is characterized in that: The intermediate network further extracts and fuses features from multiple scale feature maps, including the following steps: Starting from the high-level feature map through the feature pyramid structure, the semantic information of the high-level feature map is propagated downward layer by layer and fused with the low-level feature map; The intermediate network also includes bottom-up path aggregation, which enables low-level feature maps to be back-propagated into high-level feature maps; After multi-level feature fusion, the feature map is further processed through convolutional layers, activation functions, and normalization layers; Finally, the feature map processed by the intermediate network generates multiple scale outputs. The multiple scale output feature maps correspond to objects of different sizes, and each scale feature map is used for the subsequent head network.
Citation Information
Patent Citations
Ship small target detection method based on remote sensing image pixel-by-pixel processing
CN116758411A
Improved YOLOV5 remote sensing target detection method
CN117115620A
Mining area unmanned aerial vehicle image sea-buckthorn identification method and system based on improved Mask R-CNN
CN117351359A
Remote sensing image target detection method based on receptive field characteristics
CN117496244A
Directed target detection method based on focus rotation intersection-to-parallel ratio frame regression loss
CN117765380A