US 12,475,687 B2
Method and apparatus for training classification model and data classification
Kafeng Wang, Beijing (CN); Chengzhong Xu, Macau S.A.R. (CN); Haoyi Xiong, Beijing (CN); Xingjian Li, Beijing (CN); and Dejing Dou, Beijing (CN)
Assigned to BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD., Beijing (CN); and State Key Laboratory of Internet of Things for Smart City (University of Macau), Macau S.A.R. (CN)
Filed by BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD., Beijing (CN); and State Key Laboratory of Internet of Things for Smart City (University of Macau), Macau S.A.R. (CN)
Filed on Aug. 15, 2022, as Appl. No. 17/819,777.
Claims priority of application No. 202110664724.6 (CN), filed on Jun. 16, 2021.
Prior Publication US 2022/0392199 A1, Dec. 8, 2022
Int. Cl. G06N 3/098 (2023.01); G06N 3/0985 (2023.01); G06V 10/764 (2022.01); G06V 10/774 (2022.01); G06V 10/778 (2022.01); G06V 10/82 (2022.01)
CPC G06V 10/774 (2022.01) [G06N 3/0985 (2023.01); G06V 10/764 (2022.01); G06V 10/778 (2022.01); G06V 10/82 (2022.01)] 8 Claims
OG exemplary drawing
 
1. A method for data classification, applied in intelligent traffic scenarios, comprising:
obtaining a sample set and a pre-trained classification model, wherein the pre-trained classification model comprises at least two convolutional layers, each convolutional layer is connected with a classification layer through a full connected layer;
inputting the sample set into the pre-trained classification model to obtain a prediction result output by each classification layer, wherein the prediction result comprises a prediction probability of a category to which each sample belongs;
calculating a probability threshold of each classification layer based on the prediction result output by each classification layer;
setting a prediction stopping condition of the classification model according to the probability threshold of each classification layer;
inputting data to be classified into a classification model, wherein the data to be classified is a image acquired by a sensor;
taking a first convolutional layer as a current convolutional layer, and performing following classification steps of: predicting the data through the current convolutional layer, a current fully connected layer and a current classification layer to obtain a maximum prediction probability; if the maximum prediction probability is greater than a probability threshold of the current classification layer, stopping prediction, and using a class corresponding to the maximum prediction probability as a class of the data; and
otherwise, inputting an output result of the current convolutional layer to a next convolutional layer, and using the next convolutional layer as the current convolutional layer to continue the above classification steps;
wherein calculating a probability threshold of each classification layer based on the prediction result output by each classification layer comprises:
performing determining steps of selecting a target combination from a predetermined data proportion combination set; determining a planning value of each classification layer corresponding to the target combination according to the prediction result output by each classification layer; and calculating a correct rate corresponding to the target combination based on the prediction result output by each classification layer;
repeating the determining steps until traversal of the data proportion combination set is completed, and obtaining the correct rate corresponding to each data proportion combination; and
using the planning value of each classification layer corresponding to the data proportion combination with a maximum correct rate as the probability threshold of each classification layer;
wherein, calculating a correct rate corresponding to the target combination based on the prediction result output by each classification layer comprises:
determining a maximum prediction probability of each sample in each classification layer based on the prediction result output by each classification layer; and
for each classification layer, traversing each sample, and if the maximum prediction probability of the sample in the classification layer is greater than the planning value of the classification layer, accumulating the maximum prediction probability of the sample in the classification layer for the correct rate;
wherein the prediction result comprises a prediction time of each sample; and
wherein the method further comprises:
for each classification layer, calculating a total prediction time of the classification layer based on the prediction time of the samples participating in correct rate accumulation;
calculating a total prediction time of the classification model based on the total prediction time of each classification layer; and
if the total prediction time of the classification model is greater than a predetermined time threshold, filtering out the correct rate corresponding to the target combination.