Vehicle brand identification method and device and storage medium
1. A method of brand identification for a vehicle, the method comprising:
constructing a convolution cyclic neural network model based on an attention mechanism according to the structural information of the brand of the vehicle;
training the convolution cyclic neural network model based on the attention mechanism by using a vehicle image marked with structural information of a vehicle brand to obtain a vehicle brand identification model;
and identifying the vehicle image to be identified by utilizing the vehicle brand identification model, and determining the vehicle brand in the vehicle image to be identified.
2. The method of claim 1,
according to the structural information of the vehicle brand, constructing a convolutional recurrent neural network model based on an attention mechanism, wherein the convolutional recurrent neural network model comprises the following steps:
constructing a convolutional neural network for extracting characteristic information of the vehicle image;
according to the structural information of the vehicle brand, constructing a cyclic neural network based on an attention mechanism and used for identifying the vehicle brand of the vehicle image according to the characteristic information of the vehicle image output by the convolutional neural network.
3. The method of claim 2,
the method for constructing the convolutional neural network for extracting the characteristic information of the vehicle image comprises the following steps:
carrying out structure adjustment on the designated convolutional neural network, and taking the designated convolutional neural network after structure adjustment as a convolutional neural network for carrying out feature extraction on the vehicle image;
wherein, carry out the structural adjustment to appointed convolutional neural network, include: deleting the global pooling layer and the full-link layer of the designated convolutional neural network, and modifying the step size stride of the designated convolution in the designated convolutional layer of the designated convolutional neural network so as to keep the resolution ratio between the input image and the output image of the whole convolutional layer in the designated convolutional neural network within a preset ratio range.
4. The method of claim 3,
the appointed convolutional layers are M convolutional layers which are arranged in the appointed convolutional neural network in a later order; the specified convolution is a convolution with a step size of not 1 in the specified convolutional layer;
the method for modifying the step size of the specified convolution layer in the specified convolution neural network comprises the following steps: the step size of the given convolution in the next-ranked M convolutional layers of the given convolutional neural network is set to 1.
5. The method of claim 2,
the structured information of the vehicle brand comprises N levels of brand information which are classified into levels according to the subordination relationship, wherein the brand information of each level is the subordinate brand information of the previous level;
the method for constructing the attention-based recurrent neural network for identifying the vehicle brand of the vehicle image according to the characteristic information of the vehicle image output by the convolutional neural network according to the structural information of the vehicle brand comprises the following steps:
constructing an N + 2-layer LSTM network, and setting an attention mechanism module aiming at each layer from the 2 nd layer to the N +2 th layer of LSTM network;
setting input information of a layer 1 LSTM network of the N +2 layer LSTM network as 0;
for each of the layer 2 to layer N +1 LSTM networks, performing the following operations:
taking the output information of the previous layer of LSTM and the output information of the attention mechanism module set for the layer of LSTM as the input information of the layer of LSTM;
and taking the classification information in the output information of the previous layer of LSTM and the output information of the convolutional neural network as the input information of an attention mechanism module arranged aiming at the layer of LSTM network, so that the attention mechanism module determines target brand information according to the classification information in the output information of the previous layer of LSTM network and carries out attention weighting on the target brand information.
6. The method of claim 5,
the classification information in the output information of the layer 1 LSTM network is classification starting information, and an attention mechanism module arranged aiming at the layer 2 LSTM network determines the brand information of a first level in the vehicle brand information as target brand information according to the classification starting information;
the classification information in the output information of each layer of LSTM network in the layer 2 to the layer N +2 LSTM networks is brand information, and an attention mechanism module arranged aiming at each layer of LSTM network in the layer 3 to the layer N +2 LSTM networks determines the brand information of the next level of the brand information output by the previous layer of LSTM network as target brand information.
7. The method of claim 2,
the vehicle brand recognition model is utilized to recognize the vehicle image to be recognized, and the vehicle brand in the vehicle image to be recognized is determined, and the method comprises the following steps:
coding a vehicle image to be identified by using a convolutional neural network in the vehicle brand identification model to obtain the characteristic information of the image to be identified;
and decoding the characteristic information of the vehicle image to be identified by utilizing the attention-based recurrent neural network in the vehicle brand identification model to obtain the vehicle brand information of the vehicle image to be identified.
8. A vehicle brand identification device, comprising: a processor and a non-transitory computer readable storage medium connected with the processor through a bus;
the non-transitory computer readable storage medium storing a computer program executable on the processor, the processor implementing the following steps when executing the program:
constructing a convolution cyclic neural network model based on an attention mechanism according to the structural information of the brand of the vehicle;
training the convolution cyclic neural network model based on the attention mechanism by using a vehicle image marked with structural information of a vehicle brand to obtain a vehicle brand identification model;
and identifying the vehicle image to be identified by utilizing the vehicle brand identification model, and determining the vehicle brand in the vehicle image to be identified.
9. The apparatus of claim 8,
the processor constructs a convolutional recurrent neural network based on an attention mechanism according to the structural information of the brand of the vehicle, and comprises the following steps:
constructing a convolutional neural network for extracting characteristic information of the vehicle image;
according to the structural information of the vehicle brand, constructing a cyclic neural network based on an attention mechanism and used for identifying the vehicle brand of the vehicle image according to the characteristic information of the vehicle image output by the convolutional neural network.
10. A non-transitory computer readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps in the vehicle brand identification method of any one of claims 1 to 7.
Background
In traffic management systems, vehicle brand identification is an important component.
In the existing vehicle brand identification method, feature extraction is generally carried out on a fixed area (such as the periphery of a license plate) of a vehicle, and a classifier is adopted to directly classify vehicle brands according to the extracted feature information, so that the defects of low classification performance, no self-adaptability and the like exist. For example, in some of the disclosed vehicle brand recognition methods, vehicle brand recognition is completed by locating the position of headlights, extracting HOG features, and performing SVM classification, because only the headlight area is used for vehicle brand recognition, the extracted features are relatively small, and the feature description capability of the HOG features is not strong, so the classification performance is poor. In the other vehicle brand identification method, image areas are expanded to the periphery according to the license plate position and a fixed rule to obtain image blocks for CNN to extract features, so that vehicle brand and model identification is realized.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus and a storage medium for identifying a vehicle brand.
In order to achieve the purpose, the invention provides the following technical scheme:
a vehicle brand identification method, comprising:
constructing a convolutional recurrent neural network model based on an attention mechanism according to the structural information of the brand of the vehicle;
training the convolution cyclic neural network model based on the attention mechanism by using a vehicle image marked with structural information of a vehicle brand to obtain a vehicle brand identification model;
and identifying the vehicle image to be identified by utilizing the vehicle brand identification model, and determining the vehicle brand in the vehicle image to be identified.
A vehicle brand identification device, comprising: a processor and a non-transitory computer readable storage medium connected with the processor through a bus;
the non-transitory computer readable storage medium storing a computer program executable on the processor, the processor implementing the following steps when executing the program:
constructing a convolutional recurrent neural network model based on an attention mechanism according to the structural information of the brand of the vehicle;
training the convolution cyclic neural network model based on the attention mechanism by using a vehicle image marked with structural information of a vehicle brand to obtain a vehicle brand identification model;
and identifying the vehicle image to be identified by utilizing the vehicle brand identification model, and determining the vehicle brand in the vehicle image to be identified.
A non-transitory computer readable storage medium storing instructions, wherein the instructions, when executed by a processor, cause the processor to perform the steps in the vehicle brand identification method as described above.
According to the technical scheme, the convolution cyclic neural network based on the attention mechanism is constructed according to the structural information of the vehicle brand, the structural information marked with the vehicle brand is used for training the convolution cyclic neural network to obtain the vehicle brand identification model, and the vehicle brand information in the vehicle image to be identified is identified by the vehicle brand identification model. The vehicle image brand recognition method and device can adaptively combine the structural information and the attention mechanism of the vehicle brand to perform brand recognition on the vehicle image, and compared with the existing method that the vehicle brand is recognized by extracting the characteristics of a fixed area of the vehicle, the classification performance is higher.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 is a flow chart of a vehicle brand identification method according to an embodiment of the present invention;
FIG. 2 is a structured information presentation diagram of a vehicle brand according to an embodiment of the present invention;
FIG. 3 is a flow chart of a vehicle brand identification method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a convolution cyclic neural network model based on an attention mechanism according to an embodiment of the present invention;
FIG. 5 is a flow chart of a method for brand identification of a third vehicle in accordance with an embodiment of the present invention;
FIG. 6 is a flow chart of a four-vehicle brand identification method of an embodiment of the present invention;
FIG. 7 is a schematic diagram of a recurrent neural network model based on an attention mechanism according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a brand recognition device of a vehicle according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flow chart of a vehicle brand identification method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step 101, constructing a convolutional recurrent neural network model based on an attention mechanism according to the structural information of the vehicle brand.
In the embodiment of the invention, the structured information of the vehicle brand refers to brand information for describing a plurality of hierarchies of the vehicle brand. For example, the following vehicle brands: vogue passat 2019, the brand of the vehicle comprises 3 levels of brand information, namely: a first level of 'public', a second level of 'pasait', and a third level of '2019 money', wherein the first level of 'public' is a general brand, the second level of 'pasait' is a subordinate brand of the first level of 'public', and the third level of '2019 money' is a subordinate brand of the second level of 'pasait', indicating a production year of 'pasait'.
FIG. 2 is a diagram of an example of a hierarchy of structured information for a vehicle brand, as shown in FIG. 2, including: vasta pasait 2019 to 2015, volkswagen 2019 to 2015 (i.e., the leftmost level display in fig. 2), toyota chemeri 2019 to 2015, toyota karya 2019 to 2015 (i.e., the middle level display in fig. 2), audi A4L 2019 to 2015, and audi Q52019 to 2015 (i.e., the rightmost level display in fig. 2).
102, training a convolution cyclic neural network model based on an attention mechanism by using a vehicle image marked with structural information of a vehicle brand to obtain a vehicle brand identification model;
and 103, identifying the vehicle image to be identified by using the vehicle brand identification model, and determining the vehicle brand in the vehicle image to be identified.
Based on the embodiment of the invention shown in fig. 1, in the invention, when the attention-based convolutional recurrent neural network is constructed, the structural information of the vehicle brand is combined, and when the vehicle brand identification model trained by the attention-based convolutional recurrent neural network is utilized, the structural information of the vehicle brand and the attention-based convolutional neural network can be adaptively combined to perform brand identification on the vehicle image, and compared with the existing method for identifying the vehicle brand by extracting the features of the fixed area of the vehicle, the classification performance is higher.
Referring to fig. 3, fig. 3 is a flow chart of a vehicle brand identification method according to an embodiment of the present invention, and as shown in fig. 3, the method includes the following steps:
and step 3011, constructing a convolutional neural network for extracting feature information of the vehicle image.
And step 3012, constructing an attention-based recurrent neural network for identifying the vehicle brand of the vehicle image according to the characteristic information of the vehicle image output by the convolutional neural network according to the structural information of the vehicle brand.
And step 3013, taking the model composed of the convolutional neural network model and the attention-based recurrent neural network as the attention-based convolutional neural network model.
The above steps 3011 to 3013 are a detailed refinement of the step 101 shown in fig. 1, namely, a possible implementation of the step 101 shown in fig. 1.
The convolutional recurrent neural network model based on the attention mechanism constructed through the above steps 3011 to 3013 is shown in fig. 4.
And 302, training a convolution cyclic neural network based on an attention mechanism by using the vehicle image marked with the structural information of the vehicle brand to obtain a vehicle brand identification model.
3031, coding a vehicle image to be identified by using a convolutional neural network in a vehicle brand identification model to obtain characteristic information of the image to be identified;
and step 3032, decoding the characteristic information of the vehicle image to be identified by using the attention-based recurrent neural network in the vehicle brand identification model to obtain the vehicle brand information of the vehicle image to be identified.
The above steps 3031 to 3032 are specific refinements of the step 103 shown in fig. 1, that is, one possible implementation of the step 103 shown in fig. 1.
Based on the embodiment of the invention shown in fig. 3, in the invention, by constructing the convolutional recurrent neural network model based on the attention system, which is composed of the convolutional neural network and the recurrent neural network based on the attention system, the feature extraction of the vehicle image input to the convolutional recurrent neural network model based on the attention system can be performed by utilizing the feature that the convolutional neural network can perform the feature extraction of the image, and the feature information of the vehicle image output by the convolutional neural network can be analyzed to determine the vehicle brand of the vehicle image by utilizing the feature that the recurrent neural network based on the attention system can classify the image, because the convolutional neural network and the recurrent neural network based on the attention system are integrated in the same model, the end-to-end learning of the vehicle image can be realized, which not only reduces the cost of human intervention, and the method is also beneficial to the explicit learning of the relation between the input and the output in the neural network, and the network performance is improved.
Referring to fig. 5, fig. 5 is a flowchart of a brand identification method for three vehicles according to an embodiment of the present invention, as shown in fig. 5, the method includes the following steps:
and step 5011a, performing structure adjustment on the specified convolutional neural network.
In the embodiment of the present invention, the structural adjustment of the specified convolutional neural network includes: deleting the global pooling layer and the full-link layer of the specified convolutional neural network, and modifying the step size stride of the specified convolution of the specified convolutional layer in the specified convolutional neural network so as to keep the resolution ratio between the input image and the output image of the whole convolutional layer in the specified convolutional neural network within a preset ratio range (for example [6, 10 ]).
In the prior art, a convolutional neural network generally includes an input layer, a plurality of convolutional layers, (a global) pooling layer, a fully-connected layer, and an output layer, in the embodiment of the present invention, only the input layer and the convolutional layers of the convolutional neural network are reserved, and a step length (stride) of a specified convolution in a partial convolutional layer is adjusted, so that a resolution of a vehicle image after being processed by the entire convolutional layer (i.e., all convolutional layers of the convolutional neural network) does not decrease too much or too little.
In the embodiment of the present invention, the designated convolutional layer is M (for example, M is 2) convolutional layers in the designated convolutional neural network, which are ranked later; the specified convolution is a convolution that specifies a step size in the convolutional layer that is not 1. The method for modifying the step size of the specified convolution layer in the specified convolutional neural network specifically comprises the following steps: the step size of the given convolution in the next-ranked M convolutional layers of the given convolutional neural network is set to 1.
Taking the example that the specified convolutional neural network is a deep convolutional neural network mobilenetv1, the 4 th convolutional layer (i.e., conv4) and the 5 th convolutional layer (i.e., conv5) of mobilenetv1 can be regarded as specified convolutional layers, and the depth separable convolution with the step size of 2 in conv4 and conv5 can be regarded as specified convolutions, then the depth separable convolution with the step size of 2 in conv4 of mobilenetv1 can be modified to be the depth separable convolution with the step size of 1, and the depth separable convolution with the step size of 2 in conv5 of mobilenetv1 can be modified to be the depth separable convolution with the step size of 1.
And step 5011b, taking the specified convolutional neural network after the structure adjustment as a convolutional neural network for extracting the image features of the vehicle image.
The above steps 5011a to 5011b are specific refinements of step 3011 shown in fig. 3, that is, one possible implementation method of step 3011.
Step 5012, according to the structural information of the vehicle brand, constructing a cyclic neural network based on an attention mechanism and used for identifying the vehicle brand of the vehicle image according to the feature information of the vehicle image output by the convolutional neural network.
And step 5013, taking a model consisting of the convolutional neural network model and the cyclic neural network based on the attention mechanism as the convolutional neural network model based on the attention mechanism.
The above steps 5011a to 5013 are specific refinements of the step 101 shown in fig. 1, namely, a possible implementation method of the step 101 shown in fig. 1.
Step 502, using the vehicle image marked with the structural information of the vehicle brand, training a convolution cyclic neural network based on an attention mechanism to obtain a vehicle brand recognition model.
Step 5031, coding the vehicle image to be identified by using a convolutional neural network in the vehicle brand identification model to obtain the feature information of the image to be identified;
step 5032, decoding the feature information of the vehicle image to be identified by using a recurrent neural network based on an attention mechanism in the vehicle brand identification model to obtain the vehicle brand information of the vehicle image to be identified.
The above steps 5031 to 5032 are a specific refinement of the step 103 shown in fig. 1, that is, a possible implementation method of the step 103 shown in fig. 1.
Based on the embodiment of the invention shown in fig. 5, it can be seen that, in the invention, by performing structural adjustment on the convolutional neural network, feature extraction on the vehicle image can be realized by using the convolutional neural network mainly used for classification, and the extracted vehicle features are ensured to have a proper number of dimensions, so that the vehicle brand identification is performed by using the cyclic neural network based on the attention mechanism in the subsequent process.
Referring to fig. 6, fig. 6 is a flowchart of a four-vehicle brand identification method according to an embodiment of the present invention, and as shown in fig. 6, the method includes the following steps:
step 6011, a convolutional neural network for extracting feature information of the vehicle image is constructed.
Step 6012a, constructing an N + 2-layer LSTM network, and setting an attention mechanism module for each layer from the 2 nd layer to the N +2 th layer of the LSTM network;
step 6012b, setting the input information of the layer 1 LSTM network of the N +2 LSTM network to 0;
step 6012c, for each layer of LSTM networks from layer 2 to layer N +1, perform the following steps 6012c _1 and 6012c _ 2:
step 6012c _1, taking the output information of the previous layer of LSTM and the output information of the attention mechanism module set for the layer of LSTM network as the input information of the layer of LSTM network;
step 6012c _2, the classification information in the output information of the previous layer of LSTM and the output information of the convolutional neural network are used as input information of an attention mechanism module set for the layer of LSTM network, so that the attention mechanism module determines target brand information according to the classification information in the output information of the previous layer of LSTM network, and performs attention weighting on the target brand information.
The above steps 6012a to 6012c _2 are a detailed refinement of step 3012 shown in fig. 3, that is, a possible implementation method of step 3012 shown in fig. 3.
The attention mechanism-based recurrent neural network constructed through the above steps 6012a to 6012c _2 is shown in fig. 7.
As can be seen from the attention mechanism-based recurrent neural network shown in fig. 7, in the present invention, the multi-level brand information of the vehicle brand (for example, the popular passat 2019 and the toyota cameri 2018) is segmented by using the characteristics of the multi-level LSTM serialization output, and then the segmented brand information is respectively predicted according to the sequence, so that the structural information of the vehicle brand can be implicitly learned. Such as layer 2 LSTM output prediction ' populace ', layer 3 LSTM output prediction ' passat ', layer 4 LSTM output prediction ' 2019. For another example, the layer 2 LSTM output prediction 'toyota', the layer 3 LSTM output prediction 'cameri', and the layer 4 LSTM output prediction '2018'. When the layer 2 LSTM outputs and predicts the brand of the ' popular ' vehicle, the attention mechanism module arranged for the layer 3 LSTM performs attention weighting on the brand information of the next level of the ' popular ' so that the layer 3 LSTM predicts the brand information of ' Passat ', ' Tour ' and the like, and if the layer 3 LSTM outputs and predicts ' Passat ', the attention mechanism module arranged for the layer 4 LSTM performs attention weighting on the brand information of the next level of the ' Passat ' so that the layer 4 LSTM predicts the brand information of ' 2019 ', ' 2018 ', ' … … ', 2015 ' and the like.
In the embodiment of the invention, the classification information in the output information of the layer 1 LSTM network is classification starting information, and an attention mechanism module arranged aiming at the layer 2 LSTM network determines the brand information of a first level in the vehicle brand information as target brand information according to the classification starting information.
In the embodiment of the invention, the classification information in the output information of each layer of LSTM network from the layer 2 to the layer N +2 LSTM network is brand information, and an attention mechanism module arranged aiming at each layer of LSTM network from the layer 3 to the layer N +2 LSTM network determines the brand information of the next level of the brand information output by the previous layer of LSTM network as target brand information.
And step 6013, taking a model consisting of the convolutional neural network model and the cyclic neural network based on the attention mechanism as the convolutional neural network model based on the attention mechanism.
The above steps 6011 to 6013 are a detailed refinement of the step 101 shown in fig. 1, which is a possible implementation scheme of the step 101 shown in fig. 1. .
Step 602, using the vehicle image marked with the structural information of the vehicle brand, training a convolutional recurrent neural network based on an attention mechanism to obtain a vehicle brand identification model.
6031, coding a vehicle image to be identified by using a convolutional neural network in a vehicle brand identification model to obtain characteristic information of the image to be identified;
and 6032, decoding the characteristic information of the vehicle image to be identified by using a recurrent neural network based on an attention mechanism in the vehicle brand identification model to obtain the vehicle brand information of the vehicle image to be identified.
The above steps 6031 to 6032 are a detailed refinement of the step 103 shown in fig. 1, that is, a possible implementation method of the step 103 shown in fig. 1.
Based on the embodiment of the invention shown in fig. 6, it can be seen that in the invention, the structural information of the vehicle brand and the attention mechanism are combined to construct the attention mechanism-based recurrent neural network, so that the mining of the structural information of the vehicle brand can be realized, the association among the categories can be implicitly learned, and the improvement of the performance of the classifier is facilitated. In the invention, the attention mechanism is added in the multilayer cyclic neural network, so that the weighting processing of the vehicle characteristics can be adaptively realized, the regional characteristic extraction is implicitly realized, and in the learning process of the network, the structural information of the vehicle brand can provide a semi-supervision signal for the spatial attention mechanism, so that the two mechanisms can mutually promote in the end-to-end learning process.
The vehicle brand identification method provided by the invention is described in detail by using a plurality of embodiments, and the embodiment of the invention also provides a vehicle brand identification device, which is described in detail below with reference to fig. 8.
Referring to fig. 8, fig. 8 is a schematic structural view of a brand recognition device for a vehicle according to an embodiment of the present invention, and as shown in fig. 8, the device includes: a processor 801 and a non-transitory computer-readable storage medium 802 connected with the processor 801 through a bus;
the non-transitory computer readable storage medium 802 is used for storing a computer program that is executable on the processor 801, and the processor 801 executes the program to realize the following steps:
constructing a convolution cyclic neural network model based on an attention mechanism according to the structural information of the brand of the vehicle;
training a convolution cyclic neural network model based on an attention mechanism by using a vehicle image marked with structural information of a vehicle brand to obtain a vehicle brand identification model;
and identifying the vehicle image to be identified by utilizing the vehicle brand identification model, and determining the vehicle brand in the vehicle image to be identified.
In the arrangement shown in figure 8 of the drawings,
the processor 801, according to the structured information of the vehicle brand, constructs a convolutional recurrent neural network based on an attention mechanism, including:
constructing a convolutional neural network for extracting characteristic information of the vehicle image;
according to the structural information of the vehicle brand, an attention-based cyclic neural network for identifying the vehicle brand of the vehicle image according to the characteristic information of the vehicle image output by the convolutional neural network is constructed.
In the arrangement shown in figure 8 of the drawings,
the processor 801, when constructing the convolutional neural network for extracting feature information of the vehicle image, is configured to:
carrying out structure adjustment on the designated convolutional neural network, and taking the designated convolutional neural network after structure adjustment as a convolutional neural network for carrying out feature extraction on the vehicle image;
wherein, carry out the structural adjustment to appointed convolutional neural network, include: deleting the global pooling layer and the full-link layer of the designated convolutional neural network, and modifying the step size stride of the designated convolution of the designated convolutional layer of the designated convolutional neural network so as to keep the resolution ratio between the input image and the output image of the whole convolutional layer in the designated convolutional neural network within a preset ratio range.
In the arrangement shown in figure 8 of the drawings,
the appointed convolutional layer is M convolutional layers which are arranged in the appointed convolutional neural network and are ranked backwards; the specified convolution is a convolution in which the step size in the specified convolutional layer is not 1;
the processor 801, modifying the step size of the specified convolution of the specified convolutional layer in the specified convolutional neural network, is configured to: the step size of the given convolution in the next-ranked M convolutional layers of the given convolutional neural network is set to 1.
In the arrangement shown in figure 8 of the drawings,
the structured information of the vehicle brand comprises N levels of brand information which are classified into levels according to the subordination relationship, wherein the brand information of each level is the subordinate brand information of the previous level;
the processor 801, according to the structural information of the vehicle brand, constructs a cyclic neural network based on attention mechanism for identifying the vehicle brand of the vehicle image according to the feature information of the vehicle image output by the convolutional neural network, including:
constructing an N + 2-layer LSTM network, and setting an attention mechanism module aiming at each layer from the 2 nd layer to the N +2 th layer of LSTM network;
setting input information of a layer 1 LSTM network of the N +2 layer LSTM network as 0;
for each of the layer 2 to layer N +1 LSTM networks, performing the following operations:
taking the output information of the previous layer of LSTM and the output information of the attention mechanism module set for the layer of LSTM as the input information of the layer of LSTM;
and taking the classification information in the output information of the previous layer of LSTM and the output information of the convolutional neural network as the input information of an attention mechanism module arranged aiming at the LSTM network of the layer, so that the attention mechanism module determines target brand information according to the classification information in the output information of the previous layer of LSTM network and carries out attention weighting on the target brand information.
In the arrangement shown in figure 8 of the drawings,
the classification information in the output information of the layer 1 LSTM network is classification starting information, and an attention mechanism module arranged aiming at the layer 2 LSTM network determines the brand information of a first level in the vehicle brand information as target brand information according to the classification starting information;
the classification information in the output information of each layer of LSTM network in the layer 2 to the layer N +2 LSTM networks is brand information, and an attention mechanism module arranged aiming at each layer of LSTM network in the layer 3 to the layer N +2 LSTM networks determines the brand information of the next level of the brand information output by the previous layer of LSTM network as target brand information.
In the arrangement shown in figure 8 of the drawings,
the processor 801, recognizing the vehicle image to be recognized by using the vehicle brand recognition model, and determining the vehicle brand in the vehicle image to be recognized, includes:
coding a vehicle image to be identified by using a convolutional neural network in a vehicle brand identification model to obtain characteristic information of the image to be identified;
and decoding the characteristic information of the vehicle image to be identified by utilizing a recurrent neural network based on an attention mechanism in the vehicle brand identification model to obtain the vehicle brand information of the vehicle image to be identified.
In an embodiment of the invention, a non-transitory computer readable storage medium stores instructions that, when executed by a processor, cause the processor to perform the steps in the vehicle brand identification method as shown in fig. 1, 3, 5, 6.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.