CN112132140B - Vehicle brand identification method, device, equipment and medium based on artificial intelligence - Google Patents

Vehicle brand identification method, device, equipment and medium based on artificial intelligence Download PDF

Info

Publication number
CN112132140B
CN112132140B CN202011011585.9A CN202011011585A CN112132140B CN 112132140 B CN112132140 B CN 112132140B CN 202011011585 A CN202011011585 A CN 202011011585A CN 112132140 B CN112132140 B CN 112132140B
Authority
CN
China
Prior art keywords
coordinate
sample
vehicle
feature map
predicted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011011585.9A
Other languages
Chinese (zh)
Other versions
CN112132140A (en
Inventor
吴晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202011011585.9A priority Critical patent/CN112132140B/en
Publication of CN112132140A publication Critical patent/CN112132140A/en
Application granted granted Critical
Publication of CN112132140B publication Critical patent/CN112132140B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/625License plates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of artificial intelligence, and provides a vehicle brand identification method, a device, equipment and a medium based on artificial intelligence, wherein a multi-scale parallel structure under a cross-over-comparison condition is adopted, so that the problem of sample imbalance of simple and difficult scenes can be effectively relieved, the vehicle brand identification accuracy under the difficult scenes is obviously improved, the cross-over-comparison loss is increased, the position and the size of a detection frame can be more accurately fitted, and the error recall phenomenon of non-vehicles can be effectively reduced, so that the overall recall rate and the accuracy of vehicle brand identification are improved, meanwhile, a loss function can evaluate the loss of a model from multiple layers, the training effect of the model is better, and the automatic identification of the vehicle brand is realized. In addition, the invention can also be applied to intelligent traffic, thereby promoting the construction of intelligent cities. The invention also relates to a block chain technology, and the identification result can be stored in the block chain node.

Description

Vehicle brand identification method, device, equipment and medium based on artificial intelligence
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a vehicle brand identification method, device, equipment and medium based on artificial intelligence.
Background
With the increasing of vehicle violation behaviors, the rapid positioning and identification of vehicles at traffic checkpoints become a very important task in urban traffic management.
The traditional vehicle brand identification mainly adopts a YOLOv3 algorithm, but the YOLOv3 algorithm is only suitable for simple scenes such as sunny days, daytime, vehicle front sides and vehicle back sides, and for difficult scenes such as haze, rainy days, nights and vehicle side surfaces, the accuracy and recall rate of the YOLOv3 algorithm are relatively low, and a large promotion space exists.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, a device and a medium for recognizing a vehicle brand based on artificial intelligence, which can effectively alleviate the problem of unbalanced samples in simple and difficult scenes, significantly improve the accuracy of recognizing the vehicle brand in the difficult scenes, and can more accurately fit the position and size of a detection frame by adopting intersection ratio loss, and also effectively reduce the false recall phenomenon of non-vehicles, thereby improving the overall recall rate and accuracy of recognizing the vehicle brand.
An artificial intelligence-based vehicle brand identification method, comprising:
responding to the received image to be detected, and carrying out resize processing on the image to be detected to obtain a target image;
extracting the vehicle features of the target image by using a dark net53 network;
inputting the vehicle characteristics into a pre-trained vehicle brand recognition model, and outputting a first characteristic diagram, a second characteristic diagram and a third characteristic diagram, wherein the vehicle brand recognition model is a cascade network structure obtained by adopting a multiple cross-over ratio and cross-over ratio loss training YOLOv3 network;
acquiring a target anchor box of the vehicle license plate identification model;
for each feature map in the first feature map, the second feature map and the third feature map, recognizing each feature map by using the target anchor box, outputting a predicted anchor box coordinate corresponding to each feature map, a target score of each predicted anchor box coordinate and a predicted probability of a vehicle brand, and selecting a predicted anchor box coordinate with the highest target score from the predicted anchor box coordinates as a predicted coordinate of the vehicle;
and mapping the predicted coordinates of the vehicle to the image to be detected to obtain a mapping chart, and outputting the mapping chart and the predicted probability of the brand of the vehicle as an identification result.
According to a preferred embodiment of the present invention, the inputting the vehicle characteristics into a pre-trained identification model of the vehicle brand and outputting the first characteristic diagram, the second characteristic diagram and the third characteristic diagram includes:
performing a first convolution layer operation on the vehicle features to obtain first intermediate features, and performing a first joint convolution operation on the first intermediate features to obtain the first feature map, wherein the first convolution layer and the first joint convolution are obtained by adopting a first cross-over training;
performing an upsampling operation on the first intermediate feature to obtain a first feature;
performing a second convolution layer operation on the first feature to obtain a second intermediate feature, and performing a second combined convolution operation on the second intermediate feature to obtain a second feature map, wherein the second convolution layer and the second combined convolution are obtained by adopting a second cross-correlation training;
performing the upsampling operation on the second intermediate feature to obtain a second feature;
and performing a third convolution layer operation and a third convolution operation on the second feature to obtain the third feature map, wherein the third convolution layer and the third convolution volume are obtained by adopting a third cross-correlation training.
According to the preferred embodiment of the present invention, the vehicle brand identification method based on artificial intelligence further comprises:
when the sample is screened in a progressive manner, the first intersection ratio is less than the second intersection ratio, and the second intersection ratio is less than the third intersection ratio.
According to the preferred embodiment of the present invention, the vehicle brand identification method based on artificial intelligence further comprises:
acquiring a training sample;
inputting the training sample into a YOLOv3 network, and outputting a first sample feature map, a second sample feature map and a third sample feature map;
for each sample feature map in the first sample feature map, the second sample feature map and the third sample feature map, determining a sample prediction anchor box coordinate and a sample prediction probability corresponding to each sample feature map;
determining the actual anchor box coordinate and the actual sample probability of each sample characteristic diagram, and the actual central point coordinate and the actual width and height coordinate corresponding to each sample characteristic diagram;
calculating the intersection ratio loss of each sample characteristic diagram according to the sample prediction anchor box coordinate and the actual anchor box coordinate;
determining a prediction central point coordinate and a prediction width and height coordinate corresponding to each sample characteristic image according to the sample prediction anchor box coordinate corresponding to each sample characteristic image;
calculating the coordinate loss of the central point of each sample characteristic graph according to the coordinate of the predicted central point and the coordinate of the actual central point corresponding to each sample characteristic graph;
calculating the width and height coordinate loss of each sample characteristic diagram according to the predicted width and height coordinates and the actual width and height coordinates corresponding to each sample characteristic diagram;
calculating the category loss of each sample characteristic diagram according to the sample prediction probability and the sample actual probability corresponding to each sample characteristic diagram;
calculating the sum of the cross-over ratio loss, the center point coordinate loss, the width and height coordinate loss and the category loss as a loss function;
and when the value of the loss function is less than or equal to the configuration loss, stopping training to obtain the vehicle brand recognition model.
According to the preferred embodiment of the invention, the intersection ratio loss of each sample feature map is calculated according to the sample predicted anchor box coordinate and the actual anchor box coordinate by adopting the following formula:
Figure DEST_PATH_IMAGE001
wherein I is the intersection area of the sample prediction anchor box and the actual anchor box, U is the union area of the sample prediction anchor box and the actual anchor box,
Figure 590475DEST_PATH_IMAGE002
taking intersection ratio values of each sample characteristic graph;
calculating the coordinate loss of the center point of each sample characteristic graph according to the corresponding predicted center point coordinate and the actual center point coordinate of each sample characteristic graph by adopting the following formula:
Figure 5275DEST_PATH_IMAGE004
Figure DEST_PATH_IMAGE005
wherein the content of the first and second substances,
Figure 947824DEST_PATH_IMAGE006
the x value of the abscissa of the coordinate of the actual center point,
Figure DEST_PATH_IMAGE007
to predict the x-value of the abscissa of the center point coordinate,
Figure 448075DEST_PATH_IMAGE008
is the ordinate y value of the actual center point coordinate,
Figure DEST_PATH_IMAGE009
the ordinate y value of the coordinate of the central point is predicted;
calculating the width and height coordinate loss of each sample characteristic diagram according to the predicted width and height coordinates and the actual width and height coordinates corresponding to each sample characteristic diagram by adopting the following formula:
Figure DEST_PATH_IMAGE011
wherein the content of the first and second substances,
Figure 931009DEST_PATH_IMAGE012
for the width value of the actual width-height coordinate,
Figure DEST_PATH_IMAGE013
to predict the width value of the width-height coordinate,
Figure 465896DEST_PATH_IMAGE014
for the high value of the actual width-height coordinate,
Figure 100002_DEST_PATH_IMAGE015
to predict the height value of the width-height coordinate;
calculating the category loss of each sample characteristic graph according to the sample prediction probability and the sample actual probability corresponding to each sample characteristic graph by adopting the following formula:
Figure DEST_PATH_IMAGE017
wherein the content of the first and second substances,
Figure 641662DEST_PATH_IMAGE018
in order to be the actual probability of the sample,
Figure DEST_PATH_IMAGE019
probabilities are predicted for the samples.
According to a preferred embodiment of the present invention, the mapping the predicted coordinates of the vehicle onto the image to be detected to obtain a mapping map comprises:
determining an offset;
converting the predicted coordinate according to the offset to obtain a converted coordinate;
determining a first scale of the image to be detected and determining a second scale of the feature map corresponding to the prediction coordinate;
calculating a quotient of the first scale and the second scale as a coefficient;
and multiplying the coefficient and the prediction coordinate to obtain the corresponding position of the prediction coordinate on the image to be detected so as to generate the mapping chart.
According to the preferred embodiment of the present invention, the recognition result is stored in a block chain, and the method for recognizing the brand of the vehicle based on artificial intelligence further includes:
responding to a received detection instruction, and determining a terminal corresponding to the detection instruction;
acquiring the identification result from the block chain;
and sending the identification result to the terminal.
An artificial intelligence-based vehicle brand identification device, comprising:
the processing unit is used for responding to the received image to be detected and carrying out resize processing on the image to be detected to obtain a target image;
an extraction unit configured to extract a vehicle feature of the target image using a darknet53 network;
the input unit is used for inputting the vehicle characteristics into a pre-trained vehicle brand recognition model and outputting a first characteristic diagram, a second characteristic diagram and a third characteristic diagram, wherein the vehicle brand recognition model is a cascade network structure obtained by adopting a multiple cross-over ratio and cross-over ratio loss training YOLOv3 network;
the acquisition unit is used for acquiring a target anchor box of the vehicle brand identification model;
an identification unit configured to identify each of the first feature map, the second feature map, and the third feature map by using the target anchor box for each of the feature maps, output a predicted anchor box coordinate corresponding to each of the feature maps, a target score for each of the predicted anchor box coordinates, and a predicted probability of a brand of a vehicle, and select, from the predicted anchor box coordinates, a predicted anchor box coordinate having a highest target score as a predicted coordinate of the vehicle;
and the mapping unit is used for mapping the predicted coordinates of the vehicle to the image to be detected to obtain a mapping chart, and outputting the mapping chart and the predicted probability of the brand of the vehicle as an identification result.
An electronic device, the electronic device comprising:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the artificial intelligence based vehicle brand identification method.
A computer-readable storage medium having at least one instruction stored therein, the at least one instruction being executable by a processor in an electronic device to implement the artificial intelligence based vehicle brand identification method.
According to the technical scheme, the image to be detected can be subjected to resize processing in response to the received image to be detected to obtain a target image, the vehicle characteristics of the target image are extracted by utilizing a dark net53 network, the vehicle characteristics are input into a pre-trained vehicle brand recognition model, and a first characteristic diagram, a second characteristic diagram and a third characteristic diagram are output, wherein the vehicle brand recognition model is a cascade network structure obtained by adopting a multiple cross-to-parallel ratio and cross-to-parallel ratio loss training YOLOv3 network, and a multiscale parallel structure under the cross-to-parallel ratio is adopted, so that the problem of sample imbalance of simple and difficult scenes can be effectively relieved, the vehicle brand recognition accuracy under the difficult scenes is remarkably improved, the overall accuracy of vehicle brand recognition is improved, cross-to-ratio loss is increased on the basis of an original loss function of the YOLOv3 network, and the position and the size of a detection frame can be more accurately fitted, and the error recall phenomenon of non-vehicles can be effectively reduced, so that the overall recall rate and accuracy of the identification of the vehicle license plate are improved, meanwhile, the loss function can evaluate the loss of the model from a plurality of layers, further the training effect of the model is better, a target anchor box of the identification model of the vehicle license plate is obtained, for each feature map in the first feature map, the second feature map and the third feature map, the target anchor box is used for identifying on each feature map, a predicted anchor box coordinate corresponding to each feature map, a target score of each predicted anchor box coordinate and the prediction probability of the vehicle license plate are output, the predicted anchor box coordinate with the highest target score is selected from the predicted anchor box coordinates to be used as the predicted coordinate of the vehicle, the predicted coordinate of the vehicle is mapped to the image to be detected, and a mapping map is obtained, and outputting the mapping chart and the prediction probability of the vehicle brand as a recognition result.
Drawings
FIG. 1 is a flow chart of the preferred embodiment of the method for identifying the brand of a vehicle based on artificial intelligence.
FIG. 2 is a functional block diagram of a preferred embodiment of the vehicle brand identification device based on artificial intelligence according to the present invention.
FIG. 3 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention for implementing an artificial intelligence-based vehicle brand identification method.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flow chart of a preferred embodiment of the method for identifying a vehicle brand based on artificial intelligence according to the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The vehicle brand identification method based on artificial intelligence is applied to one or more electronic devices, wherein the electronic devices are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and hardware of the electronic devices includes but is not limited to a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device and the like.
The electronic device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive Internet Protocol Television (IPTV), an intelligent wearable device, and the like.
The electronic device may also include a network device and/or a user device. The network device includes, but is not limited to, a single network server, a server group consisting of a plurality of network servers, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network servers.
The Network where the electronic device is located includes, but is not limited to, the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
S10, responding to the received image to be detected, and performing resize processing on the image to be detected to obtain a target image.
Through resize processing, the image to be detected meets the requirement of the model for the size of the image, and automatic detection and identification can be conveniently carried out by utilizing the model subsequently.
For example: the image to be detected resize can be fixed size 512 x 512.
And S11, extracting the vehicle characteristics of the target image by using the darknet53 network.
Wherein the vehicle features include global and local features of the vehicle, such as: vehicle brand logo, vehicle type profile, vehicle color, etc.
S12, inputting the vehicle characteristics into a pre-trained vehicle brand recognition model, and outputting a first characteristic diagram, a second characteristic diagram and a third characteristic diagram, wherein the vehicle brand recognition model is a cascade network structure obtained by training a YOLOv3 network by adopting an Intersection over Unit (IoU) and an Intersection loss ratio.
The YOLOv3 network belongs to a traditional vehicle brand recognition algorithm, and the embodiment trains the vehicle brand recognition model on the basis of the YOLOv3 network.
In at least one embodiment of the present invention, the inputting the vehicle characteristics into a pre-trained vehicle brand recognition model, and the outputting the first characteristic diagram, the second characteristic diagram and the third characteristic diagram includes:
performing a first convolution layer operation on the vehicle features to obtain first intermediate features, and performing a first joint convolution operation on the first intermediate features to obtain the first feature map, wherein the first convolution layer and the first joint convolution are obtained by adopting a first cross-over training;
performing upsampling operation on the first intermediate characteristic to obtain a first characteristic;
performing a second convolution layer operation on the first feature to obtain a second intermediate feature, and performing a second combined convolution operation on the second intermediate feature to obtain a second feature map, wherein the second convolution layer and the second combined convolution are obtained by adopting a second cross-correlation training;
performing the upsampling operation on the second intermediate feature to obtain a second feature;
and performing a third convolution layer operation and a third convolution operation on the second feature to obtain the third feature map, wherein the third convolution layer and the third convolution volume are obtained by adopting a third cross-correlation training.
Wherein the convolutional layer operation comprises:
and inputting the corresponding features into the conv _ layer for processing.
Wherein the joint convolution operation comprises:
and inputting the corresponding characteristics to the conv _ block layer and the conv layer in sequence for processing.
It should be noted that the layer composition of the conv _ layer, the conv _ block, and the conv layer may be set according to actual requirements, and the present invention is not limited thereto.
For example: by acquiring historical data, the conv _ layer may include 5 layers of convolution, 1 layer of normalization layer and 1 layer of active layer, the conv _ block layer may include 1 layer of convolution, 1 layer of normalization layer and 1 layer of active layer, and the conv layer may include 1 layer of convolution.
The scale of the feature map can be gradually enlarged by performing upsampling operation (i.e., upsampling), so that multi-scale prediction is realized.
For example: when the scale of the first feature map is 10 × 512, the scale of the second feature map is 20 × 512, and the scale of the third feature map is 40 × 512.
In this embodiment, different intersection ratios can form positive and negative samples with different proportions, and the samples can be different during loss calculation, so that the generalization performance is better, and the trained model is not easy to over-fit, thereby improving the performance of the model.
Through the embodiment, the multi-scale parallel structure under the intersection ratio is adopted, the problem that samples of simple and difficult scenes are unbalanced can be effectively solved, the identification accuracy of the vehicle license plate under the difficult scenes is obviously improved, and the overall accuracy of the vehicle license plate identification is further improved.
In at least one embodiment of the present invention, the artificial intelligence based vehicle brand identification method further comprises:
when the sample is screened in a progressive manner, the first intersection ratio is less than the second intersection ratio, and the second intersection ratio is less than the third intersection ratio.
For example: the first cross-over ratio is 0.5, the second cross-over ratio is 0.6, and the third cross-over ratio is 0.7.
In the embodiment, positive and negative samples are divided in a progressive mode, so that the samples can be screened layer by layer, and the training precision of the model is further ensured.
Of course, in other embodiments, when the samples are screened in a parallel manner, the magnitude relationship among the first cross-over ratio, the second cross-over ratio and the third cross-over ratio is not limited.
In at least one embodiment of the present invention, the artificial intelligence based vehicle brand identification method further comprises:
obtaining a training sample;
inputting the training sample into a YOLOv3 network, and outputting a first sample feature map, a second sample feature map and a third sample feature map;
for each sample feature map in the first sample feature map, the second sample feature map and the third sample feature map, determining a sample prediction anchor box coordinate and a sample prediction probability corresponding to each sample feature map;
determining the actual anchor box coordinate and the actual sample probability of each sample characteristic diagram, and the actual central point coordinate and the actual width and height coordinate corresponding to each sample characteristic diagram;
calculating the intersection ratio loss of each sample characteristic diagram according to the sample prediction anchor box coordinate and the actual anchor box coordinate;
determining a prediction central point coordinate and a prediction width and height coordinate corresponding to each sample characteristic image according to the sample prediction anchor box coordinate corresponding to each sample characteristic image;
calculating the coordinate loss of the central point of each sample characteristic graph according to the coordinate of the predicted central point and the coordinate of the actual central point corresponding to each sample characteristic graph;
calculating the width and height coordinate loss of each sample characteristic diagram according to the predicted width and height coordinates and the actual width and height coordinates corresponding to each sample characteristic diagram;
calculating the category loss of each sample characteristic graph according to the sample prediction probability and the sample actual probability corresponding to each sample characteristic graph;
calculating the sum of the intersection ratio loss, the center point coordinate loss, the width and height coordinate loss and the category loss as a loss function;
and when the value of the loss function is less than or equal to the configuration loss, stopping training to obtain the vehicle brand recognition model.
Through the loss function that above-mentioned embodiment constructed, increased on the original loss function of YOLOv3 network and handed over and compared the loss, can more accurately fit the position and the size that detect the frame to can also effectively reduce the mistake recall phenomenon of non-vehicle, thereby improved car brand discernment's whole recall rate and rate of accuracy, simultaneously, this loss function can be from the loss of a plurality of aspect evaluation models, and then make the training effect of model better.
Specifically, the intersection-to-parallel ratio loss of each sample feature map is calculated according to the sample prediction anchor box coordinate and the actual anchor box coordinate by adopting the following formula:
Figure 456358DEST_PATH_IMAGE001
wherein I is the intersection area of the sample prediction anchor box and the actual anchor box, U is the union area of the sample prediction anchor box and the actual anchor box,
Figure 680666DEST_PATH_IMAGE020
taking intersection ratio values of each sample characteristic graph;
calculating the coordinate loss of the center point of each sample characteristic graph according to the corresponding predicted center point coordinate and the actual center point coordinate of each sample characteristic graph by adopting the following formula:
Figure DEST_PATH_IMAGE021
Figure 804480DEST_PATH_IMAGE005
wherein the content of the first and second substances,
Figure 88831DEST_PATH_IMAGE006
the x value of the abscissa of the coordinate of the actual center point,
Figure 501357DEST_PATH_IMAGE007
to predict the x-value of the abscissa of the center point coordinate,
Figure 591673DEST_PATH_IMAGE008
is the ordinate y value of the actual center point coordinate,
Figure 773256DEST_PATH_IMAGE009
the ordinate y value of the coordinate of the predicted central point is obtained.
Calculating the width and height coordinate loss of each sample characteristic diagram according to the predicted width and height coordinates and the actual width and height coordinates corresponding to each sample characteristic diagram by adopting the following formula:
Figure DEST_PATH_IMAGE023
wherein the content of the first and second substances,
Figure 25246DEST_PATH_IMAGE012
for the width value of the actual width-height coordinate,
Figure 925068DEST_PATH_IMAGE013
to predict the width value of the width-height coordinate,
Figure 491179DEST_PATH_IMAGE014
for the high value of the actual width-height coordinate,
Figure 855164DEST_PATH_IMAGE015
to predict the height value of the width-height coordinate.
Calculating the category loss of each sample characteristic graph according to the sample prediction probability and the sample actual probability corresponding to each sample characteristic graph by adopting the following formula:
Figure 215738DEST_PATH_IMAGE024
wherein the content of the first and second substances,
Figure 602857DEST_PATH_IMAGE018
in order to be the actual probability of the sample,
Figure 34976DEST_PATH_IMAGE019
probabilities are predicted for the samples.
And S13, acquiring a target anchor box of the vehicle brand identification model.
And the number of the target anchor boxes is a multiple of the at least one scale, so as to ensure that the target feature map of each scale can obtain the same target anchor boxes. For example: 9 pieces of the feed.
And S14, recognizing each of the first feature map, the second feature map, and the third feature map by using the target anchor box, outputting a predicted anchor box coordinate corresponding to each feature map, a target score of each predicted anchor box coordinate, and a predicted probability of the vehicle brand, and selecting a predicted anchor box coordinate having a highest target score from the predicted anchor box coordinates as a predicted coordinate of the vehicle.
Through the embodiment, the predicted anchor box coordinate with the highest score can be acquired from the predicted anchor box coordinates corresponding to each output feature map as the predicted coordinate of the vehicle, and the score is used for further screening, so that the recognition accuracy is improved again.
And S15, mapping the predicted coordinates of the vehicle to the image to be detected to obtain a mapping chart, and outputting the mapping chart and the predicted probability of the brand of the vehicle as an identification result.
For example: the predicted probability of the brand of the vehicle may be: brand X0.96, representing a 96% probability of the vehicle being said brand X.
In this embodiment, the mapping the predicted coordinates of the vehicle onto the image to be detected to obtain a mapping map includes:
determining an offset;
converting the predicted coordinate according to the offset to obtain a converted coordinate;
determining a first scale of the image to be detected and determining a second scale of the feature map corresponding to the prediction coordinate;
calculating a quotient of the first scale and the second scale as a coefficient;
and multiplying the coefficient and the prediction coordinate to obtain the corresponding position of the prediction coordinate on the image to be detected so as to generate the mapping chart.
Through the embodiment, the recognized vehicle is mapped on the original image, so that the user can conveniently view the recognition result.
Further, the identification result is stored on a block chain, and the vehicle brand identification method based on artificial intelligence further comprises the following steps:
responding to a received detection instruction, and determining a terminal corresponding to the detection instruction;
acquiring the identification result from the block chain;
and sending the identification result to the terminal.
After the recognition result is sent to the terminal, the recognition result can be used for assisting in positioning and detecting the vehicle.
According to the technical scheme, the image to be detected can be subjected to resize processing in response to the received image to be detected to obtain a target image, the vehicle characteristics of the target image are extracted by utilizing a dark net53 network, the vehicle characteristics are input into a pre-trained vehicle brand recognition model, and a first characteristic diagram, a second characteristic diagram and a third characteristic diagram are output, wherein the vehicle brand recognition model is a cascade network structure obtained by adopting a multiple cross-to-parallel ratio and cross-to-parallel ratio loss training YOLOv3 network, and a multiscale parallel structure under the cross-to-parallel ratio is adopted, so that the problem of sample imbalance of simple and difficult scenes can be effectively relieved, the vehicle brand recognition accuracy under the difficult scenes is remarkably improved, the overall accuracy of vehicle brand recognition is improved, cross-to-ratio loss is increased on the basis of an original loss function of the YOLOv3 network, and the position and the size of a detection frame can be more accurately fitted, and the error recall phenomenon of non-vehicles can be effectively reduced, so that the overall recall rate and accuracy of the identification of the vehicle license plate are improved, meanwhile, the loss function can evaluate the loss of the model from a plurality of layers, further the training effect of the model is better, a target anchor box of the identification model of the vehicle license plate is obtained, for each feature map in the first feature map, the second feature map and the third feature map, the target anchor box is used for identifying on each feature map, a predicted anchor box coordinate corresponding to each feature map, a target score of each predicted anchor box coordinate and the prediction probability of the vehicle license plate are output, the predicted anchor box coordinate with the highest target score is selected from the predicted anchor box coordinates to be used as the predicted coordinate of the vehicle, the predicted coordinate of the vehicle is mapped to the image to be detected, and a mapping map is obtained, and outputting the mapping chart and the prediction probability of the vehicle brand as a recognition result.
Fig. 2 is a functional block diagram of a preferred embodiment of the vehicle brand recognition device based on artificial intelligence according to the present invention. The artificial intelligence based vehicle brand recognition apparatus 11 includes a processing unit 110, an extraction unit 111, an input unit 112, an acquisition unit 113, a recognition unit 114, and a mapping unit 115. The module/unit referred to in the present invention refers to a series of computer program segments that can be executed by the processor 13 and that can perform a fixed function, and that are stored in the memory 12. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
In response to the received image to be detected, the processing unit 110 performs resize processing on the image to be detected to obtain a target image.
Through resize processing, the image to be detected meets the requirement of the model for the size of the image, and automatic detection and identification can be conveniently carried out by utilizing the model subsequently.
For example: the image to be detected resize can be fixed size 512 x 512.
The extraction unit 111 extracts the vehicle feature of the target image using the darknet53 network.
Wherein the vehicle features include global and local features of the vehicle, such as: vehicle brand logo, vehicle type profile, vehicle color, etc.
The input unit 112 inputs the vehicle features into a pre-trained vehicle brand recognition model, and outputs a first feature map, a second feature map, and a third feature map, where the vehicle brand recognition model is a cascade network structure obtained by training a YOLOv3 network using an Intersection over unity (IoU) and an Intersection loss.
The YOLOv3 network belongs to a traditional vehicle brand recognition algorithm, and the embodiment trains the vehicle brand recognition model on the basis of the YOLOv3 network.
In at least one embodiment of the present invention, the inputting unit 112 inputs the vehicle feature into a pre-trained vehicle brand recognition model, and outputting the first feature map, the second feature map, and the third feature map includes:
performing a first convolution layer operation on the vehicle features to obtain first intermediate features, and performing a first joint convolution operation on the first intermediate features to obtain the first feature map, wherein the first convolution layer and the first joint convolution are obtained by adopting a first cross-over training;
performing an upsampling operation on the first intermediate feature to obtain a first feature;
performing a second convolution layer operation on the first feature to obtain a second intermediate feature, and performing a second combined convolution operation on the second intermediate feature to obtain a second feature map, wherein the second convolution layer and the second combined convolution are obtained by adopting a second cross-correlation training;
performing the upsampling operation on the second intermediate feature to obtain a second feature;
and performing a third convolution layer operation and a third convolution operation on the second feature to obtain the third feature map, wherein the third convolution layer and the third convolution volume are obtained by adopting a third cross-correlation training.
Wherein the convolutional layer operation comprises:
and inputting the corresponding features into the conv _ layer for processing.
Wherein the joint convolution operation comprises:
and inputting the corresponding characteristics to the conv _ block layer and the conv layer in sequence for processing.
It should be noted that the layer composition of the conv _ layer, the conv _ block, and the conv layer may be set according to actual requirements, and the present invention is not limited thereto.
For example: by obtaining the historical data, the conv _ layer may include 5 layers of convolution, 1 layer of normalization layer and 1 layer of activation layer, the conv _ block layer may include 1 layer of convolution, 1 layer of normalization layer and 1 layer of activation layer, and the conv layer may include 1 layer of convolution.
The scale of the feature map can be gradually enlarged by performing upsampling operation (i.e., upsampling), so that multi-scale prediction is realized.
For example: when the scale of the first feature map is 10 × 512, the scale of the second feature map is 20 × 512, and the scale of the third feature map is 40 × 512.
In this embodiment, different intersection ratios can form positive and negative samples with different proportions, and the samples can be different during loss calculation, so that the generalization performance is better, and the trained model is not easy to over-fit, thereby improving the performance of the model.
Through the embodiment, the multi-scale parallel structure under the intersection ratio is adopted, the problem that samples of simple and difficult scenes are unbalanced can be effectively solved, the identification accuracy of the vehicle license plate under the difficult scenes is obviously improved, and the overall accuracy of the vehicle license plate identification is further improved.
In at least one embodiment of the present invention, when the sample is screened in a progressive manner, the first cross-over ratio is less than the second cross-over ratio, and the second cross-over ratio is less than the third cross-over ratio.
For example: the first cross-over ratio is 0.5, the second cross-over ratio is 0.6, and the third cross-over ratio is 0.7.
In the embodiment, positive and negative samples are divided in a progressive mode, so that the samples can be screened layer by layer, and the training precision of the model is further ensured.
Of course, in other embodiments, when the samples are screened in a parallel manner, the magnitude relationship among the first cross-over ratio, the second cross-over ratio and the third cross-over ratio is not limited.
In at least one embodiment of the present invention, training samples are obtained;
inputting the training sample into a YOLOv3 network, and outputting a first sample feature map, a second sample feature map and a third sample feature map;
for each sample feature map in the first sample feature map, the second sample feature map and the third sample feature map, determining a sample prediction anchor box coordinate and a sample prediction probability corresponding to each sample feature map;
determining the actual anchor box coordinate and the actual sample probability of each sample characteristic diagram, and the actual central point coordinate and the actual width and height coordinate corresponding to each sample characteristic diagram;
calculating the intersection ratio loss of each sample characteristic diagram according to the sample prediction anchor box coordinate and the actual anchor box coordinate;
determining a prediction central point coordinate and a prediction width and height coordinate corresponding to each sample characteristic image according to the sample prediction anchor box coordinate corresponding to each sample characteristic image;
calculating the coordinate loss of the central point of each sample characteristic graph according to the coordinate of the predicted central point and the coordinate of the actual central point corresponding to each sample characteristic graph;
calculating the width and height coordinate loss of each sample characteristic diagram according to the predicted width and height coordinates and the actual width and height coordinates corresponding to each sample characteristic diagram;
calculating the category loss of each sample characteristic graph according to the sample prediction probability and the sample actual probability corresponding to each sample characteristic graph;
calculating the sum of the intersection ratio loss, the center point coordinate loss, the width and height coordinate loss and the category loss as a loss function;
and when the value of the loss function is less than or equal to the configuration loss, stopping training to obtain the vehicle brand recognition model.
Through the loss function that above-mentioned embodiment constructed, increased on the original loss function of YOLOv3 network and handed over and compared the loss, can more accurately fit the position and the size that detect the frame to can also effectively reduce the mistake recall phenomenon of non-vehicle, thereby improved car brand discernment's whole recall rate and rate of accuracy, simultaneously, this loss function can be from the loss of a plurality of aspect evaluation models, and then make the training effect of model better.
Specifically, the intersection-to-parallel ratio loss of each sample feature map is calculated according to the sample prediction anchor box coordinate and the actual anchor box coordinate by adopting the following formula:
Figure 925571DEST_PATH_IMAGE001
wherein I is the intersection area of the sample prediction anchor box and the actual anchor box, U is the union area of the sample prediction anchor box and the actual anchor box,
Figure 784943DEST_PATH_IMAGE020
taking intersection ratio values of each sample characteristic graph;
calculating the coordinate loss of the central point of each sample characteristic graph according to the predicted central point coordinate and the actual central point coordinate corresponding to each sample characteristic graph by adopting the following formula:
Figure DEST_PATH_IMAGE025
Figure 393779DEST_PATH_IMAGE005
wherein the content of the first and second substances,
Figure 629588DEST_PATH_IMAGE006
the x value of the abscissa of the coordinate of the actual center point,
Figure 640269DEST_PATH_IMAGE007
to predict the x-value of the abscissa of the center point coordinate,
Figure 673472DEST_PATH_IMAGE008
is the ordinate y value of the actual center point coordinate,
Figure 769604DEST_PATH_IMAGE009
the ordinate y value of the coordinate of the predicted central point is obtained.
Calculating the width and height coordinate loss of each sample characteristic diagram according to the predicted width and height coordinates and the actual width and height coordinates corresponding to each sample characteristic diagram by adopting the following formula:
Figure 543525DEST_PATH_IMAGE026
wherein the content of the first and second substances,
Figure 408713DEST_PATH_IMAGE012
for the width value of the actual width-height coordinate,
Figure 609887DEST_PATH_IMAGE013
to predict the width value of the width-height coordinate,
Figure 193315DEST_PATH_IMAGE014
for the high value of the actual width-height coordinate,
Figure 443031DEST_PATH_IMAGE015
to predict the height value of the width-height coordinate.
Calculating the category loss of each sample characteristic graph according to the sample prediction probability and the sample actual probability corresponding to each sample characteristic graph by adopting the following formula:
Figure DEST_PATH_IMAGE027
wherein the content of the first and second substances,
Figure 490621DEST_PATH_IMAGE018
in order to be the actual probability of the sample,
Figure 862697DEST_PATH_IMAGE019
probabilities are predicted for the samples.
The acquisition unit 113 acquires a target anchor box of the vehicle brand recognition model.
And the number of the target anchor boxes is a multiple of the at least one scale, so as to ensure that the target feature map of each scale can obtain the same target anchor boxes. For example: 9 pieces of the feed.
For each of the first feature map, the second feature map, and the third feature map, recognition section 114 recognizes each feature map using the target anchor box, outputs a predicted anchor box coordinate corresponding to each feature map, a target score of each predicted anchor box coordinate, and a predicted probability of a brand of vehicle, and selects a predicted anchor box coordinate having a highest target score from the predicted anchor box coordinates as a predicted coordinate of the vehicle.
Through the embodiment, the predicted anchor box coordinate with the highest score can be obtained from the predicted anchor box coordinates corresponding to each output characteristic diagram to serve as the predicted coordinate of the vehicle, and the score is used for further screening, so that the recognition accuracy is improved again.
The mapping unit 115 maps the predicted coordinates of the vehicle to the image to be detected to obtain a map, and outputs the map and the predicted probability of the brand of the vehicle as an identification result.
For example: the predicted probability of the brand of the vehicle may be: brand X0.96, representing a 96% probability of the vehicle being said brand X.
In this embodiment, the mapping unit 115 maps the predicted coordinates of the vehicle onto the image to be detected, and obtaining a mapping map includes:
determining an offset;
converting the predicted coordinate according to the offset to obtain a converted coordinate;
determining a first scale of the image to be detected and determining a second scale of the feature map corresponding to the prediction coordinate;
calculating a quotient of the first scale and the second scale as a coefficient;
and multiplying the coefficient by the prediction coordinate to obtain the corresponding position of the prediction coordinate on the image to be detected so as to generate the mapping chart.
Through the embodiment, the recognized vehicle is mapped on the original image, so that the user can conveniently view the recognition result.
Further, storing the identification result on a block chain, and responding to a received detection instruction to determine a terminal corresponding to the detection instruction;
acquiring the identification result from the block chain;
and sending the identification result to the terminal.
After the recognition result is sent to the terminal, the recognition result can be used for assisting in positioning and detecting the vehicle.
According to the technical scheme, the image to be detected can be subjected to resize processing in response to the received image to be detected to obtain a target image, the vehicle characteristics of the target image are extracted by utilizing a dark net53 network, the vehicle characteristics are input into a pre-trained vehicle brand recognition model, and a first characteristic diagram, a second characteristic diagram and a third characteristic diagram are output, wherein the vehicle brand recognition model is a cascade network structure obtained by adopting a multiple cross-to-parallel ratio and cross-to-parallel ratio loss training YOLOv3 network, and a multiscale parallel structure under the cross-to-parallel ratio is adopted, so that the problem of sample imbalance of simple and difficult scenes can be effectively relieved, the vehicle brand recognition accuracy under the difficult scenes is remarkably improved, the overall accuracy of vehicle brand recognition is improved, cross-to-ratio loss is increased on the basis of an original loss function of the YOLOv3 network, and the position and the size of a detection frame can be more accurately fitted, and the error recall phenomenon of non-vehicles can be effectively reduced, so that the overall recall rate and accuracy of the identification of the vehicle license plate are improved, meanwhile, the loss function can evaluate the loss of the model from a plurality of layers, further the training effect of the model is better, a target anchor box of the identification model of the vehicle license plate is obtained, for each feature map in the first feature map, the second feature map and the third feature map, the target anchor box is used for identifying on each feature map, a predicted anchor box coordinate corresponding to each feature map, a target score of each predicted anchor box coordinate and the prediction probability of the vehicle license plate are output, the predicted anchor box coordinate with the highest target score is selected from the predicted anchor box coordinates to be used as the predicted coordinate of the vehicle, the predicted coordinate of the vehicle is mapped to the image to be detected, and a mapping map is obtained, and outputting the mapping chart and the prediction probability of the vehicle brand as a recognition result.
Fig. 3 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention for implementing an artificial intelligence-based vehicle brand identification method.
The electronic device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program, such as an artificial intelligence based brand identification program, stored in the memory 12 and executable on the processor 13.
It will be understood by those skilled in the art that the schematic diagram is merely an example of the electronic device 1, and does not constitute a limitation to the electronic device 1, the electronic device 1 may have a bus-type structure or a star-type structure, the electronic device 1 may further include more or less hardware or software than those shown in the figures, or different component arrangements, for example, the electronic device 1 may further include an input and output device, a network access device, and the like.
It should be noted that the electronic device 1 is only an example, and other existing or future electronic products, such as those that can be adapted to the present invention, should also be included in the scope of the present invention, and are included herein by reference.
The memory 12 includes at least one type of readable storage medium, which includes flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 12 may in some embodiments be an internal storage unit of the electronic device 1, for example a removable hard disk of the electronic device 1. The memory 12 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the electronic device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 12 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of an artificial intelligence-based vehicle brand identification program, etc., but also to temporarily store data that has been output or is to be output.
The processor 13 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 13 is a Control Unit (Control Unit) of the electronic device 1, connects various components of the electronic device 1 by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (for example, executing a car brand identification program based on artificial intelligence, etc.) stored in the memory 12 and calling data stored in the memory 12.
The processor 13 executes an operating system of the electronic device 1 and various installed application programs. The processor 13 executes the application program to implement the steps of the various artificial intelligence based vehicle brand identification method embodiments described above, such as the steps shown in fig. 1.
Illustratively, the computer program may be divided into one or more modules/units, which are stored in the memory 12 and executed by the processor 13 to accomplish the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a processing unit 110, an extraction unit 111, an input unit 112, an acquisition unit 113, a recognition unit 114, a mapping unit 115.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a computer device, or a network device) or a processor (processor) to execute the portions of the artificial intelligence based vehicle brand identification method according to the embodiments of the present invention.
The integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus. The bus is arranged to enable connection communication between the memory 12 and at least one processor 13 or the like.
Although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 13 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device 1 and another electronic device.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
Fig. 3 only shows the electronic device 1 with components 12-13, and it will be understood by a person skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
Referring to fig. 1, the memory 12 of the electronic device 1 stores a plurality of instructions to implement an artificial intelligence based vehicle brand identification method, and the processor 13 executes the plurality of instructions to implement:
responding to the received image to be detected, and carrying out resize processing on the image to be detected to obtain a target image;
extracting the vehicle features of the target image by using a dark net53 network;
inputting the vehicle characteristics into a pre-trained vehicle brand recognition model, and outputting a first characteristic diagram, a second characteristic diagram and a third characteristic diagram, wherein the vehicle brand recognition model is a cascade network structure obtained by adopting a multiple cross-over ratio and cross-over ratio loss training YOLOv3 network;
acquiring a target anchor box of the vehicle license plate identification model;
for each feature map in the first feature map, the second feature map and the third feature map, recognizing each feature map by using the target anchor box, outputting a predicted anchor box coordinate corresponding to each feature map, a target score of each predicted anchor box coordinate and a predicted probability of a vehicle brand, and selecting a predicted anchor box coordinate with the highest target score from the predicted anchor box coordinates as a predicted coordinate of the vehicle;
and mapping the predicted coordinates of the vehicle to the image to be detected to obtain a mapping chart, and outputting the mapping chart and the predicted probability of the brand of the vehicle as an identification result.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the instruction, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (9)

1. The vehicle brand identification method based on artificial intelligence is characterized by comprising the following steps of:
responding to the received image to be detected, and carrying out resize processing on the image to be detected to obtain a target image;
extracting the vehicle features of the target image by using a dark net53 network;
inputting the vehicle characteristics into a pre-trained vehicle brand recognition model, and outputting a first characteristic diagram, a second characteristic diagram and a third characteristic diagram, wherein the steps of the method comprise:
performing a first convolution layer operation on the vehicle features to obtain first intermediate features, and performing a first joint convolution operation on the first intermediate features to obtain the first feature map, wherein the first convolution layer and the first joint convolution are obtained by adopting a first cross-over training;
performing an upsampling operation on the first intermediate feature to obtain a first feature;
performing a second convolution layer operation on the first feature to obtain a second intermediate feature, and performing a second combined convolution operation on the second intermediate feature to obtain the second feature map, wherein the second convolution layer and the second combined convolution are obtained by adopting a second cross-correlation training;
performing the upsampling operation on the second intermediate feature to obtain a second feature;
performing a third convolution layer operation and a third convolution operation on the second feature to obtain a third feature map, wherein the third convolution layer and the third convolution volume are obtained by adopting a third cross-correlation training;
the vehicle brand identification model is a cascade network structure obtained by training a YOLOv3 network by adopting a multiple cross-over ratio and a cross-over ratio loss;
acquiring a target anchor box of the vehicle license plate identification model;
for each of the first feature map, the second feature map and the third feature map, identifying each feature map by using the target anchor box, outputting a predicted anchor box coordinate corresponding to each feature map, a target score of each predicted anchor box coordinate and a predicted probability of a vehicle brand, and selecting a predicted anchor box coordinate with the highest target score from the predicted anchor box coordinates as a predicted coordinate of the vehicle;
and mapping the predicted coordinates of the vehicle to the image to be detected to obtain a mapping chart, and outputting the mapping chart and the predicted probability of the brand of the vehicle as an identification result.
2. The artificial intelligence based vehicle brand identification method of claim 1, further comprising:
when the sample is screened in a progressive manner, the first intersection ratio is less than the second intersection ratio, and the second intersection ratio is less than the third intersection ratio.
3. The artificial intelligence based vehicle brand identification method of claim 1, further comprising:
obtaining a training sample;
inputting the training sample into a YOLOv3 network, and outputting a first sample feature map, a second sample feature map and a third sample feature map;
for each sample feature map in the first sample feature map, the second sample feature map and the third sample feature map, determining a sample prediction anchor box coordinate and a sample prediction probability corresponding to each sample feature map;
determining the actual anchor box coordinate and the actual sample probability of each sample characteristic diagram, and the actual central point coordinate and the actual width and height coordinate corresponding to each sample characteristic diagram;
calculating the intersection ratio loss of each sample characteristic diagram according to the sample prediction anchor box coordinate and the actual anchor box coordinate;
determining a prediction central point coordinate and a prediction width and height coordinate corresponding to each sample characteristic image according to the sample prediction anchor box coordinate corresponding to each sample characteristic image;
calculating the coordinate loss of the central point of each sample characteristic graph according to the coordinate of the predicted central point and the coordinate of the actual central point corresponding to each sample characteristic graph;
calculating the width and height coordinate loss of each sample characteristic diagram according to the predicted width and height coordinates and the actual width and height coordinates corresponding to each sample characteristic diagram;
calculating the category loss of each sample characteristic graph according to the sample prediction probability and the sample actual probability corresponding to each sample characteristic graph;
calculating the sum of the intersection ratio loss, the center point coordinate loss, the width and height coordinate loss and the category loss as a loss function;
and when the value of the loss function is less than or equal to the configuration loss, stopping training to obtain the vehicle brand recognition model.
4. The artificial intelligence based vehicle brand identification method according to claim 3, wherein the intersection-to-average loss of each sample feature map is calculated from the sample predicted anchor box coordinates and the actual anchor box coordinates by using the following formula:
Figure 111778DEST_PATH_IMAGE001
wherein I is the intersection area of the sample prediction anchor box and the actual anchor box, U is the union area of the sample prediction anchor box and the actual anchor box,
Figure 928425DEST_PATH_IMAGE002
taking intersection ratio values of each sample characteristic graph;
calculating the coordinate loss of the center point of each sample characteristic graph according to the corresponding predicted center point coordinate and the actual center point coordinate of each sample characteristic graph by adopting the following formula:
Figure DEST_PATH_IMAGE003
Figure 665437DEST_PATH_IMAGE004
wherein the content of the first and second substances,
Figure 516718DEST_PATH_IMAGE005
the value of x is the abscissa of the coordinate of the actual center point,
Figure 946562DEST_PATH_IMAGE006
to predict the x-value of the abscissa of the center point coordinate,
Figure 188188DEST_PATH_IMAGE007
is the ordinate y value of the actual center point coordinate,
Figure 260049DEST_PATH_IMAGE008
the ordinate y value of the coordinate of the central point is predicted;
calculating the width and height coordinate loss of each sample feature map according to the predicted width and height coordinates and the actual width and height coordinates corresponding to each sample feature map by adopting the following formula:
Figure 903520DEST_PATH_IMAGE009
wherein the content of the first and second substances,
Figure 566582DEST_PATH_IMAGE010
is the width value of the actual width-height coordinate,
Figure 295504DEST_PATH_IMAGE011
to predict the width value of the width-height coordinate,
Figure 374318DEST_PATH_IMAGE012
for the high value of the actual width-height coordinate,
Figure 669033DEST_PATH_IMAGE013
to predict the height value of the width-height coordinate;
calculating the category loss of each sample characteristic graph according to the sample prediction probability and the sample actual probability corresponding to each sample characteristic graph by adopting the following formula:
Figure 440680DEST_PATH_IMAGE014
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE015
in order to be the actual probability of the sample,
Figure 453636DEST_PATH_IMAGE016
probabilities are predicted for the samples.
5. The artificial intelligence based brand recognition method for vehicles according to claim 1, wherein said mapping the predicted coordinates of the vehicle onto the image to be detected to obtain a mapping comprises:
determining an offset;
converting the predicted coordinate according to the offset to obtain a converted coordinate;
determining a first scale of the image to be detected and determining a second scale of the feature map corresponding to the prediction coordinate;
calculating a quotient of the first scale and the second scale as a coefficient;
and multiplying the coefficient and the prediction coordinate to obtain the corresponding position of the prediction coordinate on the image to be detected so as to generate the mapping chart.
6. The artificial intelligence based vehicle brand identification method of claim 1, wherein the identification result is stored on a blockchain, the artificial intelligence based vehicle brand identification method further comprising:
responding to a received detection instruction, and determining a terminal corresponding to the detection instruction;
acquiring the identification result from the block chain;
and sending the identification result to the terminal.
7. The utility model provides a car brand recognition device based on artificial intelligence which characterized in that, car brand recognition device based on artificial intelligence includes:
the processing unit is used for responding to the received image to be detected and carrying out resize processing on the image to be detected to obtain a target image;
an extraction unit configured to extract a vehicle feature of the target image using a darknet53 network;
an input unit, configured to input the vehicle feature to a pre-trained vehicle brand recognition model, and output a first feature map, a second feature map, and a third feature map, including: performing a first convolution layer operation on the vehicle features to obtain first intermediate features, and performing a first joint convolution operation on the first intermediate features to obtain the first feature map, wherein the first convolution layer and the first joint convolution are obtained by adopting a first cross-over training; performing an upsampling operation on the first intermediate feature to obtain a first feature; performing a second convolution layer operation on the first feature to obtain a second intermediate feature, and performing a second combined convolution operation on the second intermediate feature to obtain a second feature map, wherein the second convolution layer and the second combined convolution are obtained by adopting a second cross-correlation training; performing the upsampling operation on the second intermediate feature to obtain a second feature; performing a third convolution layer operation and a third convolution product operation on the second feature to obtain the third feature map, wherein the third convolution layer and the third convolution product are obtained by adopting a third cross-correlation training; the vehicle brand identification model is a cascade network structure obtained by training a YOLOv3 network by adopting a multiple cross-over ratio and a cross-over ratio loss;
the acquisition unit is used for acquiring a target anchor box of the vehicle brand identification model;
a recognition unit configured to recognize each of the first feature map, the second feature map, and the third feature map on each of the feature maps by using the target anchor box, output a predicted anchor box coordinate corresponding to each of the feature maps, a target score of each of the predicted anchor box coordinates, and a predicted probability of a brand of a vehicle, and select, as a predicted coordinate of the vehicle, a predicted anchor box coordinate having a highest target score from among the predicted anchor box coordinates;
and the mapping unit is used for mapping the predicted coordinates of the vehicle to the image to be detected to obtain a mapping chart, and outputting the mapping chart and the predicted probability of the brand of the vehicle as an identification result.
8. An electronic device, characterized in that the electronic device comprises:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the artificial intelligence based vehicle brand identification method of any one of claims 1 to 6.
9. A computer-readable storage medium characterized by: the computer-readable storage medium has stored therein at least one instruction that is executable by a processor in an electronic device to implement the artificial intelligence based brand identification method of a vehicle as recited in any one of claims 1 to 6.
CN202011011585.9A 2020-09-23 2020-09-23 Vehicle brand identification method, device, equipment and medium based on artificial intelligence Active CN112132140B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011011585.9A CN112132140B (en) 2020-09-23 2020-09-23 Vehicle brand identification method, device, equipment and medium based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011011585.9A CN112132140B (en) 2020-09-23 2020-09-23 Vehicle brand identification method, device, equipment and medium based on artificial intelligence

Publications (2)

Publication Number Publication Date
CN112132140A CN112132140A (en) 2020-12-25
CN112132140B true CN112132140B (en) 2022-08-12

Family

ID=73839359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011011585.9A Active CN112132140B (en) 2020-09-23 2020-09-23 Vehicle brand identification method, device, equipment and medium based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN112132140B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110378232A (en) * 2019-06-20 2019-10-25 陕西师范大学 The examination hall examinee position rapid detection method of improved SSD dual network
CN111310773A (en) * 2020-03-27 2020-06-19 西安电子科技大学 Efficient license plate positioning method of convolutional neural network
CN111460894A (en) * 2020-03-03 2020-07-28 温州大学 Intelligent car logo detection method based on convolutional neural network
CN111476225A (en) * 2020-06-28 2020-07-31 平安国际智慧城市科技股份有限公司 In-vehicle human face identification method, device, equipment and medium based on artificial intelligence
CN111553230A (en) * 2020-04-21 2020-08-18 东南大学 Feature enhancement based progressive cascade face detection method under unconstrained scene
CN111553387A (en) * 2020-04-03 2020-08-18 上海物联网有限公司 Yolov 3-based personnel target detection method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401410B (en) * 2020-02-27 2023-06-13 江苏大学 Traffic sign detection method based on improved cascade neural network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110378232A (en) * 2019-06-20 2019-10-25 陕西师范大学 The examination hall examinee position rapid detection method of improved SSD dual network
CN111460894A (en) * 2020-03-03 2020-07-28 温州大学 Intelligent car logo detection method based on convolutional neural network
CN111310773A (en) * 2020-03-27 2020-06-19 西安电子科技大学 Efficient license plate positioning method of convolutional neural network
CN111553387A (en) * 2020-04-03 2020-08-18 上海物联网有限公司 Yolov 3-based personnel target detection method
CN111553230A (en) * 2020-04-21 2020-08-18 东南大学 Feature enhancement based progressive cascade face detection method under unconstrained scene
CN111476225A (en) * 2020-06-28 2020-07-31 平安国际智慧城市科技股份有限公司 In-vehicle human face identification method, device, equipment and medium based on artificial intelligence

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
1Pranav Adarsh et al..YOLO v3-Tiny: Object Detection and Recognition using one stage improved model.《2020 6th International Conference on Advanced Computing & Communication Systems (ICACCS)》.2020,第687-694页. *

Also Published As

Publication number Publication date
CN112132140A (en) 2020-12-25

Similar Documents

Publication Publication Date Title
CN111738212B (en) Traffic signal lamp identification method, device, equipment and medium based on artificial intelligence
CN112231586A (en) Course recommendation method, device, equipment and medium based on transfer learning
CN111652845A (en) Abnormal cell automatic labeling method and device, electronic equipment and storage medium
CN111931729B (en) Pedestrian detection method, device, equipment and medium based on artificial intelligence
CN111476225B (en) In-vehicle human face identification method, device, equipment and medium based on artificial intelligence
CN112447189A (en) Voice event detection method and device, electronic equipment and computer storage medium
CN111754110A (en) Method, device, equipment and medium for evaluating operation index based on artificial intelligence
CN112699775A (en) Certificate identification method, device and equipment based on deep learning and storage medium
CN112052850A (en) License plate recognition method and device, electronic equipment and storage medium
CN112749653A (en) Pedestrian detection method, device, electronic equipment and storage medium
CN111882873B (en) Track anomaly detection method, device, equipment and medium
CN111950621A (en) Target data detection method, device, equipment and medium based on artificial intelligence
CN114781768B (en) Parking lot facility planning method, device and equipment based on urban resource data
CN112132033A (en) Vehicle type recognition method and device, electronic equipment and storage medium
CN111985449A (en) Rescue scene image identification method, device, equipment and computer medium
CN111985545A (en) Target data detection method, device, equipment and medium based on artificial intelligence
CN112115890B (en) Drunk driving identification method, device, equipment and medium based on artificial intelligence
CN112132140B (en) Vehicle brand identification method, device, equipment and medium based on artificial intelligence
CN115239958A (en) Wheel hub damage detection method based on artificial intelligence and related equipment
CN112132037A (en) Sidewalk detection method, device, equipment and medium based on artificial intelligence
CN111488876B (en) License plate recognition method, device, equipment and medium based on artificial intelligence
CN112330080B (en) Factor screening method, device, equipment and medium based on connectivity graph
CN112905817B (en) Image retrieval method and device based on sorting algorithm and related equipment
CN111860661A (en) Data analysis method and device based on user behavior, electronic equipment and medium
CN112561889A (en) Target detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant