Vehicle identification method and related device, electronic device and storage medium
Through the vehicle identification method that integrates details and perspective features, the problem of reduced vehicle identification accuracy in the prior art is solved, and higher recognition accuracy and stability are achieved.
Patent Information
- Application Number
- CN202210209796.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-03-04
AI Technical Summary
When existing vehicle identification technology faces fake license plates, duplicate license plates, and defrauding license plates, its accuracy is reduced, making it difficult to effectively identify vehicles.
By acquiring the vehicle feature library, integrating detailed features and perspective features, more accurate vehicle features are extracted, and vehicle information is determined based on similarity calculations to improve identification accuracy.
It improves the accuracy of vehicle identification, enhances the significance of vehicle characteristics, reduces dependence on license plate information, and adapts to changes in different perspectives and detailed characteristics.
Smart Images

Figure CN114782784B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle search technology, and in particular to a vehicle identification method and related devices, electronic equipment and storage media. Background Art
[0002] Vehicle identification has extremely important application value in many scenarios such as violation judgment and danger warning. For example, in the violation judgment scenario, by identifying the illegal vehicle, it is helpful for relevant personnel to quickly retrieve the illegal vehicle information; or in the danger warning scenario, by searching for vehicles across cameras, it is helpful for relevant personnel to quickly grasp the location information of dangerous vehicles, and so on.
[0003] At present, license plate recognition is generally used for vehicle identification. Taking the actual application scenario of traffic violation judgment as an example, relevant personnel need to identify the license plate information across cameras. However, with the emergence of fake license plates, duplicate license plates, and damaged license plates, the accuracy of vehicle identification through license plate recognition has decreased. In view of this, how to improve the accuracy of vehicle identification has become an urgent problem to be solved. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a vehicle identification method and related devices, electronic equipment and storage medium, which can improve the accuracy of vehicle identification.
[0005] In order to solve the above technical problems, the first aspect of the present application provides a vehicle identification method, including: obtaining a vehicle feature library; wherein the vehicle feature library includes first vehicle features extracted from a plurality of first vehicle images respectively, and the first vehicle features are obtained by fusing detail features and perspective features of the first vehicle images; performing feature extraction on a second vehicle image of a vehicle to be identified to obtain a second vehicle feature; wherein the second vehicle feature is obtained by fusing detail features and perspective features of the second vehicle image; and then obtaining vehicle information of the vehicle to be identified based on the similarity between the second vehicle feature and each of the first vehicle features.
[0006] In order to solve the above technical problems, the second aspect of the present application provides a vehicle identification device, including an acquisition module, an extraction module and a selection module, the acquisition module is used to acquire a vehicle feature library; wherein the vehicle feature library includes first vehicle features extracted from a plurality of first vehicle images respectively, and the first vehicle features are obtained by fusing detail features and perspective features of the vehicle images; the extraction module is used to perform feature extraction on a second vehicle image of a vehicle to be identified to obtain a second vehicle feature; wherein the second vehicle feature is obtained by fusing detail features and perspective features of the second vehicle image; the selection module is used to obtain vehicle information of the vehicle to be identified based on the similarity between the second vehicle feature and each first vehicle feature.
[0007] In order to solve the above technical problems, the third aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, the memory storing program instructions, and the processor being used to execute the program instructions to implement the vehicle identification method in the above first aspect.
[0008] In order to solve the above technical problem, the fourth aspect of the present application provides a computer-readable storage medium storing program instructions that can be executed by a processor, wherein the program instructions are used to implement the vehicle identification method in the above first aspect.
[0009] The above scheme obtains a vehicle feature library, and the vehicle feature library includes first vehicle features extracted from a plurality of first vehicle images, the first vehicle features are obtained by fusing the detail features and the viewing angle features of the first vehicle images, and extracts features from the second vehicle image of the vehicle to be identified, to obtain the second vehicle feature, and the second vehicle feature is obtained by fusing the detail features and the viewing angle features of the second vehicle image. On this basis, based on the similarity between the second vehicle feature and each of the first vehicle features, the vehicle information of the vehicle to be identified is obtained. Since the first vehicle feature is obtained by fusing the detail features and the viewing angle features of the first vehicle image, and the second vehicle feature is also obtained by fusing the detail features and the viewing angle features of the second vehicle image, the vehicle features of the first vehicle image and the second vehicle image can be described from the perspective and details, respectively, which helps to make the vehicle features finally contain more accurate detail features through the viewing angle features, and improve the significance of the first vehicle feature and the second vehicle feature, so that the vehicle information of the identified vehicle is finally determined by calculating the similarity between the second vehicle feature and each of the first vehicle features, and the accuracy of vehicle identification can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flow chart of an embodiment of a vehicle identification method of the present application;
[0011] Figure 2 This is a network model diagram of an embodiment of the vehicle identification method of the present application;
[0012] Figure 3 is a flow chart of an embodiment of training a vehicle feature extraction model;
[0013] Figure 4 It is a schematic diagram of the framework of an embodiment of the vehicle identification device of the present application;
[0014] Figure 5 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0015] Figure 6 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0016] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0017] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0018] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0019] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the vehicle identification method of the present application. Specifically, it may include the following steps:
[0020] Step S11: Acquire the vehicle feature library.
[0021] In the disclosed embodiment, the vehicle feature library includes first vehicle features extracted from a plurality of first vehicle images, and the first vehicle features are obtained by fusing detail features and perspective features of the first vehicle images. It should be noted that by fusing detail features and perspective features to obtain the first vehicle features, vehicle identification can be performed more accurately. For example, the detail areas that should be focused on for the same vehicle at different perspectives are different. For example, in front of the vehicle, the annual inspection mark on the windshield can be focused on, while for the rear area of the vehicle, the taillights and the outline of the rear of the vehicle can be focused on.
[0022] In an implementation scenario, in order to obtain the first vehicle feature, the final perspective feature and the first detail feature of the vehicle image to be processed can be first extracted, and the final perspective feature can be transformed into a transformed perspective feature with the same dimension as the first detail feature; the first detail feature and the transformed perspective feature are fused to obtain a fused vehicle feature; and then the detail feature is extracted based on the fused vehicle feature to obtain the final vehicle feature; wherein, when the vehicle image to be processed is the first vehicle image, the final vehicle feature is the first vehicle feature. Exemplarily, in order to transform the final perspective feature into a transformed perspective feature with the same dimension as the first detail feature, the perspective feature can be mapped by a deconvolution function so that the final perspective feature is transformed into a transformed perspective feature with the same dimension as the first detail feature. The specific deconvolution function can be set according to actual conditions and is not specifically limited here. After the final perspective feature is transformed into a transformed perspective feature with the same dimension as the first detail feature, the first detail feature and the transformed perspective feature are fused to obtain a fused vehicle feature. Exemplarily, a fusion method of adding the first detail feature and the transformed perspective feature can be selected to obtain the fused vehicle feature. The fusion method between the first detail feature and the transformed perspective feature can be set according to actual conditions and is not specifically limited here. After obtaining the fused vehicle features, the detailed features can be further extracted based on the fused vehicle features to obtain the final vehicle features. It should be noted that, in the case of extracting the first vehicle features, the above-mentioned vehicle image to be processed is the first vehicle image, and the above-mentioned final vehicle features are the first vehicle features. The above-mentioned method, by transforming the final perspective feature into a transformed perspective feature having the same dimension as the first detailed feature, is conducive to the fusion of the first detailed feature and the transformed perspective feature, and helps to extract more accurate vehicle features.
[0023] In a specific implementation scenario, the viewing angle feature can be a regional feature observed by eyes in different directions. For example, the visual feature can be obtained by observing directly in front of the vehicle or by observing in front of the left side of the vehicle. The visual feature can be selected according to actual conditions and is not specifically limited here.
[0024] In a specific implementation scenario, the detail feature may be a feature of a special area in an image, and the detail feature may distinguish different vehicles of the same type. For example, the detail feature may include obvious marks on a car window, the shape of a car light, or marks on a door handle, etc. The detail feature may be selected according to actual conditions and is not specifically limited here.
[0025] In a specific implementation scenario, the same dimension may be that the transformed viewing angle feature and the first detail feature have the same feature size. For example, the dimension of the first detail feature is 224*224, and the corresponding final viewing angle feature is transformed into a transformed viewing angle feature having the same dimension as the first detail feature. Then, the dimension of the transformed viewing angle feature is also 224*224, and thus, the final viewing angle feature is transformed into a transformed viewing angle feature having the same dimension as the first detail feature. The same dimension of the transformed viewing angle feature and the first detail feature can be set according to actual conditions and is not specifically limited here.
[0026] In a specific implementation scenario, as described above, detail feature extraction can be performed based on the above-mentioned fused vehicle features to obtain the final vehicle features. Specifically, the detail feature extraction can be performed on the fused vehicle features first to obtain the second detail feature; and further, in response to the number of executions of the detail feature extraction being less than the preset threshold, the second detail feature can be used as the new first detail feature, and the aforementioned step of transforming the final perspective feature into a transformed perspective feature having the same dimension as the first detail feature and the subsequent steps can be re-executed; in addition, in response to the number of executions of the detail feature extraction being not less than the preset threshold, the second detail feature can be used as the final vehicle feature. Exemplarily, the preset threshold of the number of executions of the detail feature extraction can be set to n times, and after the detail feature extraction is executed, the second detail feature is obtained, and the number of executions of the detail feature extraction is increased by one, and the number of executions of the detail feature extraction is compared with n. If the number of executions of the detail feature extraction is less than n, the obtained second detail feature is used as the new first detail feature, and the step of transforming the final perspective feature into a transformed perspective feature having the same dimension as the first detail feature and the subsequent steps can be re-executed; if the number of executions of the detail feature extraction is not less than n, the second detail feature is used as the final vehicle feature. The preset threshold of the number of execution times of detail feature extraction can be set according to actual conditions and is not specifically limited here. In the above manner, by performing multiple detail feature extractions on detail features, the accuracy of extracting detail features is further improved, thereby obtaining more robust vehicle features.
[0027] In an implementation scenario, in order to improve the efficiency of feature extraction, a vehicle feature extraction model can be pre-trained, and the first vehicle feature can be extracted by the vehicle feature extraction model. The vehicle feature extraction model can include a view feature extraction network, a detail feature extraction network, and a feature fusion network; and the view feature extraction network is used to extract view features, the detail feature extraction network is used to extract detail features, and the feature fusion network is used to fuse view features and detail features. In the above method, the view features and detail features are obtained by extracting the view network and the detail network, and the view features and detail features are fused, so as to further improve the accuracy of vehicle recognition.
[0028] See also Figure 2 , Figure 2 is a network model diagram of an embodiment of the vehicle identification method of the present application, such as Figure 2 As shown, the detail feature extraction network 23 includes a number of sequentially connected detail feature extraction layers 231, the feature fusion network 22 includes a number of fusion sub-networks 221, the fusion sub-network 221 includes a dimensionality transformation layer 222 and a feature fusion layer 224 that are interconnected, and the feature fusion layer 224 of each fusion sub-network 221 is respectively connected to different detail feature extraction layers 231, and the dimensionality transformation layer 222 of each fusion sub-network 221 is connected to the view feature extraction network 21, and the view feature extraction network 21 includes a number of view feature extraction layers 211. In order to facilitate the distinction between the transformed view features 223 in different fusion sub-networks 221, different transformed view features 223 are distinguished by numbers 1, 2, 3, and 4; in order to facilitate the distinction between the dimensionality transformation layers 222 in different fusion sub-networks 221, different dimensionality transformation layers 222 are also distinguished by numbers 1, 2, 3, and 4; illustratively, both the detail feature extraction network 23 and the view feature extraction network 21 can use Resnet (Residual ImageNet) pre-trained with the ImageNet dataset Network, residual network) as a feature extractor, feature extraction of sample vehicle images, ImageNet is a large visualization database for visual object recognition software research, and ImageNet is like a network with multiple nodes; Resnet is a residual network, and related series of networks are widely used in fields such as target classification and as part of the backbone classical neural network for computer vision tasks. Common networks include Resnet50, Resnet101, etc. The proof network of Resnet network can develop in a deeper direction; detail feature extraction network 23 and view feature extraction network 21 can also use attention network structure as feature extractor, and the network structure for feature extraction of sample vehicle images can be selected according to actual conditions, and no specific limitation is made here. The above method gradually extracts deep detail features from multi-scale fusion features, thereby making the accuracy of vehicle features higher.
[0029] See also Figure 3 , Figure 3 This is a flow chart of an embodiment of training a vehicle feature extraction model. Specifically, the following steps may be included:
[0030] Step S30: pre-processing the sample vehicle image.
[0031] In one implementation scenario, the sample vehicle image has multiple sample vehicle images, and the sample vehicle images include the same vehicle images and different vehicle images. Exemplarily, the size of each batch sent to the network model is 36, that is, the number of sample vehicle images is 36 (for example, 12 vehicles, 3 images of each vehicle).
[0032] In one implementation scenario, image preprocessing may be adjusting the image. For example, the preprocessing may be adjusting the input size of the image, scaling the image size, etc. The preprocessing may be selected according to actual conditions and is not specifically limited here.
[0033] In one implementation scenario, image preprocessing requires building a vehicle feature model, and the vehicle feature extraction model includes a view feature extraction network, a detail feature extraction network, and a feature fusion network; wherein the view feature extraction network is used to extract view features, the detail feature extraction network is used to extract detail features, and the feature fusion network is used to fuse view features and detail features. In one implementation scenario, image preprocessing requires building a loss function. For example, the view feature extraction network can be constrained according to a cross entropy loss function, and the detail feature extraction network can be constrained according to a cross entropy loss function and a triplet loss function. The loss function can be selected according to actual conditions and is not specifically limited here.
[0034] In one implementation scenario, image preprocessing requires initialization of the network. Usually, the network model parameters, especially the weight parameters, are randomly initialized. For example, if the parameters of each hidden unit are initialized to equal values, then each hidden unit will calculate the same value based on the same input during forward propagation and pass it to the output layer. In reverse propagation, the parameter gradient values of each hidden unit are equal, so these parameters remain equal after iteration using the gradient-based optimization algorithm, and the same is true for subsequent iterations. At this point, no matter how many hidden units there are, the hidden layer essentially only has one hidden unit in effect, so the network needs to be randomly initialized.
[0035] Step S31: extracting features from the sample vehicle image.
[0036] In an implementation scenario, a round of iteration requires the construction of a sampling template, and 12 types of vehicles can be randomly sampled for each batch of samples, and 3 images can be randomly sampled for each type of vehicle, and the images are input into the network after real-time data enhancement. Exemplarily, taking Resnet pre-trained with the ImageNet dataset as a feature extractor and the size of each batch sent to the network model as 36 as an example, that is, the number of images is 36 (for example, 12 vehicles, 3 images per vehicle), the perspective feature is extracted using the perspective feature extraction network to obtain a 36*512 (36 is the size of each batch sent to the network model, and 512 is the output dimension of the residual network used) perspective feature, the detail feature extraction network is used to extract the detail feature, and the obtained perspective feature fusion sub-network is fused, that is, the dimensional transformation layer performs a deconvolution function (projection) mapping on the perspective feature to obtain a transformed perspective feature of the same dimension as the output of the detail feature extraction layer in the detail feature extraction network, and these transformed perspective features after function mapping are fused with the features output by the corresponding detail feature extraction layer to obtain a second detail feature. At the beginning of feature extraction, the 36*512 vehicle perspective features extracted by the perspective feature extraction network are respectively subjected to four different dimensional transformation layers, and then four different transformed perspective features are obtained, which are then integrated into the vehicle feature learning. After the first dimensional transformation layer, the perspective features are converted into 36*3*256*256 dimensional transformed perspective features, and the transformed perspective features are added to the first detail features input by the detail feature extraction network to obtain the second detail features, and the second detail features are input as the new first detail features into the first layer (layer1) of the detail feature extraction network; after the second dimensional transformation layer, they are converted into 36*64*64*64 dimensional transformed perspective features, and the transformed perspective features are added to the first detail features input by the detail feature extraction network to obtain the second detail features, and the second detail features are input as the new first detail features. The vehicle is input into the second layer (layer2) of the detail feature extraction network; after the third dimension transformation layer, it is converted into a 36*256*16*16-dimensional transformed viewing angle feature, the transformed viewing angle feature is added to the first detail feature input to the detail feature extraction network to obtain the second detail feature, and the second detail feature is input into the third layer (layer3) of the detail feature extraction network as the new first detail feature; after the fourth dimension transformation layer, it is converted into a 36*512*8*8-dimensional transformed viewing angle feature, the transformed viewing angle feature is added to the first detail feature input to the detail feature extraction network to obtain the second detail feature, and the second detail feature is input into the fourth layer (layer4) of the detail feature extraction network as the new first detail feature, and the detail feature extracted by the fourth layer (layer4) of the detail feature extraction network is used as the final vehicle feature.
[0037] In a specific implementation scenario, the vehicle extraction model can be trained by a sample image set, the sample image set includes a number of sample vehicle images, and the detail feature extraction network is trained after the view feature extraction network training converges. In the above method, by training the detail feature extraction network after the view feature extraction network training converges, the robustness of the vehicle features is further improved, which helps to improve the accuracy of vehicle recognition. Step S32: Calculate the loss and adjust the network parameters.
[0038] In an implementation scenario, by calculating the loss, the parameters of the view feature extraction network, the detail feature extraction network and the feature fusion network are adjusted respectively, thereby making the feature extraction more accurate.
[0039] In a specific implementation scenario, based on the sample vehicle images annotated with sample perspectives, the training of the perspective feature extraction network can first extract the sample perspective features of the sample vehicle images; perform perspective prediction based on the sample perspective features to obtain the predicted perspective; and then adjust the network parameters of the perspective feature extraction network based on the difference between the sample perspective and the predicted perspective. Exemplarily, the network parameters of the perspective feature extraction network can be adjusted using a cross entropy loss function, which is specifically expressed as:
[0040]
[0041] Among them, B represents the number of images in each batch, M represents the total number of categories in the vehicle training set, represents the probability of the i-th image in each batch about the c-th category, P ic Indicates the predicted probability of the i-th image in each batch with respect to the c-th category. In the above method, by adjusting the network parameters of the view feature extraction network, the view feature extraction network is further made to extract the view feature more accurately.
[0042] In a specific implementation scenario, the sample image set is annotated with reference information, and the reference information includes whether the sample vehicle images belong to the same vehicle. The training step of the detail feature extraction network can extract the sample vehicle features of each sample vehicle image based on the vehicle feature extraction model; based on the reference information, select the positive vehicle features and negative vehicle features of the sample vehicle features from the sample vehicle features of each sample vehicle image; and then adjust the network parameters of the detail feature extraction network based on the differences between the sample vehicle features and their positive vehicle features and negative vehicle features. Exemplarily, based on the differences between the sample vehicle features and their positive vehicle features and negative vehicle features, supervised training can be performed using the identity labels of the vehicles, and the output features can be constrained by the cross entropy loss function and the triplet loss function. The details of the cross entropy loss can refer to the specific content of adjusting the network parameters of the view feature extraction network mentioned above, and the triplet loss function is specifically expressed as:
[0043]
[0044] Where X a , X p , X n Represent anchor points respectively, ɑ is a preset threshold value, which can be set according to actual conditions and is not specifically limited here. For the features of positive and negative samples, for each sample vehicle image, the sample vehicle features extracted from the sample vehicle images belonging to the same vehicle can be used as positive vehicle features, and the sample vehicle features extracted from the sample vehicle images belonging to different vehicles can be used as negative vehicle features. The positive vehicle features and negative vehicle features can be set according to actual conditions and are not specifically limited here. In the above method, the network parameters of the detail feature extraction network are adjusted by the differences between the sample vehicle features and their positive vehicle features and negative vehicle features, which helps to improve the accuracy of the network parameter adjustment of the detail feature extraction network, makes the detail feature extraction more robust, and further improves the accuracy of vehicle recognition.
[0045] Step S33: Determine whether the number of training times is less than a threshold; if so, execute step S31; otherwise, execute step S34.
[0046] In an implementation scenario, the threshold of the number of training times can be set according to actual conditions and is not specifically limited here.
[0047] Step S34: Stop training and save current network parameters.
[0048] In one implementation scenario, network parameters are determined to improve the accuracy of feature extraction.
[0049] Step S12: extracting features from the second vehicle image of the vehicle to be identified to obtain second vehicle features.
[0050] In the disclosed embodiment, the second vehicle feature is obtained by fusing the detail feature and the view feature of the second vehicle image. In order to improve the extraction efficiency of the second vehicle feature, the second vehicle feature can also be extracted by a vehicle feature extraction model, which includes a view feature extraction network, a detail feature extraction network, and a feature fusion network. It should be noted that the extraction process of the second vehicle feature is the same as that of the first vehicle feature, and the extraction process of the first vehicle feature mentioned above can be referred to, which will not be repeated here.
[0051] Step S13: Based on the similarities between the second vehicle feature and each of the first vehicle features, the vehicle information of the vehicle to be identified is obtained.
[0052] In a specific implementation scenario, the first vehicle feature and the second vehicle feature may be a set of data, that is, the first vehicle image and the second vehicle image are described by using this set of data, and the better the representativeness of the data, the less the image features are affected by factors such as light, noise, and geometric deformation. The similarity between the second vehicle feature and each first vehicle feature can be determined by calculating the distance between the second vehicle feature and each first vehicle feature. For example, the similarity can be calculated based on the cosine of the angle, and the range of the cosine of the angle is [-1,1]. The similarity between the two features can be obtained based on the cosine value range, that is, the larger the cosine value of the angle, the smaller the angle between the two features, and the smaller the cosine of the angle, the larger the angle between the two features. When the directions of the two features coincide, the cosine of the angle takes the maximum value of 1, and when the directions of the two features are completely opposite, the cosine of the angle takes the minimum value of -1; the similarity can also be calculated based on the Euclidean distance, and the value calculated by the Euclidean distance is inversely proportional to the similarity between the image features. The smaller the Euclidean distance, the greater the similarity between the image features, and the larger the Euclidean distance, the smaller the similarity between the image features. The calculation of similarity can be set according to actual conditions and is not specifically limited here.
[0053] In a specific implementation scenario, the vehicle information may be the aforementioned first vehicle image. The vehicle information may also include information such as a vehicle identification number. The vehicle information may be set according to actual conditions and is not specifically limited here.
[0054] In one implementation scenario, in response to the second vehicle feature and the similarities between the first vehicle features respectively not satisfying the preset conditions, the second vehicle feature is used as a new first vehicle feature, and the second vehicle image is used as a new first vehicle image, and both are included in the vehicle feature library. In the above manner, by including the second vehicle features that do not satisfy the preset conditions in the vehicle feature library, the vehicle feature library can be continuously updated and expanded, further improving the accuracy of vehicle recognition.
[0055] In a specific implementation scenario, the preset condition may be that the similarity between the second vehicle feature and the first vehicle feature is greater than a preset threshold, wherein the preset threshold may be set to any value of 70%, 80%, or 90%. The preset threshold may be set according to actual conditions and is not specifically limited here. The preset condition may also be that the similarity between the second vehicle feature and each of the first vehicle features is the greatest, that is, the similarities between the second vehicle feature and each of the first vehicle features are sorted, and the one with the greatest similarity meets the preset condition. The preset condition may also be that the similarity between the second vehicle feature and the first vehicle feature is greater than a preset threshold and the similarity between the second vehicle feature and each of the first vehicle features is the greatest. The preset condition may be set according to actual conditions and is not specifically limited here.
[0056] The above scheme obtains a vehicle feature library, and the vehicle feature library includes first vehicle features extracted from a plurality of first vehicle images, the first vehicle features are obtained by fusing the detail features and the view feature of the first vehicle image, and extracts features from the second vehicle image of the vehicle to be identified, obtaining the second vehicle feature, and the second vehicle feature is obtained by fusing the detail features and the view feature of the second vehicle image, and on this basis, based on the similarity between the second vehicle feature and each of the first vehicle features, the vehicle information of the vehicle to be identified is obtained. Since the first vehicle feature is obtained by fusing the detail features and the view feature of the first vehicle image, and the second vehicle feature is also obtained by fusing the detail features and the view feature of the second vehicle image, the vehicle features of the first vehicle image and the second vehicle image can be described from the perspective and details, respectively, which helps to make the vehicle features finally contain more accurate detail features through the view feature, and improve the significance of the first vehicle feature and the second vehicle feature, so that the vehicle information of the identified vehicle is finally determined by calculating the similarity between the second vehicle feature and each of the first vehicle features, and the accuracy of vehicle identification can be improved.
[0057] See also Figure 4 , Figure 4 It is a schematic diagram of the framework of an embodiment of the vehicle identification device of the present application. The vehicle identification device 40 includes an acquisition module 41, an extraction module 42 and a selection module 43. The acquisition module 41 is used to acquire a vehicle feature library; wherein the vehicle feature library includes first vehicle features extracted from a plurality of first vehicle images, and the first vehicle features are obtained by fusion of detail features and perspective features of the vehicle images; the extraction module 42 is used to extract features from the second vehicle image of the vehicle to be identified, and obtain a second vehicle feature; wherein the second vehicle feature is obtained by fusion of detail features and perspective features of the second vehicle image; the selection module 43 is used to obtain vehicle information of the vehicle to be identified based on the similarity between the second vehicle feature and each first vehicle feature.
[0058] In the above scheme, since the first vehicle feature is obtained by fusing the detail features and the perspective features of the first vehicle image, and the second vehicle feature is also obtained by fusing the detail features and the perspective features of the second vehicle image, the vehicle features of the first vehicle image and the second vehicle image can be described respectively from the perspective and the details, which helps to make the vehicle features ultimately include more accurate detail features through the perspective features, thereby improving the significance of the first vehicle feature and the second vehicle feature, and thus calculating the similarity between the second vehicle feature and each of the first vehicle features, and finally determining the vehicle information of the identified vehicle, thereby improving the accuracy of vehicle recognition.
[0059] In some disclosed embodiments, the acquisition module 41 includes a first extraction submodule, and the extraction module 42 includes a second extraction submodule. The first extraction submodule / the second extraction submodule is used to extract the final perspective feature and the first detail feature of the vehicle image to be processed, and transform the final perspective feature into a transformed perspective feature having the same dimension as the first detail feature; the acquisition module 41 includes a first fusion submodule, and the extraction module 42 includes a second fusion submodule. The first fusion submodule / the second fusion submodule is used to fuse the first detail feature and the transformed perspective feature to obtain a fused vehicle feature; the acquisition module 41 also includes a first determination submodule, and the extraction module 42 also includes a second determination submodule. The first determination submodule / the second determination submodule is used to extract detail features based on the fused vehicle features to obtain the final vehicle features.
[0060] Therefore, by transforming the final viewing angle feature into a transformed viewing angle feature having the same dimension as the first detail feature, it is beneficial to merge the first detail feature and the transformed viewing angle feature, and helps to extract more accurate vehicle features.
[0061] In some disclosed embodiments, the first determination submodule / the second determination submodule includes an extraction unit, which is used to perform detail feature extraction on the fused vehicle feature to obtain a second detail feature; the first determination submodule / the second determination submodule also includes a comparison unit, which is used to, in response to the number of executions of the detail feature extraction being less than a preset threshold, use the second detail feature as a new first detail feature, and re-execute the step of transforming the final perspective feature into a transformed perspective feature having the same dimension as the first detail feature and subsequent steps; the comparison unit is also used to, in response to the number of executions of the detail feature extraction being not less than a preset threshold, use the second detail feature as the final vehicle feature.
[0062] Therefore, by performing multiple detail feature extractions on detail features, the accuracy of extracting detail features is further improved, thereby obtaining more robust vehicle features.
[0063] In some disclosed embodiments, the first vehicle feature and / or the second vehicle feature are extracted by a vehicle feature extraction model, which includes a view feature extraction network, a detail feature extraction network, and a feature fusion network; and the view feature extraction network is used to extract view features, the detail feature extraction network is used to extract detail features, and the feature fusion network is used to fuse view features and detail features.
[0064] Therefore, the perspective features and detail features are obtained by extracting the perspective network and the detail network, and the perspective features and detail features are fused to further improve the accuracy of vehicle recognition.
[0065] In some disclosed embodiments, the detail feature extraction network includes several sequentially connected detail feature extraction layers, the feature fusion network includes several fusion sub-networks, the fusion sub-networks include interconnected dimension transformation layers and feature fusion layers, and the feature fusion layers of each fusion sub-network are respectively connected to different detail feature extraction layers, and the dimension transformation layers of each fusion sub-network are connected to the view feature extraction network.
[0066] Therefore, by gradually extracting deep detail features from multi-scale fusion features, the accuracy of vehicle features is made higher.
[0067] In some disclosed embodiments, the vehicle extraction model is trained by a sample image set, the sample image set includes a number of sample vehicle images, and the detail feature extraction network is trained after the view feature extraction network training converges.
[0068] Therefore, by training the detail feature extraction network after the view feature extraction network has converged, the robustness of vehicle features can be further improved, which helps to improve the accuracy of vehicle recognition.
[0069] In some disclosed embodiments, the acquisition module 41 / extraction module 42 includes a first adjustment submodule, which is used to extract sample perspective features of a sample vehicle image; and perform perspective prediction based on the sample perspective features to obtain a predicted perspective; and then adjust network parameters of a perspective feature extraction network based on the difference between the sample perspective and the predicted perspective.
[0070] Therefore, by adjusting the network parameters of the view feature extraction network, the view feature extraction network can further extract the view features more accurately.
[0071] In some disclosed embodiments, the acquisition module 41 / extraction module 42 also includes a second adjustment submodule, which is used to extract sample vehicle features of each sample vehicle image based on a vehicle feature extraction model; and based on reference information, respectively select positive vehicle features and negative vehicle features of the sample vehicle features from the sample vehicle features of each sample vehicle image; and then adjust the network parameters of the detail feature extraction network based on the differences between the sample vehicle features and their positive vehicle features and negative vehicle features.
[0072] Therefore, adjusting the network parameters of the detail feature extraction network by comparing the differences between the sample vehicle features and the positive example vehicle features and the negative example vehicle features respectively helps to improve the accuracy of the network parameter adjustment of the detail feature extraction network, making the detail feature extraction more robust and further improving the accuracy of vehicle recognition.
[0073] In some disclosed embodiments, the vehicle identification device 40 also includes an update module, which is used to respond to the fact that the similarities between the second vehicle feature and each of the first vehicle features do not meet a preset condition, and to use the second vehicle feature as a new first vehicle feature and the second vehicle image as a new first vehicle image to include them together in the vehicle feature library.
[0074] Therefore, by incorporating the second vehicle feature that does not meet the preset condition into the vehicle feature library, the vehicle feature library can be continuously updated and expanded, further improving the accuracy of vehicle identification.
[0075] See also Figure 5 , Figure 5 1 is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 50 includes a memory 51 and a processor 52 coupled to each other, the memory 51 stores program instructions, and the processor 52 is used to execute the program instructions to implement the steps in any of the above vehicle identification method embodiments. Specifically, the electronic device 50 may include but is not limited to: a desktop computer, a laptop computer, a server, a mobile phone, a tablet computer, etc., which are not limited here.
[0076] Specifically, the processor 52 is used to control itself and the memory 51 to implement the steps in any of the above-mentioned vehicle identification method embodiments. The processor 52 can also be called a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip with signal processing capabilities. The processor 52 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 52 can be implemented by an integrated circuit chip.
[0077] In the above scheme, since the first vehicle feature is obtained by fusing the detail features and the perspective features of the first vehicle image, and the second vehicle feature is also obtained by fusing the detail features and the perspective features of the second vehicle image, the vehicle features of the first vehicle image and the second vehicle image can be described respectively from the perspective and the details, which helps to make the vehicle features ultimately include more accurate detail features through the perspective features, thereby improving the significance of the first vehicle feature and the second vehicle feature, and thus calculating the similarity between the second vehicle feature and each of the first vehicle features, and finally determining the vehicle information of the identified vehicle, thereby improving the accuracy of vehicle recognition.
[0078] See also Figure 6 , Figure 6 The computer-readable storage medium 60 stores program instructions 61 that can be executed by a processor, and the program instructions 61 are used to implement the steps in any of the above vehicle identification method embodiments.
[0079] In the above scheme, since the first vehicle feature is obtained by fusing the detail features and the perspective features of the first vehicle image, and the second vehicle feature is also obtained by fusing the detail features and the perspective features of the second vehicle image, the vehicle features of the first vehicle image and the second vehicle image can be described respectively from the perspective and the details, which helps to make the vehicle features ultimately include more accurate detail features through the perspective features, thereby improving the significance of the first vehicle feature and the second vehicle feature, and thus calculating the similarity between the second vehicle feature and each of the first vehicle features, and finally determining the vehicle information of the identified vehicle, thereby improving the accuracy of vehicle recognition.
[0080] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0081] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0082] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0083] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0084] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0085] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A vehicle identification method, It is characterized in that include: Acquire a vehicle feature library; wherein the vehicle feature library includes first vehicle features extracted from a plurality of first vehicle images, and the first vehicle features are obtained by fusing detail features and viewing angle features of the first vehicle images; Extracting features from the second vehicle image of the vehicle to be identified to obtain a second vehicle feature; wherein the second vehicle feature is obtained by fusing detail features and viewing angle features of the second vehicle image; Based on the similarities between the second vehicle features and the first vehicle features respectively, obtaining the vehicle information of the vehicle to be identified; The step of extracting the first vehicle feature or the second vehicle feature comprises: Extracting a final viewing angle feature and a first detail feature of the vehicle image to be processed, and transforming the final viewing angle feature into a transformed viewing angle feature having the same dimension as the first detail feature; Fusing the first detail feature and the transformed view feature to obtain a fused vehicle feature; Performing detail feature extraction on the fused vehicle feature to obtain a second detail feature; In response to the number of executions of the detail feature extraction being less than a preset threshold, taking the second detail feature as a new first detail feature, and re-performing the step of transforming the final viewing angle feature into a transformed viewing angle feature having the same dimension as the first detail feature and subsequent steps; In response to the number of executions of the detail feature extraction being not less than the preset threshold, taking the second detail feature as a final vehicle feature; Wherein, when the vehicle image to be processed is the first vehicle image, the final vehicle feature is the first vehicle feature; and when the vehicle image to be processed is the second vehicle image, the final vehicle feature is the second vehicle feature.
2. The method according to claim 1, It is characterized in that The first vehicle feature and / or the second vehicle feature are extracted by a vehicle feature extraction model, wherein the vehicle feature extraction model includes a view feature extraction network, a detail feature extraction network and a feature fusion network; The viewing angle feature extraction network is used to extract the viewing angle feature, the detail feature extraction network is used to extract the detail feature, and the feature fusion network is used to fuse the viewing angle feature and the detail feature.
3. The method according to claim 2, It is characterized in that The detail feature extraction network includes several sequentially connected detail feature extraction layers, the feature fusion network includes several fusion sub-networks, the fusion sub-networks include interconnected dimensionality transformation layers and feature fusion layers, and the feature fusion layers of each fusion sub-network are respectively connected to different detail feature extraction layers, the dimensionality transformation layers of each fusion sub-network are connected to the view feature extraction network, and the view feature extraction network includes several view feature extraction layers.
4. The method according to claim 2, It is characterized in that The vehicle extraction model is obtained by training a sample image set, wherein the sample image set includes a plurality of sample vehicle images, and the detail feature extraction network is trained after the viewing angle feature extraction network training converges.
5. The method according to claim 4, It is characterized in that The sample vehicle image is annotated with a sample viewpoint, and the training steps of the viewpoint feature extraction network include: Extracting sample viewing angle features of the sample vehicle image; Performing perspective prediction based on the sample perspective feature to obtain a predicted perspective; Based on the difference between the sample perspective and the predicted perspective, a network parameter of the perspective feature extraction network is adjusted.
6. The method according to claim 4, It is characterized in that The sample image set is annotated with reference information, and the reference information includes whether two of the sample vehicle images belong to the same vehicle. The training steps of the detail feature extraction network include: Extracting sample vehicle features of each of the sample vehicle images based on the vehicle feature extraction model; Based on the reference information, respectively select positive vehicle features and negative vehicle features of the sample vehicle features from the sample vehicle features of each of the sample vehicle images; Based on the differences between the sample vehicle features and the positive example vehicle features and the negative example vehicle features, the network parameters of the detail feature extraction network are adjusted.
7. The method according to claim 1, It is characterized in that The method further comprises: In response to the similarities between the second vehicle feature and each of the first vehicle features not satisfying a preset condition, the second vehicle feature is used as a new first vehicle feature, and the second vehicle image is used as a new first vehicle image, and both are included in the vehicle feature library.
8. A vehicle identification device, It is characterized in that include: An acquisition module, used for acquiring a vehicle feature library; wherein the vehicle feature library includes first vehicle features respectively extracted from a plurality of first vehicle images, and the first vehicle features are obtained by fusing detail features and viewing angle features of the vehicle images; An extraction module, configured to extract features from a second vehicle image of the vehicle to be identified, and obtain a second vehicle feature; wherein the second vehicle feature is obtained by fusing a detail feature and a viewing angle feature of the second vehicle image; A selection module, configured to obtain the vehicle information of the vehicle to be identified based on the similarity between the second vehicle feature and each of the first vehicle features; The acquisition module includes a first extraction submodule, and the extraction module includes a second extraction submodule. The first extraction submodule or the second extraction submodule is used to: Extracting a final viewing angle feature and a first detail feature of the vehicle image to be processed, and transforming the final viewing angle feature into a transformed viewing angle feature having the same dimension as the first detail feature; Fusing the first detail feature and the transformed view feature to obtain a fused vehicle feature; Performing detail feature extraction on the fused vehicle feature to obtain a second detail feature; In response to the number of executions of the detail feature extraction being less than a preset threshold, taking the second detail feature as a new first detail feature, and re-performing the step of transforming the final viewing angle feature into a transformed viewing angle feature having the same dimension as the first detail feature and subsequent steps; In response to the number of executions of the detail feature extraction being not less than the preset threshold, taking the second detail feature as a final vehicle feature; Wherein, when the vehicle image to be processed is the first vehicle image, the final vehicle feature is the first vehicle feature; and when the vehicle image to be processed is the second vehicle image, the final vehicle feature is the second vehicle feature.
9. An electronic device, It is characterized in that It comprises a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the vehicle identification method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the vehicle identification method according to any one of claims 1 to 7.
