CN-121982631-A - Electric vehicle identification method, device, equipment and medium
Abstract
The invention relates to the technical field of machine learning and discloses an electric vehicle identification method, device, equipment and medium. And then, distributing the best matched fine-granularity electric vehicle subclass or non-electric vehicle subclass labels for each target frame by calculating the matching degree of each image characteristic and the preset subclass label, splicing to form a unified subclass label system, and re-labeling the images according to the uniform subclass label system to obtain fine-granularity labeling data. The multi-resolution visual feature vector of the data is further extracted and a learnable cue word embedding vector is constructed for each sub-class. Finally, the electric vehicle recognition is completed by fusing the image features, the visual feature vectors and the prompt word embedding vectors of the target image and utilizing the pre-training model, and a recognition result is output. The invention improves the accuracy of the identification of the electric vehicle.
Inventors
- SHAN JINXIAO
- HU FEI
- Duan Weidi
- WU TAO
- YU QING
Assignees
- 招商局金融科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251230
Claims (10)
- 1. An electric vehicle identification method, characterized by comprising: Acquiring a monitoring image set which is marked with a vehicle target frame and a vehicle class label in advance; Dividing the monitoring image set into an electric vehicle image set and other vehicle image sets according to the vehicle category labels, extracting electric vehicle image feature sets of the electric vehicle image set, and extracting non-electric vehicle image feature sets of the other vehicle image sets; Calculating the matching degree of each image in the electric vehicle image set and a preset electric vehicle sub-class label according to the electric vehicle image feature set, calculating the matching degree of each image in the non-electric vehicle image set and a preset non-electric vehicle sub-class label according to the non-electric vehicle image feature set, and determining the sub-class label with the largest matching degree as the electric vehicle sub-class label corresponding to each image in the electric vehicle image set and the non-electric vehicle sub-class label corresponding to each image in the non-electric vehicle image set; The electric vehicle sub-class labels and the non-electric vehicle sub-class labels are spliced, and vehicle target frames in the electric vehicle image set and the non-electric vehicle image set are marked according to the spliced sub-class labels to obtain sub-class marked images; extracting visual feature vectors of the sub-class label images, and constructing prompt word embedding vectors of sub-class labels obtained through photo splicing; And acquiring image features of a target image, and carrying out electric vehicle identification on the target image according to the image features of the target image, the visual feature vector and the prompt word embedding vector to obtain an electric vehicle identification result.
- 2. The electric vehicle identification method of claim 1, wherein the extracting the electric vehicle image feature set of the electric vehicle image set comprises: Cutting a target area of each electric vehicle image according to a vehicle target frame marked by each electric vehicle image in the electric vehicle image set to obtain a target area image set; All images in the target area image set are adjusted to be of a preset uniform size, and pixel value normalization processing is carried out, so that a preprocessed electric vehicle image set is obtained; Extracting the feature vector of each image in the electric vehicle image set by using a preset feature extraction model to obtain an initial feature vector set; and carrying out normalization processing on all feature vectors in the initial feature vector set to obtain an electric vehicle image feature set.
- 3. The method for identifying an electric vehicle according to claim 1, wherein the calculating the matching degree between each image in the electric vehicle image set and a preset electric vehicle sub-class label according to the electric vehicle image feature set comprises: performing dimension reduction processing on the electric vehicle image feature set to obtain a dimension-reduced electric vehicle image feature set; Calculating the Euclidean distance between each feature vector in the dimension-reduced electric vehicle image feature set and the tag vector obtained by converting each electric vehicle sub-class tag, and dividing the features with similarity larger than a preset threshold value into a group to obtain a feature group set; Calculating a center point of each feature group in the feature group set; Calculating cosine distances between all feature vectors in each feature group in the feature group set and vectors corresponding to the center points, and taking the calculated cosine distances as matching scores of each image in the electric vehicle image set and preset sub-class labels; and carrying out normalization processing on the matching scores to obtain the matching degree of each image and the preset sub-class labels.
- 4. The method for identifying an electric vehicle as set forth in claim 1, wherein said extracting the visual feature vector of the sub-class annotation image includes: Carrying out structural extraction on the annotation data of the sub-class annotation images to obtain structural annotation data; extracting target region sub-class images of the sub-class annotation images according to a vehicle target frame contained in the structured annotation data to obtain a target region sub-class image set; Extracting a first resolution size feature set of each image in the target area sub-class image set based on a preset first resolution size parameter; Extracting a second resolution size feature set of each image in the target region sub-class image set based on a preset second resolution size parameter; extracting a third resolution size feature set of each image in the target region sub-class image set based on a preset third resolution size parameter; And carrying out feature fusion on the first resolution size feature set, the second resolution size feature set and the third resolution size feature set to obtain the visual feature vector, wherein the numerical values of the first resolution size, the second resolution size and the third resolution size are different.
- 5. The method for identifying an electric vehicle as defined in claim 1, wherein the constructing the prompt word embedding vector of the sub-class tag obtained by splicing comprises: Constructing a parameter matrix according to the category number of the sub-category labels and a preset vector dimension; initializing parameters in the parameter matrix to obtain an initialized parameter matrix; And searching the corresponding row vector in the initialization parameter matrix according to the label value of each sub-class label to obtain the prompt word embedded vector of each sub-class label.
- 6. The electric vehicle recognition method according to claim 1, wherein the electric vehicle recognition is performed on the target image according to the image features of the target image, the visual feature vector and the prompt word embedding vector to obtain an electric vehicle recognition result, and the method comprises: performing feature fusion on the prompt word embedding vector and the visual feature vector to obtain a fusion vector; updating parameters of the prompt word embedding vector according to the loss fusion vector by using a joint loss function to obtain an updated prompt word embedding vector; The image features and the updated prompt word embedded vectors are subjected to feature alignment and then fused to obtain fusion features; And carrying out electric vehicle target recognition on the target image according to the fusion characteristics by utilizing a pre-trained electric vehicle recognition model to obtain an electric vehicle target recognition result.
- 7. The method for identifying an electric vehicle as defined in claim 1, wherein updating parameters of the prompt word embedding vector according to the loss fusion vector using the joint loss function to obtain an updated prompt word embedding vector comprises: Outputting the sub-class probability distribution and the prediction boundary frame of the sub-class annotation image according to the fusion vector by utilizing a pre-trained electric vehicle recognition model; calculating a subclass loss value according to the subclass probability distribution and the real subclass label of the subclass annotation image by using a cross entropy loss function; Determining a vehicle class label corresponding to the subclass with the highest probability in the subclass probability distribution as a predicted vehicle class label; Respectively calculating and summing cosine similarity between a real vehicle class label vector obtained by converting the real vehicle class label of the subclass labeling image and a predicted vehicle class label vector obtained by converting the predicted vehicle class label and the visual feature vector to obtain a vehicle class loss value; carrying out weighted summation on the subclass loss value and the vehicle class loss value to obtain a joint loss value; calculating gradients of the joint loss values for all the learnable parameters in the prompt word embedding vector; And updating all the learnable parameters in the prompt word embedding vector based on a preset learning rate according to the gradient to obtain the updated prompt word embedding vector.
- 8. An electric vehicle identification device, characterized by comprising: The data processing module is used for acquiring a monitoring image set marked with a vehicle target frame and a vehicle type label in advance, dividing the monitoring image set into an electric vehicle image set and other vehicle image sets according to the vehicle type label, extracting electric vehicle image characteristic sets of the electric vehicle image sets, and extracting non-electric vehicle image characteristic sets of the other vehicle image sets; The subclass division module is used for calculating the matching degree of each image in the electric vehicle image set and a preset electric vehicle subclass label according to the electric vehicle image feature set, calculating the matching degree of each image in the non-electric vehicle image set and a preset non-electric vehicle subclass label according to the non-electric vehicle image feature set, and determining that the subclass label with the largest matching degree is the electric vehicle subclass label corresponding to each image in the electric vehicle image set and the non-electric vehicle subclass label corresponding to each image in the non-electric vehicle image set; the sub-class labeling module is used for splicing the electric vehicle sub-class labels and the non-electric vehicle sub-class labels to obtain sub-class labels, and labeling the electric vehicle image set and the vehicle target frames in the non-electric vehicle image set according to the spliced sub-class labels to obtain sub-class labeling images; The vector updating module is used for extracting the visual feature vector of the sub-class label image and constructing a prompt word embedding vector of the sub-class label obtained by splicing; The target recognition module is used for acquiring the image characteristics of the target image, and carrying out electric vehicle recognition on the target image according to the image characteristics of the target image, the visual characteristic vector and the prompt word embedding vector to obtain an electric vehicle recognition result.
- 9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the electric vehicle identification method according to any one of claims 1 to 7 when executing the computer program.
- 10. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the electric vehicle identification method according to any one of claims 1 to 7.
Description
Electric vehicle identification method, device, equipment and medium Technical Field The present invention relates to the field of machine learning technologies, and in particular, to a method, an apparatus, a device, and a medium for identifying an electric vehicle. Background The electric vehicle entering the elevator has extremely high safety risk, and the electric vehicle entering the elevator monitoring and early warning system (hereinafter referred to as early warning system) based on vision can timely identify the electric vehicle entering the elevator and trigger early warning, so that the possible risk is reduced to the minimum, and the life and property safety of people is ensured. The traditional method collects monitoring images, trains through a large number of data electric vehicle identification models of various elevator scenes by manual marking, and then deploys the data electric vehicle identification models in an early warning system. The training scheme of the electric vehicle identification model has the advantages that firstly, massive data need to be marked to train the model, a large amount of manpower and material resources are consumed, the efficiency is quite low, the iterative optimization period of the model is long, secondly, only the data manually marked as the electric vehicle type is used as a positive example to train the electric vehicle identification model, the target detection effect cannot be expected, and the electric vehicle identification model is mainly characterized in that from the safety risk aspect, the manually marked data are more two-wheel electric vehicles, but in actual life, the electric vehicles are more in form, other forms of electric vehicles with batteries are easy to miss detection (for example, a small amount of special-shaped lithium ion electric vehicles and other vehicle types are provided with a small amount of unusual vehicle types), the electric vehicles with other forms are less in data amount, long tail data are formed in the marked data, the recognition effect of the long tail data is poor during model detection, the missed detection is easy to cause safety risk, and the electric vehicles with risks (lithium batteries) are easy to mix with low-risk electric vehicles with lead-acid batteries used by children, so that the electric vehicles with risks are easy to carry on, and the recognition rate of the electric vehicles is affected. Disclosure of Invention The invention provides an electric vehicle identification method, an electric vehicle identification device, computer equipment and a medium, which are used for solving the problem of low accuracy of the existing electric vehicle identification method in the current market. In a first aspect, an electric vehicle identification method is provided, including: Acquiring a monitoring image set which is marked with a vehicle target frame and a vehicle class label in advance; Dividing the monitoring image set into an electric vehicle image set and other vehicle image sets according to the vehicle category labels, extracting electric vehicle image feature sets of the electric vehicle image set, and extracting non-electric vehicle image feature sets of the other vehicle image sets; Calculating the matching degree of each image in the electric vehicle image set and a preset electric vehicle sub-class label according to the electric vehicle image feature set, calculating the matching degree of each image in the non-electric vehicle image set and a preset non-electric vehicle sub-class label according to the non-electric vehicle image feature set, and determining the sub-class label with the largest matching degree as the electric vehicle sub-class label corresponding to each image in the electric vehicle image set and the non-electric vehicle sub-class label corresponding to each image in the non-electric vehicle image set; Splicing the electric vehicle sub-class labels and the non-electric vehicle sub-class labels to obtain sub-class labels, and marking vehicle target frames in the electric vehicle image set and the non-electric vehicle image set according to the spliced sub-class labels to obtain sub-class marked images; extracting visual feature vectors of the sub-class label images, and constructing prompt word embedding vectors of sub-class labels obtained through photo splicing; And acquiring image features of a target image, and carrying out electric vehicle identification on the target image according to the image features of the target image, the visual feature vector and the prompt word embedding vector to obtain an electric vehicle identification result. In a second aspect, there is provided an electric vehicle recognition apparatus including: The data processing module is used for acquiring a monitoring image set marked with a vehicle target frame and a vehicle type label in advance, dividing the monitoring image set into an electric vehicle image set and other vehicle image sets accord