A negative sample intelligent mixed training target detection method based on positive sample heat map guidance

By introducing positive sample heat map and negative sample intelligent mixed training strategies into the target detection model, the problem of insufficient detection accuracy and generalization ability caused by unbalanced positive and negative samples is solved, and higher detection accuracy and lower misdetection probability are achieved.

CN118941769BActive Publication Date: 2025-04-04SICHUAN SHUJU INTELLIGENT MFG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410955507.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2025-04-04
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

The prior art lacks accuracy and generalization capabilities of the object detection model in dealing with the uneven positive and negative samples, and there is a problem that the probability of false detection of positive samples is high.

Method used

By introducing positive sample heat maps as guidance information and combining intelligent mixed training strategies for negative sample data, the model can better understand the spatial distribution and characteristics of abnormal targets, dynamically adjust the mixing ratio of positive and negative samples, and reduce the probability of false detection of positive samples.

Benefits of technology

It significantly improves the accuracy and generalization ability of object detection, reduces the probability of false detection of positive samples, solves the problem of sample imbalance, and improves the stability and training efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941769B_ABST
    Figure CN118941769B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image technology, and provides a negative sample intelligent mixed training target detection method based on the guidance of positive sample heat map. The core technical problem of the present invention is how to improve the accuracy and generalization ability of the target detection model when dealing with the imbalance of positive and negative samples. The main scheme includes step 1: preparation of positive and negative sample data sets; step 2: heat map generation, converting the abnormal area detected in the positive sample into a heat map, and the generation of the heat map uses a Gaussian blur image processing method to highlight the abnormal area and smooth the edges; step 3: data processing and design of intelligent mixed training strategies, combining the positive sample heat map as guidance information; step 4: result evaluation and optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image technology and provides a negative sample intelligent mixed training target detection method based on positive sample heat map guidance. Background Art

[0002] Existing technical solutions:

[0003] In the field of artificial intelligence and deep learning, a variety of technical solutions have been developed for anomaly detection tasks to improve the detection effect of negative samples. These solutions mainly focus on increasing the number of abnormal samples, optimizing network structure, adjusting loss function weights, and multi-model collaborative comparison. However, although these methods have improved the accuracy of anomaly detection to a certain extent, they still have some limitations and challenges.

[0004] 1. Generate abnormal samples or style transfer: This method increases the diversity of the dataset by generating new abnormal samples or applying style transfer techniques. Although the number of negative samples can be expanded, the generated samples may not fully reflect the abnormal features in the real scene, thus affecting the generalization ability of the model.

[0005] 2. Modify the network structure module: Adding or adjusting specific modules in the network structure can enhance the model's prediction probability for abnormal targets. However, this method usually requires a lot of experiments and debugging to design the network structure, which increases the complexity and cost of development.

[0006] 3. Modify the weights of the loss function for positive and negative samples: Adjusting the weights of positive and negative samples in the loss function can affect the model's attention to positive and negative samples. How to reasonably set the weight ratio is a challenge. Too high a weight may cause the model to pay too much attention to positive samples and ignore some important negative samples.

[0007] 4. Multi-model collaboration and comparison: Using multiple models for collaboration and comparison can improve the accuracy of anomaly detection. This solution requires training and maintaining multiple models at the same time, which increases the complexity of calculation and resource consumption.

[0008] The present invention:

[0009] In view of the limitations and challenges of existing technical solutions, this paper proposes a new method. This method is applicable to the case of fixed inspection points. By introducing positive sample heat maps as additional guidance information and combining the intelligent mixed training strategy of negative sample data, it helps the model better understand the spatial distribution and characteristics of abnormal targets, significantly improving the accuracy and generalization ability of target detection. At the same time, combined with positive sample anomaly detection, it can also effectively reduce the probability of positive sample false detection.

[0010] However, the positive sample heatmap generation method in this proposal also has some challenges and shortcomings:

[0011] 1. The generation of positive sample heat maps requires accurate positioning of abnormal areas in positive samples, which requires that the algorithm design fully considers the common abnormal distribution of the current usage scenario. In addition, it may be difficult to generate accurate heat maps when the data set is complex or the target features are not obvious.

[0012] 2. The process of generating heat maps usually requires human intervention to ensure the accurate location of abnormal areas. This increases the cost of human review and may not be realistic for large-scale data sets.

[0013] 3. The introduction of heat maps may increase the computational complexity and parameter quantity of the model, thus affecting the detection speed and model performance. Therefore, in practical applications, it is necessary to weigh the relationship between accuracy and performance. Summary of the invention

[0014] The core technical problem of the present invention is how to improve the accuracy and generalization ability of the target detection model when dealing with imbalanced positive and negative samples. By introducing the positive sample heat map as guidance information and combining the intelligent mixed training strategy of negative sample data, this solution aims to help the model better understand the spatial distribution and characteristics of abnormal targets, thereby improving the accuracy and generalization ability of target detection. At the same time, the solution also considers reducing the probability of false positive detection and dealing with the challenges and shortcomings in generating positive sample heat maps.

[0015] The present invention adopts the following technical solutions:

[0016] The present invention provides a negative sample intelligent mixed training target detection method based on positive sample heat map guidance, comprising the following steps:

[0017] Step 1: Prepare positive and negative sample datasets.

[0018] Step 2: Heat map generation: the abnormal areas detected in the positive samples are converted into heat maps. The heat map is generated using the Gaussian blur image processing method to highlight the abnormal areas and smooth the edges.

[0019] Step 3: Data processing and design of intelligent mixed training strategy, combined with positive sample heat map as guidance information;

[0020] Step 4: Result evaluation and optimization.

[0021] In the above scheme, step 1 includes the following steps:

[0022] Step 1.1, collect positive sample data set A, including multiple groups of abnormal data obtained by positive sample anomaly detection, the internal data format is the abnormal original image (a1...aN), the normal base image corresponding to the abnormal original image (b1...bN), and the abnormal area bounding box corresponding to the abnormal original image (c1...cN);

[0023] Step 1.2, collect negative sample data set B, mainly including multiple groups of abnormal data obtained by negative sample anomaly detection, the internal data format is the abnormal original image (m1...mN) and the normal base image corresponding to the abnormal original image (n1...nN), and the abnormal area boundary box corresponding to the abnormal original image (g1...gN);

[0024] Step 1.3: Clean the positive sample dataset A and the negative sample dataset B to ensure that they can fully reflect the characteristics and distribution of the target anomalies.

[0025] In the above scheme, step 2 includes the following steps:

[0026] Step 2.1: Process the bounding boxes of the abnormal regions in the positive sample dataset A and the negative sample dataset B, and record the center position of the abnormal region as (c x , c y ), and determine its size;

[0027] Step 2.2, define Gaussian kernel: Gaussian kernel is a two-dimensional function used to assign weights to abnormal areas in the heat map. Given a standard deviation σ, the Gaussian kernel function G(x, y) is as follows:

[0028]

[0029] Where (x, y) is the coordinate on the image, (c x , c y ) is the center of the abnormal area, σ is the standard deviation, which determines the degree of blur;

[0030] Step 2.3, construct a heat map: For each pixel position (x, y) in the image, traverse the bounding boxes of all abnormal regions. If the pixel position is within the bounding box of an abnormal region, calculate the pixel position relative to the center of the abnormal region (c x , c y )’s Gaussian kernel function value G(x, y);

[0031] If the pixel location is within the bounding boxes of multiple abnormal regions, one of the following two processing methods is used:

[0032] Method 1: Select the maximum value: take the maximum value of all relevant Gaussian kernel function values ​​as the value of the pixel on the heat map;

[0033] Method 2: Accumulation or averaging: All relevant Gaussian kernel function values ​​are accumulated or averaged to reflect the proximity of the pixel position to multiple abnormal areas;

[0034] If the pixel location does not lie within the bounding box of any anomaly region, its value on the heatmap is set to 0 or a preset value.

[0035] In the above scheme, step 3 includes the following steps:

[0036] Step 3.1: Stack the abnormal original images, normal base images, and heat maps in the positive sample dataset A and the negative sample dataset B, ensuring that the heat map is at the top layer, and obtain the training dataset C;

[0037] Step 3.2: Analyze the heat map of the positive sample and divide the heat map into different difficulty levels according to its brightness and area size;

[0038] Step 3.3: Set the mixed training strategy and dynamically adjust the mixing ratio of positive and negative samples according to the performance of the current model.

[0039] Step 3.3.1. Analyze the performance of the model on the validation set, including accuracy and recall.

[0040] Step 3.3.2: Identify high-difficulty positive samples based on model performance. Difficult positive samples refer to samples with high brightness and large area in the heat map.

[0041] Step 3.3.3, increase the frequency of high-difficulty positive samples in the training set;

[0042] Step 3.3.4: Maintain the sampling rate of medium-difficulty and low-difficulty positive samples and negative samples to maintain the generalization ability of the model.

[0043] In the above scheme, step 4 includes the following steps:

[0044] Step 4.1: Evaluate the model performance using evaluation indicators;

[0045] Step 4.2: Adjust model parameters and loss function according to the evaluation results;

[0046] Step 4.3: If the model performance does not meet the expected requirements, return to step 3, re-process the data and design the mixed training strategy, and then evaluate and optimize again.

[0047] Because the present invention adopts the above technical means, it has the following beneficial effects:

[0048] 1. Positive sample heat map guidance: By using the abnormal area detected in the positive sample to generate a heat map and using it as guidance information for model training, this method can make the model pay more attention to the characteristics of the abnormal area and improve the accuracy of detection. Compared with the existing technology, this method can more effectively utilize the positive sample information and guide the model to focus on key features, thereby improving the accuracy and efficiency of detection.

[0049] 2. Negative sample intelligent mixed training strategy: In view of the diversity and complexity of negative samples, an intelligent mixed training strategy is proposed. By dynamically adjusting the weights and combinations of negative samples, positive sample anomalies and negative sample anomalies are combined to make the model more robust and robust during the training process. Compared with traditional negative sample processing methods, this strategy can more effectively balance the impact of positive and negative samples and improve the generalization ability and robustness of the model.

[0050] 3. Data stacking and multi-channel input: The original image, positive sample, and heat map are stacked to form multi-channel input data to provide the model with richer information. This multi-channel input method helps the model understand the image content more comprehensively and improves the detection precision and accuracy of the model. Compared with single-channel input, multi-channel input can provide more comprehensive contextual information and enhance the model's ability to understand complex scenes.

[0051] 4. Solve the sample imbalance problem: Through intelligent mixed training strategies and optimized data utilization methods, the common positive and negative sample imbalance problem in target detection tasks is effectively alleviated. This enables the model to learn positive and negative sample features more evenly during training, improving the stability and accuracy of the model. Compared with traditional methods, this strategy can more effectively utilize limited negative sample data and improve the generalization ability of the model.

[0052] 5. Reduce training difficulty and improve convergence speed: Through the intelligent mixed training strategy, the model can converge to the optimal solution faster during the training process, reducing the training difficulty and computing resource requirements. This is of great significance for deploying and training models in practical applications, which can reduce deployment costs and improve training efficiency. Compared with other training strategies, the method of this proposal can improve the efficiency and convenience of training while ensuring model performance.

[0053] In summary, the present invention improves the accuracy and generalization ability of target detection through positive sample heat map guidance and negative sample intelligent mixed training strategy, solves the sample imbalance problem, reduces the training difficulty, and improves the stability and training efficiency of the model. These technical effects have obvious advantages over existing technical solutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 It is a simplified flow chart of the present invention. DETAILED DESCRIPTION

[0055] The following is a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, modifications or equivalent substitutions made to the present invention should all be included in the scope of the claims of the present invention.

[0056] In addition, in order to better illustrate the present invention, numerous specific details are given in the following specific embodiments. It will be understood by those skilled in the art that the present invention can also be implemented without these specific details.

[0057] A negative sample intelligent mixed training target detection method based on positive sample heat map guidance includes the following steps:

[0058] Step 1: Prepare positive and negative sample datasets.

[0059] Step 2: Heat map generation, converting the abnormal areas detected in the positive samples into heat maps. The heat map generation can use Gaussian blur or other image processing methods to highlight the abnormal areas and smooth the edges.

[0060] Step 3: Data processing and design of intelligent mixed training strategy, combined with positive sample heat map as guidance information.

[0061] Step 4: Result evaluation and optimization.

[0062] The above step 1 includes:

[0063] 1.1: Collect positive sample data set A, which mainly includes multiple sets of abnormal data obtained by positive sample anomaly detection (such as object disappearance, bird nest construction, ground oil leakage, handle state correctly closed, etc.). The internal data format is the abnormal original image (a1...aN), the corresponding normal base image (b1...bN), and the corresponding abnormal area bounding box (BoundingBox) (c1...cN);

[0064] 1.2: Collect negative sample data set B, which mainly includes multiple groups of abnormal data obtained by negative sample anomaly detection (such as equipment rust, respirator discoloration, capacitor bulging, oil level relay abnormality, etc.). The internal data format is the abnormal original image (m1...mN) and the corresponding normal base image (n1....nN), and the corresponding abnormal area bounding box (BoundingBox) (g1....gN). If there is no normal base image for negative sample anomaly detection, you can generate a normal base image or find a similar normal base image according to the method of feature style transfer of your own data set, which will not be elaborated here;

[0065] 1.3: Clean datasets A and B to ensure that they can fully reflect the characteristics and distribution of the target anomalies.

[0066] The above step 2 includes:

[0067] 2.1: Process the bounding boxes of the abnormal regions A and B. We record the center position of the abnormal region as (c x , c y ) and determine its size (such as width w and height h).

[0068] 2.2: Definition of Gaussian kernel: Gaussian kernel is a two-dimensional function used to assign weights to abnormal regions in the heat map. Given a standard deviation σ, the Gaussian kernel function G(x, y) is as follows:

[0069]

[0070] Where (x, y) is the coordinate on the image, (c x , c y ) is the center of the abnormal area, and σ is the standard deviation, which determines the degree of blur.

[0071] 2.3: Construct heat map: For each pixel position (x, y) in the image, traverse the bounding boxes of all abnormal regions. If the pixel position is within the bounding box of an abnormal region, calculate the pixel position relative to the center of the abnormal region (c x , c y )’s Gaussian kernel function value G(x, y).

[0072] If the pixel location is within the bounding boxes of multiple abnormal regions, there are usually two ways to handle it:

[0073] 1): Select the maximum value: Take the maximum value of all relevant Gaussian kernel function values ​​as the value of the pixel on the heat map.

[0074] 2): Accumulation or averaging: All relevant Gaussian kernel function values ​​are accumulated or averaged to reflect the proximity of the pixel position to multiple abnormal areas.

[0075] If the pixel location does not lie within the bounding box of any anomaly region, its value on the heatmap is set to 0 or some lower value.

[0076] The above step 3 includes:

[0077] 3.1: Stack the original image, normal base map and heat map in data sets A and B, making sure the heat map is at the top layer, and obtain training data set C.

[0078] 3.2: Analyze the heat map of the positive sample and divide it into different difficulty levels (such as easy, medium, and difficult) according to its brightness, area size and other characteristics. The difficulty level division can be achieved by setting thresholds or using clustering algorithms. The specific solution is selected according to the characteristics of your own data.

[0079] 3.3: Set the mixed training strategy and dynamically adjust the mixed ratio of positive and negative samples according to the performance of the current model (such as accuracy and recall on the validation set). For high-difficulty positive samples (i.e. samples with high brightness and large area in the heat map), increase their frequency of occurrence in the training set to strengthen the model's learning of such samples. At the same time, in order to maintain the generalization ability of the model, a certain sampling rate should be maintained for medium-difficulty and low-difficulty positive samples, as well as negative samples.

[0080] Step 4 above includes:

[0081] 4.1: Evaluate the model performance using evaluation metrics such as mAP, F1 score, etc.

[0082] 4.2: Adjust model parameters and loss function according to evaluation results

[0083] 4.3: If the model performance does not meet the expected requirements, return to step 3, re-process the data and design the mixed training strategy, and then evaluate and optimize again.

Claims

1. A negative sample intelligent mixed training target detection method based on positive sample heat map guidance, characterized in that: The following steps are involved: Step 1: Prepare positive and negative sample data sets; Step 2: Heat map generation: the abnormal areas detected in the positive samples are converted into heat maps. The heat map is generated using the Gaussian blur image processing method to highlight the abnormal areas and smooth the edges. Step 3: Data processing and design of intelligent mixed training strategy, combined with positive sample heat map as guidance information; Step 4: Result evaluation and optimization; Step 1 includes the following steps: Step 1.1, collect the positive sample data set A, including multiple sets of abnormal data obtained by positive sample anomaly detection, the internal data format is the abnormal original image (a1...aN), the normal base image corresponding to the abnormal original image (b1...bN), and the abnormal area bounding box corresponding to the abnormal original image (c1...cN); Step 1.2, collect negative sample data set B, mainly including multiple groups of abnormal data obtained by negative sample anomaly detection, the internal data format is the abnormal original image (m1...mN) and the normal base image corresponding to the abnormal original image (n1...nN), and the abnormal area bounding box corresponding to the abnormal original image (g1...gN); Step 1.3: Clean the positive sample dataset A and the negative sample dataset B to ensure that they can fully reflect the characteristics and distribution of the target anomalies; Step 2 includes the following steps: Step 2.1: Process the bounding boxes of the abnormal regions in the positive sample dataset A and the negative sample dataset B, and record the center position of the abnormal region as , and determine its size; Step 2.2, define Gaussian kernel: Gaussian kernel is a two-dimensional function used to assign weights to abnormal areas in the heat map, given a standard deviation , Gaussian kernel function as follows: in are the coordinates on the image, It is the center of the abnormal area. is the standard deviation, which determines the degree of blur; Step 2.3: Build a heat map: For each pixel position in the image , traverse the bounding boxes of all abnormal regions, if the pixel position is within the bounding box of a certain abnormal region, calculate the Gaussian kernel function value of the pixel position relative to the center of the abnormal region ; If the pixel location is within the bounding boxes of multiple abnormal regions, one of the following two processing methods is used: Method 1: Select the maximum value: take the maximum value of all relevant Gaussian kernel function values ​​as the value of the pixel on the heat map; Method 2: Accumulation or averaging: All relevant Gaussian kernel function values ​​are accumulated or averaged to reflect the proximity of the pixel position to multiple abnormal areas; If the pixel position is not within the bounding box of any abnormal region, its value on the heat map is set to 0 or a preset value; Step 3 includes the following steps: Step 3.1: Stack the abnormal original images, normal base images, and heat maps in the positive sample dataset A and the negative sample dataset B, ensuring that the heat map is at the top layer, and obtain the training dataset C; Step 3.2: Analyze the heat map of the positive sample and divide the heat map into different difficulty levels according to its brightness and area size; Step 3.3: Set the mixed training strategy and dynamically adjust the mixed ratio of positive and negative samples according to the performance of the current model; Step 3.3.

1. Analyze the performance of the model on the validation set, including accuracy and recall. Step 3.3.2: Identify high-difficulty positive samples based on model performance. Difficult positive samples refer to samples with high brightness and large area in the heat map. Step 3.3.3, increase the frequency of high-difficulty positive samples in the training set; Step 3.3.4: Maintain the sampling rate of medium-difficulty and low-difficulty positive samples and negative samples to maintain the generalization ability of the model; Step 4 includes the following steps: Step 4.1: Evaluate the model performance using evaluation indicators; Step 4.2: Adjust model parameters and loss function according to the evaluation results; Step 4.3: If the model performance does not meet the expected requirements, return to step 3, re-process the data and design the mixed training strategy, and then evaluate and optimize again.

Citation Information

Patent Citations

  • Anomaly detection method and apparatus, electronic device, computer readable storage medium, computer program, and computer program product

    WO2023015843A1

  • Defect detection method and apparatus, device, and storage medium

    WO2024021461A1