Target detection pre-labeling method for classification processing
Through classification processing and selection of appropriate recognition algorithms, the model stuck problem caused by image characteristics in the prior art is solved, the efficiency and quality of target detection pre-labeling are improved, and the use of users is reduced cost.
Patent Information
- Application Number
- CN202411037460.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing target detection pre-labeling methods are prone to abnormal model stuck due to excessive differences in image characteristics, which affects the labeling efficiency and quality.
The classification processing method is adopted to classify the geometric figures to be annotated through the classification algorithm, and select the appropriate recognition algorithm for feature extraction based on the speed, completion and convenience, and automatically label it with Fast-RCNN, SSD and YOLO algorithms to avoid images The stuck problem caused by uneven size, and the labeling efficiency and quality are improved through model training and enhanced processing.
It effectively solves the problem of model stuck due to differences in image characteristics, improves labeling efficiency and quality, and reduces user usage costs.
Smart Images

Figure CN118968166A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and geometric processing, and in particular to a target detection pre-labeling method for classification processing. Background Art
[0002] Automatic annotation of geometric images is a process of analyzing the low-level visual features of digital images using computer methods such as artificial intelligence or pattern recognition, thereby labeling the images with specific semantic labels. There are roughly two existing target detection application solutions. One is that the developer provides a complete hardware and software solution, and the other is that the user provides training data and the training data is handed over to the deep learning platform for training. After searching, it is found that the target detection pre-annotation method in the prior art is typically such as the target detection method and device based on pre-annotation in publication number CN117372813A, the method includes: obtaining a first data set; annotating the first data set to obtain a second data set; inputting the second data set into the first target detection model for training according to preset configuration parameters to obtain a second target detection model; inputting the third data set into the second target detection model for detection to obtain a fourth data set; filtering the detection results in the fourth data set by confidence threshold and non-maximum suppression filtering to obtain a fifth data set; adjusting the detection results in the fifth data set to obtain a sixth data set; inputting the second data set and the sixth data set as training data sets into the second target detection model for training to obtain a third target detection model. The object detection method and device based on pre-labeling provided by the present invention have the main characteristics of greatly reducing the labeling workload of the user through pre-labeling and reducing the user's usage cost.
[0003] In summary, the existing target detection pre-labeling methods are prone to model abnormality and jamming during labeling due to large differences in image characteristics. To address the above problems, existing equipment needs to be improved. Summary of the invention
[0004] The purpose of the present invention is to provide a target detection pre-labeling method for classification processing to solve the problem that the existing target detection pre-labeling method proposed in the above background technology is prone to model abnormality and jamming due to excessive differences in image characteristics during labeling.
[0005] To achieve the above object, the present invention provides the following technical solution: a target detection pre-labeling method for classification processing, comprising:
[0006] S1: Classification and processing stage:
[0007] Use a classification algorithm to classify the acquired geometric figures to be annotated according to their characteristics;
[0008] S2: Graphics recognition stage:
[0009] According to the classified graphics, the corresponding recognition algorithm is automatically selected to identify its content and extract its features. At the same time, the recognition algorithm is selected based on speed, completeness and convenience;
[0010] S3: Graphics comparison stage:
[0011] Compare the identified features of the classified graphics with the training labeled samples in the sample set to determine its labeling type;
[0012] S4: Target annotation stage:
[0013] After the annotation type is determined, the geometric figures are automatically annotated, and the annotated figures are filtered and transmitted to the sample set as samples for subsequent comparison;
[0014] S5: Model training phase:
[0015] The model trains, corrects and enhances the samples in the sample set, and there are 11 ways of enhancement processing.
[0016] Preferably, the classification algorithm formula of the S1 stage is:
[0017]
[0018] Where xi is the sample, xj is the graphic data to be classified, and d(xi,xj) is the classification result.
[0019] Preferably, the principle of the S1 stage classification algorithm is to first extract the eigenvalues of the data, then form an n-dimensional real vector space based on the eigenvalues, and then use the above formula to calculate the spatial distance between the vectors, that is, to judge their size. It is manifested in the existence of a sample data set, also called a training sample set, and each data in the sample set has a label, that is, we know the correspondence between each data in the sample set and its corresponding classification. After inputting unlabeled data, each feature of this unlabeled data is compared with the feature corresponding to the data in the sample set, and then the classification label of the data with the closest feature in the sample is extracted.
[0020] Preferably, the recognition algorithm corresponding to the completeness of the S2 stage is Fast-RCNN, which draws on the idea of SPP, proposes a simplified version of the ROI pooling layer, and adds a candidate box mapping function, so that the network can back propagate, solving the overall network training problem of SPP. Secondly, SoftmaxLoss replaces SVM, proving that softmax has better effects than sVM, SmoothL1Loss replaces Bouding box regression, merges classification and border regression, and further integrates deep networks through multi-task Loss layers to unify the training process and improve algorithm accuracy.
[0021] Preferably, the pooling layer in the S2 stage conducts the mapping formula of the traditional max pooling based on yj=max(xi):
[0022] Where is the discriminant function. When it is 1, it means that the maximum value is selected, and 0 means it is discarded. The error does not need to be returned, that is, the corresponding weight does not need to be updated.
[0023] Preferably, the expanded formula for the input xi in the S2 stage is expressed as:
[0024]
[0025] (irj) indicates whether x is selected as the maximum value at the jth node in the rth box (corresponding to y0,s and y1,0 in the above figure). The xi parameter is affected by the sum of the subsequent gradient errors during forward conduction.
[0026] Preferably, the recognition algorithm corresponding to the speed in the S2 stage is SSD, and the SSD algorithm draws on the Anchor mechanism of Fast-RCNN.
[0027] Preferably, the recognition algorithm corresponding to the convenience of the S2 stage is YOLO. The algorithm flow of YOLO is to divide the image into fixed grids, taking 7*7 as an example. If the center of a sample object falls on the corresponding grid, the grid is responsible for the regression of the object position; each grid prediction contains the object position and confidence information, which are encoded as a vector; the network output layer is the corresponding result of each Grid, thereby realizing end-to-end training.
[0028] Preferably, the sample set in the S4 stage is connected to the Internet, that is, the labeled samples in the sample set are updated and supplemented regularly, and the samples are put into use after being trained by the model.
[0029] Preferably, the 11 enhancement methods in the S5 stage are random change of brightness, random change of contrast, random change of chroma, random change of saturation, random change of color channel, random horizontal flipping, random cropping, random scaling, random stretching, random rotation and random Gaussian blur.
[0030] Compared with the prior art, the present invention has the following beneficial effects: the target detection pre-labeling method for classification processing,
[0031] The present invention can effectively solve the problem of the existing target detection pre-labeling method being prone to labeling model overload and jamming due to excessive differences in image characteristics during labeling through the coordinated use of the S1 and S2 stages; first, the S1 stage classifies the size of the geometric figures to be labeled through a classification algorithm, and then the S2 stage uses a suitable algorithm to extract features from the classified geometric figures, that is, the Fast-RCNN algorithm with good completeness and effect is used to extract features from large-sized geometric figures, the YOLO algorithm with high convenience is used to extract features from medium-sized geometric figures, and the SSD algorithm with high speed is used to extract features from small-sized and simple geometric figures, so as to avoid jamming before the subsequent automatic labeling process due to uneven or excessive image size, thereby improving the labeling efficiency and quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the working process of the present invention;
[0033] Figure 2 This is a schematic diagram of the S2 stage recognition algorithm of the present invention;
[0034] Figure 3 This is a schematic diagram of the Fast-RCNN algorithm flow of the present invention;
[0035] Figure 4 This is a schematic diagram of the SSD structure of the present invention;
[0036] Figure 5 It is a schematic diagram of the YOLO algorithm flow of the present invention;
[0037] Figure 6 Schematic diagram of the YOLO structure of the present invention. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0039] See also Figure 1-6 The present invention provides a technical solution: a target detection pre-labeling method for classification processing, comprising:
[0040] S1: Classification and processing stage:
[0041] Use a classification algorithm to classify the acquired geometric figures to be annotated according to their characteristics;
[0042] The classification algorithm formula of the S1 stage is:
[0043]
[0044] Where xi is the sample, xj is the graphic data to be classified, and d(xi,xj) is the classification result.
[0045] The principle of the S1 stage classification algorithm is to first extract the eigenvalues of the data, then form an n-dimensional real vector space based on the eigenvalues, and then use the above formula to calculate the spatial distance between the vectors, that is, to judge their size. It is manifested in the existence of a sample data set, also called a training sample set, and each data in the sample set has a label, that is, we know the correspondence between each data in the sample set and its corresponding classification. After inputting the unlabeled data, each feature of this unlabeled data is compared with the feature corresponding to the data in the sample set, and then the classification label of the data with the closest feature in the sample is extracted.
[0046] S2: Graphics recognition stage:
[0047] According to the classified graphics, the corresponding recognition algorithm is automatically selected to identify its content and extract its features. At the same time, the recognition algorithm is selected based on speed, completeness and convenience;
[0048] The recognition algorithm corresponding to the completeness of the S2 stage is Fast-RCNN, which draws on the idea of SPP and proposes a simplified version of the ROI pooling layer. At the same time, it adds a candidate box mapping function, which enables the network to backpropagate and solves the overall network training problem of SPP. Secondly, SoftmaxLoss replaces SVM, proving that softmax is better than sVM. SmoothL1Loss replaces Bouding box regression, merges classification and bounding box regression, and further integrates deep networks through multi-task Loss layers to unify the training process and improve algorithm accuracy.
[0049] The S2 stage pooling layer conduction is based on the traditional max pooling mapping formula yj=max(xi):
[0050]
[0051] Where is the discriminant function. When it is 1, it means that the maximum value is selected, and 0 means it is discarded. The error does not need to be returned, that is, the corresponding weight does not need to be updated.
[0052] The expanded formula for input xi in stage S2 is expressed as:
[0053]
[0054] (irj) indicates whether x is selected as the maximum value in the jth node of the rth box (corresponding to y0,s and y1,0 in the above figure). The xi parameter is affected by the sum of the subsequent gradient errors during forward conduction, as shown in the attached figure. Figure 3 shown.
[0055] The multi-task Loss layer is the second core idea, as shown in the attached Figure 3 As shown in the figure, cls_score is used to judge the classification, bbox_reg calculates the bounding box regression, and label is the training sample label.
[0056] Where Lcls is the classification error:
[0057] Lcls=-log pl
[0058] px is the corresponding Softmax classification probability, pi is the probability corresponding to the label (the probability of correct classification), when pi = 1, the calculated result Loss is 0, the smaller it is, the larger the Loss value (0.01 corresponds to Loss of 2).
[0059] Lreg is the bounding box regression error:
[0060]
[0061] That is, in the case of correct classification, the error (Smooth L1) between the regression box and the Label box corresponds to the four parameters describing the border (up, down, left, right, or translation and scaling), g corresponds to the difference of a single parameter, and when x|>1, it is transformed into a linear to reduce outlier noise:
[0062]
[0063] Ltotal is the weighted objective function (background does not consider regression Loss):
[0064]
[0065] Faster-RCNN is a further improvement of Fast-RCNN. It mainly merges the candidate box extraction into the deep network by adding an additional RPN branch network. The characteristic of the RPN network is that it realizes the extraction of candidate boxes by sliding windows. Each sliding window position generates 9 candidate windows (of different scales, widths and heights), and extracts the features of the corresponding 9 candidate windows (anchors) for target classification and bounding box regression. Similar to FastRCNN, by adding an additional RPN branch network, the candidate box extraction is merged into the deep network. This is the milestone contribution of Faster-RCNN. Target classification only needs to distinguish whether the features in the candidate box are foreground or background; bounding box regression determines a more accurate target position. During the training process, the candidate boxes involved are selected based on the following criteria: first, anchors that cross the boundary are discarded; second, anchors with an overlap area greater than 0.7 with the sample are marked as foreground, and those with an overlap area less than 0.3 are marked as background; for each position, each candidate box is judged through two fully connected layers (target classification + bounding box regression), and discarded based on the probability value (only about 300 anchors are retained). No candidate windows are explicitly extracted, and the judgment and correction are completed entirely by the network itself.
[0066] From the perspective of model training, near real-time performance is achieved by using shared features for alternating training. The alternating training method is described as:
[0067] First, the weight w is initialized according to the existing network and RPN is trained. Secondly, RPN is used to extract candidate regions on the training set, and FastRCNN is trained with the candidate regions to update the weight w. Finally, steps 1 and 2 are repeated until convergence. Faster achieves end-to-end detection and almost achieves the best effect.
[0068] The recognition algorithm corresponding to the speed in the S2 stage is SSD, which draws on the Anchor mechanism of Fast-RCNN.
[0069] The recognition algorithm corresponding to the convenience of the S2 stage is YOLO. The algorithm flow of YOLO is to divide the image into fixed grids, taking 7*7 as an example. If the center of a sample object falls on the corresponding grid, the grid is responsible for the regression of the object position; each grid prediction contains the object position and confidence information, which are encoded as a vector; the network output layer is the corresponding result of each Grid, thereby realizing end-to-end training.
[0070] S3: Graphics comparison stage:
[0071] Compare the identified features of the classified graphics with the training labeled samples in the sample set to determine its labeling type;
[0072] S4: Target annotation stage:
[0073] After the annotation type is determined, the geometric figures are automatically annotated, and the annotated figures are filtered and transmitted to the sample set as samples for subsequent comparison;
[0074] The sample set in the S4 stage is connected to the Internet, which means that the labeled samples in the sample set are updated and supplemented regularly, and the samples are put into use after the model is trained.
[0075] S5: Model training phase:
[0076] The model trains, corrects and enhances the samples in the sample set, and there are 11 ways of enhancement processing.
[0077] The 11 enhancement methods in the S5 stage are random change of brightness, random change of contrast, random change of chroma, random change of saturation, random change of color channel, random horizontal flip, random cropping, random scaling, random stretching, random rotation and random Gaussian blur. That is, the amount of training set data is increased to 2048 times of the original data, so that limited data can produce the value equivalent to more data.
[0078] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A target detection pre-labeling method for classification processing, characterized in that: include: S1: Classification and processing stage: Use a classification algorithm to classify the acquired geometric figures to be annotated according to their characteristics; S2: Graphics recognition stage: According to the classified graphics, the corresponding recognition algorithm is automatically selected to identify its content and extract its features. At the same time, the recognition algorithm is selected based on speed, completeness and convenience; S3: Graphics comparison stage: Compare the identified features of the classified graphics with the samples in the training and annotation in the sample set to determine its annotation type; S4: Target annotation stage: After the annotation type is determined, the geometric figures are automatically annotated, and the annotated figures are filtered and transmitted to the sample set as samples for subsequent comparison; S5: Model training phase: The model trains, corrects and enhances the samples in the sample set, and there are 11 ways of enhancement processing.
2. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The algorithm formula for classification in the S1 stage is: Where xi is the sample, xj is the graphic data to be classified, and d(xi,xj) is the classification result.
3. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The principle of the S1 stage classification algorithm is to first extract the eigenvalues of the data, then form an n-dimensional real vector space based on the eigenvalues, and then use the above formula to calculate the spatial distance between the vectors, that is, to judge their size. It is manifested in the existence of a sample data set, also called a training sample set, and each data in the sample set has a label, that is, we know the correspondence between each data in the sample set and its corresponding classification. After inputting the unlabeled data, each feature of the unlabeled data is compared with the feature corresponding to the data in the sample set, and then the classification label of the data with the closest feature in the sample is extracted.
4. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The recognition algorithm corresponding to the completeness of the S2 stage is Fast-RCNN, which draws on the idea of SPP and proposes a simplified version of the ROI pooling layer. At the same time, it adds a candidate box mapping function, which enables the network to backpropagate and solves the overall network training problem of SPP. Secondly, SoftmaxLoss replaces SVM, proving that softmax has better effects than sVM. SmoothL1Loss replaces Bouding box regression, merges classification and bounding box regression, and further integrates deep networks through multi-task Loss layers to unify the training process and improve the accuracy of the algorithm.
5. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The S2 stage pooling layer conducts the mapping formula of the traditional max pooling based on yj=max(xi): Where is the discriminant function. When it is 1, it means that the maximum value is selected, and 0 means it is discarded. The error does not need to be returned, that is, the corresponding weight does not need to be updated.
6. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The expanded formula for the input xi in the S2 stage is expressed as: (irj) indicates whether x is selected as the maximum value at the jth node in the rth box (corresponding to y0,s and y1,0 in the above figure). The xi parameter is affected by the sum of the subsequent gradient errors during forward conduction.
7. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The recognition algorithm corresponding to the speed in the S2 stage is SSD, and the SSD algorithm draws on the Anchor mechanism of Fast-RCNN.
8. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The recognition algorithm corresponding to the convenience of the S2 stage is YOLO. The algorithm flow of YOLO is to divide the image into fixed grids, taking 7*7 as an example. If the center of a sample object falls on the corresponding grid, the grid is responsible for the regression of the object position; each grid prediction contains the object position and confidence information, which are encoded as a vector; the network output layer is the corresponding result of each Grid, thereby realizing end-to-end training.
9. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The sample set in the S4 stage is connected to the Internet, that is, the labeled samples in the sample set are updated and supplemented regularly, and the samples are put into use after the model is trained.
10. The target detection pre-labeling method for classification processing according to claim 1, characterized in that: The 11 enhancement methods in the S5 stage are random brightness change, random contrast change, random chroma change, random saturation change, random color channel change, random horizontal flip, random cropping, random scaling, random stretching, random rotation and random Gaussian blur.
Citation Information
Patent Citations
Convolutional neural network-based ship image recognition method and system
CN113850166A
Target classification method of millimeter wave radar
CN114398921A
