[go: up one dir, main page]

CN112733578A - Vehicle weight identification method and system - Google Patents

Vehicle weight identification method and system Download PDF

Info

Publication number
CN112733578A
CN112733578A CN201911032114.3A CN201911032114A CN112733578A CN 112733578 A CN112733578 A CN 112733578A CN 201911032114 A CN201911032114 A CN 201911032114A CN 112733578 A CN112733578 A CN 112733578A
Authority
CN
China
Prior art keywords
vehicle
compared
saliency
images
region
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.)
Granted
Application number
CN201911032114.3A
Other languages
Chinese (zh)
Other versions
CN112733578B (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.)
Potevio Information Technology Co Ltd
Original Assignee
Potevio Information 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 Potevio Information Technology Co Ltd filed Critical Potevio Information Technology Co Ltd
Priority to CN201911032114.3A priority Critical patent/CN112733578B/en
Publication of CN112733578A publication Critical patent/CN112733578A/en
Application granted granted Critical
Publication of CN112733578B publication Critical patent/CN112733578B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/08Detecting or categorising vehicles
    • 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)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention provides a vehicle weight recognition method and a vehicle weight recognition system, which adopt a method of combining the overall characteristics of a vehicle with the characteristics of salient regions, consider the salient regions of lamps, logos, windows, labels, pendants and the like of the vehicle, determine whether any two vehicle images to be compared belong to the same vehicle, can improve the effect of vehicle weight recognition and ensure the accuracy of vehicle weight recognition.

Description

车辆重识别方法及系统Vehicle re-identification method and system

技术领域technical field

本发明涉及车辆重识别技术领域,更具体地,涉及车辆重识别方法及系统。The present invention relates to the technical field of vehicle re-identification, and more particularly, to a vehicle re-identification method and system.

背景技术Background technique

随着车辆数量的日益增多,对车辆管理的难度日益加大,在某些特定情况下需要对车流中行驶的一辆或多辆车进行轨迹追踪。在具体实现中,可以利用车辆重识别技术,从不同位置的多个摄像头拍摄的监控视频中识别搜索目标车辆,实现对目标车辆的轨迹追踪。其中,车辆重识别技术是指从不同时间与不同地点所采集的监控视频中,识别出同一目标车辆。With the increasing number of vehicles, it becomes increasingly difficult to manage vehicles. In some specific cases, it is necessary to track the trajectory of one or more vehicles traveling in the traffic flow. In specific implementation, the vehicle re-identification technology can be used to identify and search for the target vehicle from surveillance videos captured by multiple cameras at different positions, so as to realize the track tracking of the target vehicle. Among them, the vehicle re-identification technology refers to identifying the same target vehicle from surveillance videos collected at different times and at different locations.

在实际道路监控应用场景中,受拍摄环境的光线、摄像头角度、车辆行驶的运动模糊等因素影响,同一辆车、在不同拍摄图像中展现出来的特征差异可能较大;而不同车、在不同拍摄图像中展现出来的特征差异可能较小。这些问题为车辆重识别技术带来了具大的挑战。In the actual road monitoring application scenario, affected by factors such as the light of the shooting environment, the angle of the camera, and the motion blur of the vehicle, the characteristics of the same vehicle in different shooting images may vary greatly; The differences in features exhibited in the captured images may be small. These problems bring great challenges to vehicle re-identification technology.

针对车辆重识别问题,现有技术方案主要基于卷积神经网络(ConvolutionalNeural Networks,CNN)、深度置信网络(Deep Belief Networks,DBN)等常规神经网络结构结合不同损失函数的组合进行模型训练,得到车辆重识别模型,模型识别精度仍有提升空间。For the problem of vehicle re-identification, the existing technical solutions are mainly based on conventional neural network structures such as Convolutional Neural Networks (CNN), Deep Belief Networks (DBN) and other conventional neural network structures combined with different loss functions. After re-identifying the model, there is still room for improvement in model recognition accuracy.

发明内容SUMMARY OF THE INVENTION

为克服上述问题或者至少部分地解决上述问题,本发明实施例提供了一种车辆重识别方法及系统。To overcome the above problems or at least partially solve the above problems, embodiments of the present invention provide a vehicle re-identification method and system.

第一方面,本发明实施例提供了一种车辆重识别方法,包括:In a first aspect, an embodiment of the present invention provides a vehicle re-identification method, including:

将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由所述车辆整体特征比对模块基于整体特征提取模型,确定所述任意两张待比对车辆图像中车辆的整体相似度;Input any two vehicle images to be compared into the vehicle overall feature comparison module, and the vehicle overall feature comparison module determines the overall vehicle in the any two vehicle images to be compared based on the overall feature extraction model. similarity;

若所述整体相似度小于第一阈值,则将所述任意两张待比对车辆图像输入至显著性区域特征比对模块,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度;If the overall similarity is less than the first threshold, input the any two vehicle images to be compared into the salient region feature comparison module, and the salient region feature comparison module extracts the model based on the salient region features , determine the similarity of the salient regions of the vehicles in the any two vehicle images to be compared;

若所述显著性区域相似度大于等于第二阈值,则判断所述任意两张待比对车辆图像属于同一车辆;If the similarity of the saliency region is greater than or equal to the second threshold, it is determined that the two images of the vehicles to be compared belong to the same vehicle;

其中,所述整体特征提取模型基于第一卷积神经网络构建,并通过第一类样本车辆图像及所述第一类样本车辆图像中第一类样本车辆的整体特征训练得到;所述显著性区域特征提取模型基于第二卷积神经网络以及注意力机制网络构建,并通过第二类样本车辆图像训练得到。Wherein, the overall feature extraction model is constructed based on the first convolutional neural network, and is obtained by training the first-type sample vehicle images and the overall features of the first-type sample vehicles in the first-type sample vehicle images; the saliency The regional feature extraction model is constructed based on the second convolutional neural network and the attention mechanism network, and is trained by the second type of sample vehicle images.

优选地,所述由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度,具体包括:Preferably, the saliency region similarity of the vehicles in the arbitrary two vehicle images to be compared is determined by the salient region feature comparison module based on the salient region feature extraction model, which specifically includes:

基于所述显著性区域特征提取模型分别提取所述任意两张待比对车辆图像中每张待比对车辆图像中车辆的显著性区域特征;Based on the saliency region feature extraction model, respectively extract the salient region features of the vehicle in each of the two to-be-compared vehicle images in the to-be-compared vehicle image;

计算所述任意两张待比对车辆图像中车辆的显著性区域特征之间的余弦距离,将所述余弦距离作为所述显著性区域相似度。Calculate the cosine distance between the salient region features of the vehicles in the arbitrary two vehicle images to be compared, and use the cosine distance as the salient region similarity.

优选地,所述基于所述显著性区域特征提取模型分别提取所述任意两张待比对车辆图像中每张待比对车辆图像中车辆的显著性区域特征,具体包括:Preferably, the salient region features of the vehicle in each of the two to-be-compared vehicle images are respectively extracted based on the saliency region feature extraction model, specifically including:

对于所述任意两张待比对车辆图像中每张待比对车辆图像,基于所述第二卷积神经网络,提取所述待比对车辆图像中的车辆特征,并将所述车辆特征输入至注意力机制网络;For each image of the vehicle to be compared in any two images of the vehicle to be compared, based on the second convolutional neural network, extract the vehicle feature in the image of the vehicle to be compared, and input the vehicle feature into to the attention mechanism network;

基于所述注意力机制网络,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,并确定所述待比对车辆图像中车辆的显著性区域集合;其中,所述显著性区域掩膜矩阵集合中包括多个显著性区域掩膜矩阵,所述显著性区域集合中包括多个显著性区域,所述显著性区域掩膜矩阵与所述显著性区域一一对应;Based on the attention mechanism network, a set of saliency region mask matrices of vehicles in the vehicle image to be compared is determined, and a set of saliency regions of vehicles in the vehicle image to be compared is determined; wherein the saliency The region mask matrix set includes a plurality of saliency region mask matrices, the saliency region set includes a plurality of saliency regions, and the saliency region mask matrix is in one-to-one correspondence with the saliency regions;

将所述待比对车辆图像中车辆的显著性区域集合输入至所述第二卷积神经网络,提取所述显著性区域集合中每个显著性区域的显著性区域特征。The saliency area set of the vehicle in the vehicle image to be compared is input to the second convolutional neural network, and the saliency area feature of each saliency area in the saliency area set is extracted.

优选地,所述基于所述注意力机制网络,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,具体包括:Preferably, the determining the salient region mask matrix set of the vehicle in the vehicle image to be compared based on the attention mechanism network specifically includes:

基于所述注意力机制网络的参数矩阵、所述车辆特征以及所述车辆特征的映射变换函数,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合。Based on the parameter matrix of the attention mechanism network, the vehicle feature, and the mapping transformation function of the vehicle feature, a set of salient region mask matrices of the vehicle in the vehicle image to be compared is determined.

优选地,所述显著性区域集合中每类显著性区域均分别对应于一预设权重;相应地,Preferably, each type of saliency region in the saliency region set corresponds to a preset weight; accordingly,

所述确定所述待比对车辆图像中车辆的显著性区域集合,具体包括:The determining of the set of saliency regions of the vehicle in the vehicle image to be compared specifically includes:

基于所述显著性区域掩膜矩阵集合中的每个显著性区域掩膜矩阵以及每类显著性区域掩膜矩阵对应的预设权重,确定所述显著性区域集合中的每个显著性区域。Each saliency region in the saliency region set is determined based on each saliency region mask matrix in the saliency region mask matrix set and a preset weight corresponding to each type of saliency region mask matrix.

优选地,所述计算所述任意两张待比对车辆图像中车辆的显著性区域特征之间的显著性区域相似度,具体包括:Preferably, the calculating the similarity of the saliency area between the salient area features of the vehicle in any two images of the vehicle to be compared, specifically includes:

分别计算所述任意两张待比对车辆图像中相对应的每个显著性区域的显著性区域特征之间的局部相似度;respectively calculating the local similarity between the saliency area features of each saliency area corresponding to the any two vehicle images to be compared;

基于所有局部相似度以及每类显著性区域对应的预设权重,计算所述显著性区域相似度。The saliency region similarity is calculated based on all local similarities and preset weights corresponding to each type of saliency region.

优选地,所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,具体由如下公式确定:Preferably, the set of mask matrices of the saliency region of the vehicle in the vehicle image to be compared is specifically determined by the following formula:

M=h(f(X))⊙F;M=h(f(X))⊙F;

其中,M为所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,X为所述待比对车辆图像,f(X)为所述待比对车辆图像中的车辆特征,F为所述注意力机制网络的参数矩阵,h(f(X))为f(X)的映射变换函数。Wherein, M is the saliency area mask matrix set of the vehicle in the vehicle image to be compared, X is the image of the vehicle to be compared, f(X) is the vehicle feature in the image of the vehicle to be compared, F is the parameter matrix of the attention mechanism network, and h(f(X)) is the mapping transformation function of f(X).

第二方面,本发明实施例提供了一种车辆重识别系统,包括:整体相似度确定子系统、显著性区域相似度确定子系统和车辆判断子系统。其中,In a second aspect, an embodiment of the present invention provides a vehicle re-identification system, including: an overall similarity determination subsystem, a saliency area similarity determination subsystem, and a vehicle judgment subsystem. in,

整体相似度确定子系统用于将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由所述车辆整体特征比对模块基于整体特征提取模型,确定所述任意两张待比对车辆图像中车辆的整体相似度;The overall similarity determination subsystem is used to input any two vehicle images to be compared into the vehicle overall feature comparison module, and the vehicle overall feature comparison module determines the arbitrary two to be compared based on the overall feature extraction model. Compare the overall similarity of vehicles in vehicle images;

显著性区域相似度确定子系统用于若所述整体相似度小于第一阈值,则将所述任意两张待比对车辆图像输入至显著性区域特征比对模块,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度;The saliency area similarity determination subsystem is configured to input the any two vehicle images to be compared to the saliency area feature comparison module if the overall similarity is less than the first threshold, and the saliency area feature The comparison module determines the similarity of the salient regions of the vehicles in the any two vehicle images to be compared based on the salient region feature extraction model;

车辆判断子系统用于若所述显著性区域相似度大于等于第二阈值,则判断所述任意两张待比对车辆图像属于同一车辆;The vehicle judging subsystem is configured to judge that any two vehicle images to be compared belong to the same vehicle if the similarity of the salient region is greater than or equal to a second threshold;

其中,所述整体特征提取模型基于第一卷积神经网络构建,并通过第一类样本车辆图像及所述第一类样本车辆图像中第一类样本车辆的整体特征训练得到;所述显著性区域特征提取模型基于第二卷积神经网络以及注意力机制网络构建,并通过第二类样本车辆图像训练得到。Wherein, the overall feature extraction model is constructed based on the first convolutional neural network, and is obtained by training the first-type sample vehicle images and the overall features of the first-type sample vehicles in the first-type sample vehicle images; the saliency The regional feature extraction model is constructed based on the second convolutional neural network and the attention mechanism network, and is trained by the second type of sample vehicle images.

第三方面,本发明实施例提供了一种电子设备,包括:In a third aspect, an embodiment of the present invention provides an electronic device, including:

至少一个处理器、至少一个存储器、通信接口和总线;其中,at least one processor, at least one memory, a communication interface, and a bus; wherein,

所述处理器、存储器、通信接口通过所述总线完成相互间的通信;The processor, the memory, and the communication interface communicate with each other through the bus;

所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令,以执行第一方面提供的车辆重识别方法。The memory stores program instructions executable by the processor, and the processor invokes the program instructions to execute the vehicle re-identification method provided by the first aspect.

第四方面,本发明实施例提供了一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行第一方面提供的车辆重识别方法。In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the vehicle provided in the first aspect Re-identification method.

本发明实施例提供的一种车辆重识别方法及系统,采用车辆整体特征与显著性区域特征相结合的方法,考虑了车辆的车灯、车标、车窗、贴标以及挂件等显著性区域,确定任意两张待比对车辆图像是否属于同一车辆,可以提升车辆重识别的效果,保证车辆重识别的准确性。The vehicle re-identification method and system provided by the embodiments of the present invention adopt a method of combining the overall characteristics of the vehicle with the characteristics of the salient area, and consider the salient areas of the vehicle, such as lights, vehicle logos, windows, stickers, and pendants. , to determine whether any two images of vehicles to be compared belong to the same vehicle, which can improve the effect of vehicle re-identification and ensure the accuracy of vehicle re-identification.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明实施例提供的一种车辆重识别方法的流程示意图;FIG. 1 is a schematic flowchart of a vehicle re-identification method according to an embodiment of the present invention;

图2为本发明实施例提供的一种车辆整体特征比对模块内整体特征提取模型的训练及使用的流程示意图;2 is a schematic flowchart of the training and use of an overall feature extraction model in a vehicle overall feature comparison module according to an embodiment of the present invention;

图3为本发明实施例提供的一种车辆重识别方法中显著性区域特征比对模块内显著性区域特征提取模型的训练及使用的流程示意图;3 is a schematic flowchart of training and use of a salient area feature extraction model in a salient area feature comparison module in a vehicle re-identification method provided by an embodiment of the present invention;

图4为本发明实施例提供的一种车辆重识别方法的整体流程示意图;4 is a schematic overall flow diagram of a vehicle re-identification method provided by an embodiment of the present invention;

图5为本发明实施例提供的一种车辆重识别系统的结构示意图;5 is a schematic structural diagram of a vehicle re-identification system according to an embodiment of the present invention;

图6为本发明实施例提供的一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

由于实际道路监控应用场景中,受拍摄环境的光线、摄像头角度、车辆行驶的运动模糊等因素影响,同一辆车、在不同拍摄图像中展现出来的特征差异可能较大;而不同车、在不同拍摄图像中展现出来的特征差异可能较小。现有技术中采用的车辆重识别方法均是通过卷积神经网络构建模型实现,而现有技术中的车辆重识别方法仅仅能够通过车辆图像的整体来实现识别,无法保证识别的精度和准确度。为此,本发明实施例中提供了一种车辆重识别方法,主要目标是减小拍摄环境的光线、摄像头角度、车内装饰与车辆行驶的运动模糊等因素的影响,提升实际应用场景下的车辆重识别精度。对某些车型,虽然整体特征相近,但车标区域、车灯设计具有一定差异性;同一车型,不同车的车窗装饰物、贴标、挂件等同样存在差异。本发明实施例中充分利用车辆的车灯、车标、车窗、贴标以及挂件等显著性区域,对车辆进行精确的重识别,提升识别效果。Due to the influence of factors such as the light of the shooting environment, the angle of the camera, and the motion blur of the vehicle in the actual road monitoring application scenario, the characteristics shown in the same vehicle and different shooting images may vary greatly; The differences in features exhibited in the captured images may be small. The vehicle re-identification methods used in the prior art are all realized by constructing a model through a convolutional neural network, while the vehicle re-identification methods in the prior art can only realize the identification through the entire vehicle image, and cannot guarantee the accuracy and accuracy of the identification. . To this end, an embodiment of the present invention provides a vehicle re-identification method, the main goal of which is to reduce the influence of factors such as the light of the shooting environment, the angle of the camera, the interior decoration of the vehicle, and the motion blur of the vehicle, so as to improve the performance in practical application scenarios. Vehicle re-identification accuracy. For some models, although the overall features are similar, there are certain differences in the car logo area and lamp design; the same model, the window decorations, stickers, pendants, etc. of different cars are also different. In the embodiment of the present invention, salient areas such as lights, car logos, car windows, stickers, and pendants of the vehicle are fully utilized to accurately re-identify the vehicle and improve the recognition effect.

如图1所示,本发明实施例提供的车辆重识别方法包括:As shown in FIG. 1 , the vehicle re-identification method provided by the embodiment of the present invention includes:

S1,将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由所述车辆整体特征比对模块基于整体特征提取模型,确定所述任意两张待比对车辆图像中车辆的整体相似度;S1, input any two vehicle images to be compared into the vehicle overall feature comparison module, and the vehicle overall feature comparison module determines the vehicle in the any two vehicle images to be compared based on the overall feature extraction model. the overall similarity;

S2,若所述整体相似度小于第一阈值,则将所述任意两张待比对车辆图像输入至显著性区域特征比对模块,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度;S2, if the overall similarity is less than the first threshold, input any two vehicle images to be compared into a saliency area feature comparison module, and the saliency area feature comparison module is based on the saliency area feature extracting a model to determine the similarity of the salient regions of the vehicles in the any two images of the vehicles to be compared;

S3,若所述显著性区域相似度大于等于第二阈值,则判断所述任意两张待比对车辆图像属于同一车辆;S3, if the similarity of the salient region is greater than or equal to a second threshold, determine that the two images of the vehicles to be compared belong to the same vehicle;

其中,所述整体特征提取模型基于第一卷积神经网络构建,并通过第一类样本车辆图像及所述第一类样本车辆图像中第一类样本车辆的整体特征训练得到;所述显著性区域特征提取模型基于第二卷积神经网络以及注意力机制网络构建,并通过第二类样本车辆图像训练得到。Wherein, the overall feature extraction model is constructed based on the first convolutional neural network, and is obtained by training the first-type sample vehicle images and the overall features of the first-type sample vehicles in the first-type sample vehicle images; the saliency The regional feature extraction model is constructed based on the second convolutional neural network and the attention mechanism network, and is trained by the second type of sample vehicle images.

具体地,本发明实施例中提供的一种车辆重识别方法,针对的是一组需要进行车辆重识别的待比对车辆图像,从这组图像中识别出同一车辆或不同车辆,即判断这组图像是属于同一车辆还是属于不同车辆。执行主体可以是本地服务器或云端服务器,本地服务器可以是计算机电脑,也可以是其他能够执行本发明实施例中提供的车辆重识别方法的设备,本发明实施例中对此不作具体限定。Specifically, a vehicle re-identification method provided in the embodiment of the present invention is aimed at a set of vehicle images to be compared that need to be re-identified, and the same vehicle or different vehicles are identified from the set of images, that is, the judgment Whether the set of images belong to the same vehicle or to different vehicles. The execution body may be a local server or a cloud server, and the local server may be a computer or other device capable of executing the vehicle re-identification method provided in the embodiment of the present invention, which is not specifically limited in the embodiment of the present invention.

首先,执行步骤S1,对于一组需要进行车辆重识别的待比对车辆图像中的任意两张待比对车辆图像,将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由车辆整体特征比对模块基于整体特征提取模型,确定任意两张待比对车辆图像中车辆的整体相似度。其中,车辆整体特征比对模块中包括整体特征提取模型,整体特征提取模型基于第一卷积神经网络构建。第一卷积神经网络可以是GoogLeNet、ResNet、VGG等卷积神经网络(Convolutional Neural Networks,CNN)。整体特征提取模型可以通过第一类样本车辆图像及第一类样本车辆图像中第一类样本车辆的整体特征,结合ArcLoss和TripletLoss这两种损失函数训练得到,第一类样本车辆图像是指训练整体特征提取模型所采用的样本车辆图像,第一类样本车辆图像中包含有第一类样本车辆,第一类样本车辆的整体特征为预先确定。第一类样本车辆图像及第一类样本车辆图像中第一类样本车辆的整体特征构成第一类训练样本对整体特征提取模型进行训练。First, step S1 is performed, for any two vehicle images to be compared in a group of vehicle images to be compared that need to be re-identified, input any two images of the vehicle to be compared into the vehicle overall feature comparison module , the overall similarity of vehicles in any two vehicle images to be compared is determined by the vehicle overall feature comparison module based on the overall feature extraction model. The vehicle overall feature comparison module includes an overall feature extraction model, and the overall feature extraction model is constructed based on the first convolutional neural network. The first convolutional neural network may be a convolutional neural network (Convolutional Neural Networks, CNN) such as GoogLeNet, ResNet, and VGG. The overall feature extraction model can be obtained by training the first-type sample vehicle images and the overall features of the first-type sample vehicles in the first-type sample vehicle images, combined with the two loss functions of ArcLoss and TripletLoss. The first-type sample vehicle images refer to training The sample vehicle images used by the overall feature extraction model, the first-type sample vehicle images include the first-type sample vehicles, and the overall characteristics of the first-type sample vehicles are predetermined. The first-type sample vehicle images and the overall features of the first-type sample vehicles in the first-type sample vehicle images constitute the first-type training samples to train the overall feature extraction model.

在对整体特征提取模型进行训练时,虽然基于TripletLoss损失函数训练的模型精度较高、但模型收敛较慢,为降低模型训练时间,首先基于ArcLoss分类损失函数进行模型初步拟合,得到预训练模型。再基于所得到预训练模型,结合TripletLoss损失函数对预训练模型进行训练,得到整体特征提取模型。When training the overall feature extraction model, although the accuracy of the model trained based on the TripletLoss loss function is high, the model convergence is slow. In order to reduce the model training time, the model is initially fitted based on the ArcLoss classification loss function, and the pre-trained model is obtained. . Then, based on the obtained pre-training model, combined with the TripletLoss loss function, the pre-training model is trained to obtain the overall feature extraction model.

如图2所示为本发明实施例中提供的车辆重识别方法中车辆整体特征比对模块内整体特征提取模型的训练及使用的流程示意图。图2中包括模型训练和模型使用两部分,对于模型训练部分,向第一卷积神经网络输入第一类训练样本,先后使用ArcLoss和TripletLoss这两种损失函数对第一卷积神经网络进行训练,得到训练后的第一卷积神经网络,即为整体特征提取模型。对于模型使用部分,向整体特征提取模型输入任意两张待比对图像X和Y,整体特征提取模型确定每张待比对图像中车辆的整体特征。FIG. 2 is a schematic flowchart of the training and use of the overall feature extraction model in the vehicle overall feature comparison module in the vehicle re-identification method provided in the embodiment of the present invention. Figure 2 includes two parts: model training and model use. For the model training part, the first type of training samples are input to the first convolutional neural network, and the two loss functions of ArcLoss and TripletLoss are used successively to train the first convolutional neural network. , the first convolutional neural network after training is obtained, which is the overall feature extraction model. For the model usage part, input any two images X and Y to be compared to the overall feature extraction model, and the overall feature extraction model determines the overall characteristics of the vehicle in each image to be compared.

车辆整体特征比对模块根据每张待比对图像中车辆的整体特征,确定任意两张待比对车辆图像X和Y中车辆的整体相似度。计算整体相似度的方法具体可以通过计算X和Y中车辆的整体特征之间的余弦距离、皮尔森相关系数、Jaccard相似系数等确定。The vehicle overall feature comparison module determines the overall similarity of the vehicles in any two to-be-compared vehicle images X and Y according to the overall characteristics of the vehicles in each to-be-compared image. The method for calculating the overall similarity may specifically be determined by calculating the cosine distance between the overall features of the vehicles in X and Y, the Pearson correlation coefficient, the Jaccard similarity coefficient, and the like.

车辆整体特征比对模块确定出整体相似度后,判断整体相似度与第一阈值D1之间的大小关系。其中,第一阈值D1是指表征两张车辆图像属于同一车辆时的最小整体相似度。本发明实施例中提供的车辆重识别方法的执行主体执行,也可以通过其他第三方设备执行。本发明实施例中对此不作具体限定。After determining the overall similarity, the vehicle overall feature comparison module determines the magnitude relationship between the overall similarity and the first threshold D1. The first threshold D 1 refers to the minimum overall similarity when the two vehicle images belong to the same vehicle. The execution subject of the vehicle re-identification method provided in the embodiment of the present invention may also be executed by other third-party devices. This is not specifically limited in this embodiment of the present invention.

然后执行步骤S2,判断步骤S1得到的任意两张待比对车辆图像X和Y中车辆的整体相似度与第一阈值D1之间的大小关系。其中,第一阈值D1是指表征两张车辆图像属于同一车辆时的最小整体相似度。当任意两张待比对车辆图像X和Y中车辆的整体相似度大于等于第一阈值D1时,则说明任意两张待比对车辆图像X和Y中车辆的整体相似度较高,属于同一车辆。Then step S2 is executed to determine the magnitude relationship between the overall similarity of the vehicles in any two images X and Y of the vehicles to be compared obtained in step S1 and the first threshold D1. The first threshold D 1 refers to the minimum overall similarity when the two vehicle images belong to the same vehicle. When the overall similarity of the vehicles in any two images of vehicles to be compared X and Y is greater than or equal to the first threshold D 1 , it means that the overall similarity of the vehicles in any of the two images of vehicles to be compared X and Y is high, belonging to the same vehicle.

对于整体特征差异较小的车辆图像,仅通过整体特征对比存在较高误判概率。而某些车型虽然整体特征相近,但品牌车标区域、车灯设计具有一定差异性;同一车型,不同车的车窗装饰物、贴标、挂件等同样存在差异。为进一步降低误识率,本方案充分利用车辆的车灯、车标、车窗、贴标以及挂件等显著性区域,辅助验证车辆识别结果,提升识别效果。当任意两张待比对车辆图像X和Y中车辆的整体相似度小于第一阈值D1时,则做进一步判断。将任意两张待比对车辆图像X和Y输入至显著性区域特征比对模块,由显著性区域特征比对模块基于显著性区域特征提取模型,确定任意两张待比对车辆图像中车辆的显著性区域相似度。其中,显著性区域特征比对模块中包括显著性区域特征提取模型,显著性区域特征提取模型基于第二卷积神经网络以及注意力机制网络构建。第二卷积神经网络可以是GoogLeNet、ResNet、VGG等卷积神经网络(Convolutional Neural Networks,CNN)。显著性区域特征提取模型可以通过第二类样本车辆图像,结合ArcLoss或TripletLoss等损失函数训练得到。第二类样本车辆图像是指训练显著性区域特征提取模型所采用的样本车辆图像,第二类样本车辆图像中包含有第二类样本车辆,第二类样本车辆的显著性区域特征为预先确定。第二类样本车辆图像构成第二类训练样本对显著性区域特征提取模型进行训练。For vehicle images with small differences in overall features, there is a high probability of misjudgment only by comparing the overall features. Although some models have similar overall characteristics, there are certain differences in the brand logo area and lamp design; for the same model, there are also differences in the window decorations, labels, and pendants of different cars. In order to further reduce the misrecognition rate, this solution makes full use of salient areas such as lights, logos, windows, stickers, and pendants of vehicles to assist in verifying vehicle recognition results and improve the recognition effect. When the overall similarity of the vehicles in any two vehicle images X and Y to be compared is less than the first threshold D1, further judgment is made. Input any two vehicle images X and Y to be compared to the saliency area feature comparison module, and the salient area feature comparison module determines the vehicle in any two vehicle images to be compared based on the salient area feature extraction model. salient region similarity. Among them, the salient region feature comparison module includes a salient region feature extraction model, and the salient region feature extraction model is constructed based on the second convolutional neural network and the attention mechanism network. The second convolutional neural network may be a convolutional neural network (Convolutional Neural Networks, CNN) such as GoogLeNet, ResNet, and VGG. The saliency region feature extraction model can be obtained by training the second-class sample vehicle images combined with loss functions such as ArcLoss or TripletLoss. The second type of sample vehicle image refers to the sample vehicle image used for training the saliency region feature extraction model. The second type of sample vehicle image contains the second type of sample vehicle, and the salient region feature of the second type of sample vehicle is predetermined. . The second type of samples The vehicle images constitute the second type of training samples to train the saliency region feature extraction model.

如图3所示为本发明实施例中提供的车辆重识别方法中显著性区域特征比对模块内显著性区域特征提取模型的训练及使用的流程示意图。图3中包括模型训练和模型使用两部分,对于模型训练部分,向第二卷积神经网络输入第二类训练样本,第二卷积神经网络对第二类训练样本进行特征提取,所提取的特征经过映射变换再作为注意力机制网络的输入进行参数计算,注意力机制网络输出显著性区域掩模矩阵集合,作用于第二类训练样本,得到显著性区域集合,再将显著性区域集合输入到第二卷积神经网络,结合全连接层得到显著性区域特征,显著性区域特征结合TripletLoss或ArcLoss等损失函数对显著性区域特征提取模型进行训练,得到显著性区域特征提取模型的参数矩阵。显著性区域特征提取模型基于注意力机制得到对车辆识别有益的显著性区域特征,无需增加额外显著性区域标注数据,即可实现端到端训练。FIG. 3 is a schematic flowchart of the training and use of the salient area feature extraction model in the salient area feature comparison module in the vehicle re-identification method provided in the embodiment of the present invention. Figure 3 includes two parts: model training and model use. For the model training part, the second type of training samples are input to the second convolutional neural network, and the second convolutional neural network performs feature extraction on the second type of training samples, and the extracted After the feature is mapped and transformed, it is used as the input of the attention mechanism network for parameter calculation. The attention mechanism network outputs the saliency region mask matrix set, which acts on the second type of training samples to obtain the saliency region set, and then the saliency region set is input. In the second convolutional neural network, the salient region features are obtained by combining the fully connected layer. The salient region features are combined with loss functions such as TripletLoss or ArcLoss to train the salient region feature extraction model, and the parameter matrix of the salient region feature extraction model is obtained. The saliency region feature extraction model obtains salient region features that are beneficial to vehicle recognition based on the attention mechanism, and can achieve end-to-end training without adding additional saliency region annotation data.

对于模型使用部分,向显著性区域特征提取模型输入任意两张待比对图像X和Y,显著性区域特征提取模型确定每张待比对图像中车辆的显著性区域特征。显著性区域特征比对模块根据每张待比对图像中车辆的显著性区域特征,确定任意两张待比对车辆图像X和Y中车辆的显著性区域相似度。计算显著性区域相似度的方法具体可以通过计算X和Y中车辆的显著性区域特征之间的余弦距离、皮尔森相关系数、Jaccard相似系数等确定。For the model usage part, input any two images X and Y to be compared to the saliency region feature extraction model, and the saliency region feature extraction model determines the salient region features of the vehicle in each image to be compared. The salient region feature comparison module determines the similarity of the salient regions of the vehicles in any two images X and Y of the vehicles to be compared according to the salient region features of the vehicles in each image to be compared. The method for calculating the similarity of the saliency regions can be specifically determined by calculating the cosine distance, the Pearson correlation coefficient, the Jaccard similarity coefficient, and the like between the salient region features of the vehicles in X and Y.

显著性区域特征比对模块确定出显著性区域相似度后,判断显著性区域相似度与第二阈值D2之间的大小关系。其中,第二阈值D2是指表征两张车辆图像属于同一车辆时的最小显著性区域相似度。需要说明的是,判断的过程还可以通过本发明实施例中提供的车辆重识别方法的执行主体执行,也可以通过其他第三方设备执行。本发明实施例中对此不作具体限定。After the salient region feature comparison module determines the salient region similarity, it determines the magnitude relationship between the salient region similarity and the second threshold D 2 . Wherein, the second threshold D 2 refers to the minimum saliency area similarity when the two vehicle images belong to the same vehicle. It should be noted that, the judgment process may also be performed by the execution subject of the vehicle re-identification method provided in the embodiment of the present invention, or may be performed by other third-party devices. This is not specifically limited in this embodiment of the present invention.

最后,执行步骤S3,即当显著性区域相似度大于等于第二阈值,则判断任意两张待比对车辆图像X和Y属于同一车辆;当显著性区域相似度小于第二阈值,则判断任意两张待比对车辆图像X和Y属于两个不同车辆。Finally, step S3 is performed, that is, when the similarity of the saliency area is greater than or equal to the second threshold, it is determined that any two vehicle images X and Y to be compared belong to the same vehicle; when the similarity of the saliency area is less than the second threshold, it is determined that any The two vehicle images X and Y to be compared belong to two different vehicles.

如图4所示为本发明实施例中提供的车辆重识别方法的整体流程示意图,图4中将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,进行整体特征比对,并由车辆整体特征比对模块确定整体相似度与第一阈值D1之间的大小关系,如果整体相似度大于等于D1,则判断任意两张待比对车辆图像属于同一车辆,否则,将任意两张待比对车辆图像输入至显著性区域特征比对模块,进行显著性区域特征比对,并由显著性区域特征比对模块确定任意两张待比对车辆图像中车辆的显著性区域相似度与第二阈值D2之间的大小关系,如果显著性区域相似度大于等于D2,则任意两张待比对车辆图像属于同一车辆,否则属于不同车辆。FIG. 4 is a schematic diagram of the overall flow of the vehicle re-identification method provided in the embodiment of the present invention. In FIG. 4, any two images of vehicles to be compared are input into the vehicle overall feature comparison module, and the overall feature comparison is performed. , and the size relationship between the overall similarity and the first threshold D 1 is determined by the vehicle overall feature comparison module. If the overall similarity is greater than or equal to D 1 , it is determined that any two images of the vehicles to be compared belong to the same vehicle, otherwise, Input any two vehicle images to be compared to the saliency area feature comparison module, and compare the salient area features, and the saliency area feature comparison module determines the saliency of the vehicle in any two vehicle images to be compared. The size relationship between the regional similarity and the second threshold D 2 , if the salient regional similarity is greater than or equal to D 2 , any two images of vehicles to be compared belong to the same vehicle, otherwise they belong to different vehicles.

本发明实施例中提供的车辆重识别方法,采用车辆整体特征与显著性区域特征相结合的方法,考虑了车辆的车灯、车标、车窗、贴标以及挂件等显著性区域,确定任意两张待比对车辆图像是否属于同一车辆,可以提升车辆重识别的效果,保证车辆重识别的准确性。The vehicle re-identification method provided in the embodiment of the present invention adopts the method of combining the overall characteristics of the vehicle with the characteristics of the salient area, and considers the salient areas of the vehicle, such as lights, vehicle logos, windows, stickers, and pendants, and determines any salient area. Whether the two vehicle images to be compared belong to the same vehicle can improve the effect of vehicle re-identification and ensure the accuracy of vehicle re-identification.

在上述实施例的基础上,本发明实施例中提供的车辆重识别方法,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度,具体包括:On the basis of the above embodiment, in the vehicle re-identification method provided in the embodiment of the present invention, the salient region feature comparison module determines the salient region feature extraction model based on the salient region feature extraction model to determine which of the two vehicle images to be compared is The similarity of the saliency region of the vehicle, including:

基于所述显著性区域特征提取模型分别提取所述任意两张待比对车辆图像中每张待比对车辆图像中车辆的显著性区域特征;Based on the saliency region feature extraction model, respectively extract the salient region features of the vehicle in each of the two to-be-compared vehicle images in the to-be-compared vehicle image;

计算所述任意两张待比对车辆图像中车辆的显著性区域特征之间的余弦距离,将所述余弦距离作为所述显著性区域相似度。Calculate the cosine distance between the salient region features of the vehicles in the arbitrary two vehicle images to be compared, and use the cosine distance as the salient region similarity.

具体地,本发明实施例中,分别将任意两张待比对车辆图像X和Y输入至显著性区域特征提取模型,由显著性区域特征提取模型分别提取X和Y中车辆的显著性区域特征,并采用计算余弦距离的方式确定X和Y中车辆的显著性区域特征之间的显著性区域相似度。Specifically, in the embodiment of the present invention, any two vehicle images X and Y to be compared are respectively input into the salient region feature extraction model, and the salient region features of the vehicles in X and Y are respectively extracted by the salient region feature extraction model. , and the saliency region similarity between the salient region features of vehicles in X and Y is determined by calculating the cosine distance.

余弦距离的计算公式如下:The formula for calculating the cosine distance is as follows:

Figure BDA0002250455130000111
Figure BDA0002250455130000111

其中,d表示余弦距离,θ表示X和Y在向量空间中的夹角。Among them, d represents the cosine distance, and θ represents the angle between X and Y in the vector space.

本发明实施例中,通过显著性区域特征提取模型提取显著性区域特征,通过计算显著性区域特征之间的余弦距离确定显著性区域相似度,计算过程简单,而且计算得到的显著性区域相似度更加准确可靠。In the embodiment of the present invention, the salient region features are extracted by the salient region feature extraction model, and the salient region similarity is determined by calculating the cosine distance between the salient region features, the calculation process is simple, and the calculated salient region similarity more accurate and reliable.

在上述实施例的基础上,本发明实施例中提供的车辆重识别方法,所述基于所述显著性区域特征提取模型分别提取所述任意两张待比对车辆图像中每张待比对车辆图像中车辆的显著性区域特征,具体包括:On the basis of the above embodiment, in the vehicle re-identification method provided in the embodiment of the present invention, the vehicle to be compared is extracted from each of the two images of the vehicle to be compared based on the feature extraction model of the salient region. The salient region features of the vehicle in the image, including:

对于所述任意两张待比对车辆图像中每张待比对车辆图像,基于所述第二卷积神经网络,提取所述待比对车辆图像中的车辆特征,并将所述车辆特征输入至注意力机制网络;For each image of the vehicle to be compared in any two images of the vehicle to be compared, based on the second convolutional neural network, extract the vehicle feature in the image of the vehicle to be compared, and input the vehicle feature into to the attention mechanism network;

基于所述注意力机制网络,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,并确定所述待比对车辆图像中车辆的显著性区域集合;其中,所述显著性区域掩膜矩阵集合中包括多个显著性区域掩膜矩阵,所述显著性区域集合中包括多个显著性区域,所述显著性区域掩膜矩阵与所述显著性区域一一对应;Based on the attention mechanism network, a set of saliency region mask matrices of vehicles in the vehicle image to be compared is determined, and a set of saliency regions of vehicles in the vehicle image to be compared is determined; wherein the saliency The region mask matrix set includes a plurality of saliency region mask matrices, the saliency region set includes a plurality of saliency regions, and the saliency region mask matrix is in one-to-one correspondence with the saliency regions;

将所述待比对车辆图像中车辆的显著性区域集合输入至所述第二卷积神经网络,提取所述显著性区域集合中每个显著性区域的显著性区域特征。The saliency area set of the vehicle in the vehicle image to be compared is input to the second convolutional neural network, and the saliency area feature of each saliency area in the saliency area set is extracted.

具体地,本发明实施例中,在通过显著性区域特征提取模型提取任意两张待比对车辆图像中每张待比对车辆图像中车辆的显著性区域特征时,将任意两张待比对车辆图像中每张待比对车辆图像均输入至显著性区域特征提取模型,以待比对车辆图像X为例进行说明。由第二卷积神经网络提取待比对车辆图像X中的车辆特征f(X),并将车辆特征f(X)输入至注意力机制网络。由注意力机制网络确定待比对车辆图像X中车辆的显著性区域掩膜矩阵集合M=[M1,M2,...,Mn],其中,n为待比对车辆图像X中车辆的显著性区域的数量,n的取值可根据具体业务应用场景中模型训练效果进行设定。M1为第一个显著性区域对应的显著性区域掩膜矩阵,M2为第二个显著性区域对应的显著性区域掩膜矩阵,同理Mn为第n个显著性区域对应的显著性区域掩膜矩阵。将得到的显著性区域掩膜矩阵集合M作用于待比对车辆图像X,即可确定待比对车辆图像X中车辆的显著性区域集合,即将显著性区域掩膜矩阵集合M与待比对车辆图像X进行卷积。Specifically, in the embodiment of the present invention, when extracting the salient region features of the vehicle in each of the two images of the vehicle to be compared among any two images of the vehicle to be compared, the Each vehicle image to be compared in the vehicle image is input to the saliency region feature extraction model, and the vehicle image X to be compared is taken as an example for description. The vehicle feature f(X) in the vehicle image X to be compared is extracted by the second convolutional neural network, and the vehicle feature f(X) is input to the attention mechanism network. Determine the saliency area mask matrix set M=[M 1 , M 2 ,..., M n ] of the vehicle in the vehicle image X to be compared by the attention mechanism network, where n is the vehicle image X to be compared. The number of vehicle saliency regions, and the value of n can be set according to the model training effect in specific business application scenarios. M 1 is the saliency region mask matrix corresponding to the first saliency region, M 2 is the saliency region mask matrix corresponding to the second saliency region, and similarly M n is the saliency region corresponding to the nth saliency region Sexual area mask matrix. The obtained saliency area mask matrix set M is applied to the vehicle image X to be compared, and then the saliency area set of the vehicle in the vehicle image X to be compared can be determined, that is, the saliency area mask matrix set M and the to-be-compared vehicle image X can be determined. The vehicle image X is convolved.

然后,将待比对车辆图像X中车辆的显著性区域集合输入至第二卷积神经网络,提取显著性区域集合中每个显著性区域的显著性区域特征。Then, the saliency region set of the vehicle in the vehicle image X to be compared is input into the second convolutional neural network, and the saliency region feature of each saliency region in the saliency region set is extracted.

本发明实施例中,通过第二卷积神经网络以及注意力机制网络确定出显著性区域特征,使得显著性区域特征的提取更加简便可行。In the embodiment of the present invention, the salient region feature is determined through the second convolutional neural network and the attention mechanism network, so that the extraction of the salient region feature is more convenient and feasible.

在上述实施例的基础上,本发明实施例中提供的车辆重识别方法,所述基于所述注意力机制网络,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,具体包括:On the basis of the above-mentioned embodiment, in the vehicle re-identification method provided in the embodiment of the present invention, the set of salient region mask matrices of the vehicle in the vehicle image to be compared is determined based on the attention mechanism network, specifically include:

基于所述注意力机制网络的参数矩阵、所述车辆特征以及所述车辆特征的映射变换函数,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合。Based on the parameter matrix of the attention mechanism network, the vehicle feature, and the mapping transformation function of the vehicle feature, a set of salient region mask matrices of the vehicle in the vehicle image to be compared is determined.

具体地,本发明实施例中,在确定显著性区域掩膜矩阵集合时,具体可根据注意力机制网络的参数矩阵、车辆特征以及车辆特征的映射变换函数确定。其中,注意力机制网络的参数矩阵在对显著性区域特征提取模型训练时确定,车辆特征通过第二卷积神经网络确定,车辆特征的映射变换函数为预先确定的函数,例如logistic函数、sigmoid函数等。Specifically, in the embodiment of the present invention, when determining the saliency region mask matrix set, it can be specifically determined according to the parameter matrix of the attention mechanism network, the vehicle feature, and the mapping transformation function of the vehicle feature. Among them, the parameter matrix of the attention mechanism network is determined during the training of the salient region feature extraction model, the vehicle feature is determined by the second convolutional neural network, and the mapping transformation function of the vehicle feature is a predetermined function, such as logistic function, sigmoid function Wait.

在上述实施例的基础上,待比对车辆图像中车辆的显著性区域掩膜矩阵集合,具体可以由如下公式确定:On the basis of the above embodiment, the mask matrix set of the saliency area of the vehicle in the vehicle image to be compared can be specifically determined by the following formula:

M=h(f(X))⊙F;M=h(f(X))⊙F;

其中,M为所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,X为所述待比对车辆图像,f(X)为所述待比对车辆图像中的车辆特征,F为所述注意力机制网络的参数矩阵,h(f(X))为f(X)的映射变换函数。当映射变换函数具体为logistic函数时,有:Wherein, M is the saliency area mask matrix set of the vehicle in the vehicle image to be compared, X is the image of the vehicle to be compared, f(X) is the vehicle feature in the image of the vehicle to be compared, F is the parameter matrix of the attention mechanism network, and h(f(X)) is the mapping transformation function of f(X). When the mapping transformation function is specifically a logistic function, there are:

Figure BDA0002250455130000131
Figure BDA0002250455130000131

其中,k为常数。where k is a constant.

在上述实施例的基础上,本发明实施例中提供的车辆重识别方法,所述显著性区域集合中每个显著性区域均分别对应于一预设权重;On the basis of the above-mentioned embodiment, in the vehicle re-identification method provided in the embodiment of the present invention, each salient area in the saliency area set corresponds to a preset weight respectively;

相应地,所述确定所述待比对车辆图像中车辆的显著性区域集合,具体包括:Correspondingly, the determining the set of saliency regions of the vehicle in the vehicle image to be compared specifically includes:

基于所述显著性区域掩膜矩阵集合中的每个显著性区域掩膜矩阵以及每个显著性区域掩膜矩阵对应的预设权重,确定所述显著性区域集合中的每个显著性区域。Each saliency region in the saliency region set is determined based on each saliency region mask matrix in the saliency region mask matrix set and a preset weight corresponding to each saliency region mask matrix.

具体地,本发明实施例中,由于车灯、车标、车窗、贴标以及挂件等不同类别的显著性区域在车辆重识别任务中贡献度具有一定差异性,因此本发明实施例中显著性区域集合中每类显著性区域均分别对应于一预设权重。Specifically, in the embodiment of the present invention, since different categories of saliency regions such as lights, car logos, windows, stickers, and pendants have certain differences in their contribution to the vehicle re-identification task, the salient regions in the embodiments of the present invention have certain differences in their contribution. Each type of saliency region in the saliency region set corresponds to a preset weight respectively.

因此,在确定待比对车辆图像中车辆的显著性区域集合时,具体可以基于显著性区域掩膜矩阵集合中的每个显著性区域掩膜矩阵以及每类显著性区域掩膜矩阵对应的预设权重,确定显著性区域集合中的每个显著性区域。其中,预设权重在显著性区域特征提取模型训练时确定,为常数。Therefore, when determining the saliency area set of the vehicle in the vehicle image to be compared, it can be specifically based on each saliency area mask matrix in the saliency area mask matrix set and the corresponding prediction of each type of saliency area mask matrix. Set the weights to determine each saliency region in the saliency region set. The preset weight is determined during training of the salient region feature extraction model and is a constant.

显著性区域集合中的每个显著性区域具体可通过如下公式确定:Each saliency region in the saliency region set can be specifically determined by the following formula:

Xiatt=αi(X⊙Μi),i∈n;X iatti (X⊙Μ i ),i∈n;

其中,Xiatt为显著性区域集合中的第i个显著性区域,αi为第i个显著性区域所属类别对应的预设权重。Wherein, Xiatt is the ith salient region in the salient region set, and α i is the preset weight corresponding to the category to which the ith salient region belongs.

显著性区域特征提取模型在训练过程中,将提取的第二类样本车辆图像的n个显著性区域[X1att,X2att,...,Xnatt]输入到第二卷积神经网络中进行显著性区域特征提取,基于所提取的显著性区域特征、不同类别的显著性区域对应的预设权重,结合TripletLoss或ArcLoss等损失函数进行模型训练。训练过程中包括第二卷积神经网络的参数矩阵、注意力机制网络的参数矩阵(包含不同类别的显著性区域对应的预设权重)两部分,具体可采用交替训练的方式,自适应得到显著性区域特征提取模型内的参数矩阵和不同类别的显著性区域对应的预设权重。During the training process of the saliency region feature extraction model, the n saliency regions [X 1att , X 2att ,...,X natt ] of the extracted second-class sample vehicle images are input into the second convolutional neural network for The salient region feature extraction is based on the extracted salient region features and the preset weights corresponding to different categories of salient regions, combined with loss functions such as TripletLoss or ArcLoss for model training. The training process includes two parts: the parameter matrix of the second convolutional neural network and the parameter matrix of the attention mechanism network (including the preset weights corresponding to different categories of salient regions). The parameter matrix in the feature extraction model of the saliency region and the preset weights corresponding to the saliency regions of different categories.

本发明实施例中,显著性区域特征提取模型构建与训练时,可以自适应得到不同类别的显著性区域在车辆重识别任务中的贡献度,即预设权重,采用带有权重的多显著性区域特征得到显著性区域相似度,实现端到端的显著性区域区域特征提取,无需增加其他输入数据标注。In the embodiment of the present invention, when the saliency region feature extraction model is constructed and trained, the contribution of different categories of saliency regions in the vehicle re-identification task can be adaptively obtained, that is, the preset weight, and the multi-saliency with weight is adopted. The regional feature obtains the similarity of the saliency region, and realizes the end-to-end region feature extraction of the saliency region without adding other input data annotations.

在上述实施例的基础上,本发明实施例中提供的车辆重识别方法,所述计算所述任意两张待比对车辆图像中车辆的显著性区域特征之间的显著性区域相似度,具体包括:On the basis of the above embodiment, in the vehicle re-identification method provided in the embodiment of the present invention, the calculation of the salient area similarity between the salient area features of the vehicle in the arbitrary two vehicle images to be compared, specifically include:

分别计算所述任意两张待比对车辆图像中相对应的每个显著性区域的显著性区域特征之间的局部相似度;respectively calculating the local similarity between the saliency area features of each saliency area corresponding to the any two vehicle images to be compared;

基于所有局部相似度以及每类显著性区域对应的预设权重,计算所述显著性区域相似度。The saliency region similarity is calculated based on all local similarities and preset weights corresponding to each type of saliency region.

具体地,本发明实施例中在计算显著性区域相似度时,可以先分别计算出局部相似度,然后根据所有局部相似度以及每类显著性区域对应的预设权重,计算所述显著性区域相似度。得到的显著性区域相似度是一种综合性的显著性区域相似度,具体如下:Specifically, when calculating the similarity of saliency regions in the embodiment of the present invention, the local similarities may be calculated separately, and then the saliency regions are calculated according to all the local similarities and the preset weights corresponding to each type of saliency region similarity. The obtained saliency region similarity is a comprehensive saliency region similarity, as follows:

Figure BDA0002250455130000151
Figure BDA0002250455130000151

其中,L为显著性区域相似度,Li为局部相似度。Among them, L is the salient region similarity, and Li is the local similarity.

如图5所示,本发明实施例中提供了一种车辆重识别系统,包括:整体相似度确定子系统51、显著性区域相似度确定子系统52和车辆判断子系统53。其中,As shown in FIG. 5 , an embodiment of the present invention provides a vehicle re-identification system, including: an overall similarity determination subsystem 51 , a salient region similarity determination subsystem 52 , and a vehicle judgment subsystem 53 . in,

整体相似度确定子系统51用于将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由所述车辆整体特征比对模块基于整体特征提取模型,确定所述任意两张待比对车辆图像中车辆的整体相似度;The overall similarity determination subsystem 51 is used to input any two vehicle images to be compared into the vehicle overall feature comparison module, and the vehicle overall feature comparison module determines the arbitrary two based on the overall feature extraction model. The overall similarity of the vehicles in the vehicle images to be compared;

显著性区域相似度确定子系统52用于若所述整体相似度小于第一阈值,则将所述任意两张待比对车辆图像输入至显著性区域特征比对模块,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度;The saliency area similarity determination subsystem 52 is configured to input the any two vehicle images to be compared to the saliency area feature comparison module if the overall similarity is less than the first threshold, and the saliency area The feature comparison module determines the similarity of the salient regions of the vehicles in the arbitrary two vehicle images to be compared based on the salient region feature extraction model;

车辆判断子系统53用于若所述显著性区域相似度大于等于第二阈值,则判断所述任意两张待比对车辆图像属于同一车辆;The vehicle judging subsystem 53 is configured to judge that the any two vehicle images to be compared belong to the same vehicle if the similarity of the salient region is greater than or equal to the second threshold;

其中,所述整体特征提取模型基于第一卷积神经网络构建,并通过第一类样本车辆图像及所述第一类样本车辆图像中第一类样本车辆的整体特征训练得到;所述显著性区域特征提取模型基于第二卷积神经网络以及注意力机制网络构建,并通过第二类样本车辆图像训练得到。Wherein, the overall feature extraction model is constructed based on the first convolutional neural network, and is obtained by training the first-type sample vehicle images and the overall features of the first-type sample vehicles in the first-type sample vehicle images; the saliency The regional feature extraction model is constructed based on the second convolutional neural network and the attention mechanism network, and is trained by the second type of sample vehicle images.

具体地,本发明实施例中提供的车辆重识别系统中各子系统的作用与上述方法类实施例中各步骤的操作流程是一一对应的,实现的效果也是一致的,具体参见上述方法类实施例,本发明实施例中对此不再赘述。Specifically, the functions of the subsystems in the vehicle re-identification system provided in the embodiments of the present invention correspond one-to-one with the operation procedures of the steps in the above method embodiments, and the achieved effects are also the same. For details, refer to the above methods Examples, which are not repeated in this embodiment of the present invention.

图6所示,在上述实施例的基础上,本发明实施例中提供了一种电子设备,包括:处理器(processor)601、存储器(memory)602、通信接口(Communications Interface)603和总线604;其中,As shown in FIG. 6 , on the basis of the foregoing embodiment, an embodiment of the present invention provides an electronic device, including: a processor (processor) 601 , a memory (memory) 602 , a communications interface (Communications Interface) 603 and a bus 604 ;in,

所述处理器601、存储器602、通信接口603通过总线604完成相互间的通信。所述存储器602存储有可被所述处理器601执行的程序指令,处理器601用于调用存储器602中的程序指令,以执行上述各方法实施例所提供的方法,例如包括:将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由所述车辆整体特征比对模块基于整体特征提取模型,确定所述任意两张待比对车辆图像中车辆的整体相似度;若所述整体相似度小于第一阈值,则将所述任意两张待比对车辆图像输入至显著性区域特征比对模块,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度;若所述显著性区域相似度大于等于第二阈值,则判断所述任意两张待比对车辆图像属于同一车辆。The processor 601 , the memory 602 and the communication interface 603 communicate with each other through the bus 604 . The memory 602 stores program instructions that can be executed by the processor 601, and the processor 601 is used to call the program instructions in the memory 602 to execute the methods provided by the above method embodiments, for example, including: combining any two The vehicle images to be compared are all input into the vehicle overall feature comparison module, and the vehicle overall feature comparison module determines the overall similarity of the vehicles in the any two vehicle images to be compared based on the overall feature extraction model; if If the overall similarity is less than the first threshold, input the any two vehicle images to be compared into the salient region feature comparison module, and the salient region feature comparison module extracts the model based on the salient region feature, Determine the similarity of the saliency area of the vehicle in the any two images of the vehicle to be compared; if the similarity of the salient area is greater than or equal to the second threshold, it is determined that the two images of the vehicle to be compared belong to the same vehicle.

存储器602中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The logic instructions in the memory 602 may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .

在上述实施例的基础上,本发明实施例中提供了一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述各方法实施例所提供的方法,例如包括:将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由所述车辆整体特征比对模块基于整体特征提取模型,确定所述任意两张待比对车辆图像中车辆的整体相似度;若所述整体相似度小于第一阈值,则将所述任意两张待比对车辆图像输入至显著性区域特征比对模块,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度;若所述显著性区域相似度大于等于第二阈值,则判断所述任意两张待比对车辆图像属于同一车辆。On the basis of the foregoing embodiments, an embodiment of the present invention provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the foregoing The method provided by each method embodiment, for example, includes: inputting any two images of the vehicle to be compared into the vehicle overall feature comparison module, and the vehicle overall feature comparison module determines the overall feature extraction model based on the overall feature extraction model. The overall similarity of the vehicle in any two images of the vehicle to be compared; if the overall similarity is less than the first threshold, input the two images of the vehicle to be compared into the saliency area feature comparison module, and the The salient region feature comparison module determines the similarity of the salient region of the vehicle in the arbitrary two images of the vehicles to be compared based on the feature extraction model of the salient region; if the similarity of the salient region is greater than or equal to the second threshold, Then, it is determined that the two images of the vehicles to be compared belong to the same vehicle.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be The technical solutions described in the foregoing embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1.一种车辆重识别方法,其特征在于,包括:1. a vehicle re-identification method, is characterized in that, comprises: 将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由所述车辆整体特征比对模块基于整体特征提取模型,确定所述任意两张待比对车辆图像中车辆的整体相似度;Input any two vehicle images to be compared into the vehicle overall feature comparison module, and the vehicle overall feature comparison module determines the overall vehicle in the any two vehicle images to be compared based on the overall feature extraction model. similarity; 若所述整体相似度小于第一阈值,则将所述任意两张待比对车辆图像输入至显著性区域特征比对模块,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度;If the overall similarity is less than the first threshold, input the any two vehicle images to be compared into the salient region feature comparison module, and the salient region feature comparison module extracts the model based on the salient region features , determine the similarity of the salient regions of the vehicles in the any two vehicle images to be compared; 若所述显著性区域相似度大于等于第二阈值,则判断所述任意两张待比对车辆图像属于同一车辆;If the similarity of the saliency region is greater than or equal to the second threshold, it is determined that the two images of the vehicles to be compared belong to the same vehicle; 其中,所述整体特征提取模型基于第一卷积神经网络构建,并通过第一类样本车辆图像及所述第一类样本车辆图像中第一类样本车辆的整体特征训练得到;所述显著性区域特征提取模型基于第二卷积神经网络以及注意力机制网络构建,并通过第二类样本车辆图像训练得到。Wherein, the overall feature extraction model is constructed based on the first convolutional neural network, and is obtained by training the first-type sample vehicle images and the overall features of the first-type sample vehicles in the first-type sample vehicle images; the saliency The regional feature extraction model is constructed based on the second convolutional neural network and the attention mechanism network, and is trained by the second type of sample vehicle images. 2.根据权利要求1所述的车辆重识别方法,其特征在于,所述由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度,具体包括:2 . The vehicle re-identification method according to claim 1 , wherein the salient region feature comparison module determines, based on the salient region feature extraction model, which of the two vehicle images to be compared is determined. 3 . The similarity of the saliency region of the vehicle, including: 基于所述显著性区域特征提取模型分别提取所述任意两张待比对车辆图像中每张待比对车辆图像中车辆的显著性区域特征;Based on the saliency region feature extraction model, respectively extract the salient region features of the vehicle in each of the two to-be-compared vehicle images in the to-be-compared vehicle image; 计算所述任意两张待比对车辆图像中车辆的显著性区域特征之间的余弦距离,将所述余弦距离作为所述显著性区域相似度。Calculate the cosine distance between the salient region features of the vehicles in the arbitrary two vehicle images to be compared, and use the cosine distance as the salient region similarity. 3.根据权利要求2所述的车辆重识别方法,其特征在于,所述基于所述显著性区域特征提取模型分别提取所述任意两张待比对车辆图像中每张待比对车辆图像中车辆的显著性区域特征,具体包括:3 . The vehicle re-identification method according to claim 2 , wherein the extraction model based on the salient region feature extraction model respectively extracts the image of each vehicle to be compared in the arbitrary two images of the vehicle to be compared. 4 . The salient regional features of the vehicle, including: 对于所述任意两张待比对车辆图像中每张待比对车辆图像,基于所述第二卷积神经网络,提取所述待比对车辆图像中的车辆特征,并将所述车辆特征输入至注意力机制网络;For each image of the vehicle to be compared in any two images of the vehicle to be compared, based on the second convolutional neural network, extract the vehicle feature in the image of the vehicle to be compared, and input the vehicle feature into to the attention mechanism network; 基于所述注意力机制网络,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,并确定所述待比对车辆图像中车辆的显著性区域集合;其中,所述显著性区域掩膜矩阵集合中包括多个显著性区域掩膜矩阵,所述显著性区域集合中包括多个显著性区域,所述显著性区域掩膜矩阵与所述显著性区域一一对应;Based on the attention mechanism network, a set of saliency region mask matrices of vehicles in the vehicle image to be compared is determined, and a set of saliency regions of vehicles in the vehicle image to be compared is determined; wherein the saliency The region mask matrix set includes a plurality of saliency region mask matrices, the saliency region set includes a plurality of saliency regions, and the saliency region mask matrix is in one-to-one correspondence with the saliency regions; 将所述待比对车辆图像中车辆的显著性区域集合输入至所述第二卷积神经网络,提取所述显著性区域集合中每个显著性区域的显著性区域特征。The saliency area set of the vehicle in the vehicle image to be compared is input to the second convolutional neural network, and the saliency area feature of each saliency area in the saliency area set is extracted. 4.根据权利要求3所述的车辆重识别方法,其特征在于,所述基于所述注意力机制网络,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,具体包括:4 . The vehicle re-identification method according to claim 3 , wherein determining the saliency region mask matrix set of the vehicle in the vehicle image to be compared based on the attention mechanism network, specifically comprising: 5 . 基于所述注意力机制网络的参数矩阵、所述车辆特征以及所述车辆特征的映射变换函数,确定所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合。Based on the parameter matrix of the attention mechanism network, the vehicle feature, and the mapping transformation function of the vehicle feature, a set of salient region mask matrices of the vehicle in the vehicle image to be compared is determined. 5.根据权利要求4所述的车辆重识别方法,其特征在于,所述显著性区域集合中每类显著性区域均分别对应于一预设权重;相应地,5 . The vehicle re-identification method according to claim 4 , wherein each type of saliency area in the saliency area set corresponds to a preset weight; accordingly, 所述确定所述待比对车辆图像中车辆的显著性区域集合,具体包括:The determining of the set of saliency regions of the vehicle in the vehicle image to be compared specifically includes: 基于所述显著性区域掩膜矩阵集合中的每个显著性区域掩膜矩阵以及每类显著性区域掩膜矩阵对应的预设权重,确定所述显著性区域集合中的每个显著性区域。Each saliency region in the saliency region set is determined based on each saliency region mask matrix in the saliency region mask matrix set and a preset weight corresponding to each type of saliency region mask matrix. 6.根据权利要求5所述的车辆重识别方法,其特征在于,所述计算所述任意两张待比对车辆图像中车辆的显著性区域特征之间的显著性区域相似度,具体包括:6 . The vehicle re-identification method according to claim 5 , wherein the calculating the similarity of the salient regions between the salient region features of the vehicles in the any two images of the vehicles to be compared, specifically comprises: 6 . 分别计算所述任意两张待比对车辆图像中相对应的每个显著性区域的显著性区域特征之间的局部相似度;respectively calculating the local similarity between the salient region features of each salient region corresponding to the any two vehicle images to be compared; 基于所有局部相似度以及每类显著性区域对应的预设权重,计算所述显著性区域相似度。The saliency region similarity is calculated based on all local similarities and preset weights corresponding to each type of saliency region. 7.根据权利要求4所述的车辆重识别方法,其特征在于,所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,具体由如下公式确定:7. The vehicle re-identification method according to claim 4, wherein the set of salient region mask matrices of the vehicle in the vehicle image to be compared is specifically determined by the following formula: M=h(f(X))⊙F;M=h(f(X))⊙F; 其中,M为所述待比对车辆图像中车辆的显著性区域掩膜矩阵集合,X为所述待比对车辆图像,f(X)为所述待比对车辆图像中的车辆特征,F为所述注意力机制网络的参数矩阵,h(f(X))为f(X)的映射变换函数。Wherein, M is the saliency area mask matrix set of the vehicle in the vehicle image to be compared, X is the image of the vehicle to be compared, f(X) is the vehicle feature in the image of the vehicle to be compared, F is the parameter matrix of the attention mechanism network, and h(f(X)) is the mapping transformation function of f(X). 8.一种车辆重识别系统,其特征在于,包括:8. A vehicle re-identification system, comprising: 整体相似度确定子系统,用于将任意两张待比对车辆图像均输入至车辆整体特征比对模块中,由所述车辆整体特征比对模块基于整体特征提取模型,确定所述任意两张待比对车辆图像中车辆的整体相似度;The overall similarity determination subsystem is used to input any two vehicle images to be compared into the vehicle overall feature comparison module, and the vehicle overall feature comparison module determines the arbitrary two based on the overall feature extraction model. The overall similarity of the vehicles in the vehicle images to be compared; 显著性区域相似度确定子系统,用于若所述整体相似度小于第一阈值,则将所述任意两张待比对车辆图像输入至显著性区域特征比对模块,由所述显著性区域特征比对模块基于显著性区域特征提取模型,确定所述任意两张待比对车辆图像中车辆的显著性区域相似度;The saliency area similarity determination subsystem is used for inputting the any two vehicle images to be compared to the saliency area feature comparison module if the overall similarity is less than the first threshold, and the saliency area is determined by the saliency area The feature comparison module determines the similarity of the salient regions of the vehicles in the arbitrary two vehicle images to be compared based on the salient region feature extraction model; 车辆判断模块,用于若所述显著性区域相似度大于等于第二阈值,则判断所述任意两张待比对车辆图像属于同一车辆;a vehicle judging module, configured to judge that any two vehicle images to be compared belong to the same vehicle if the similarity of the salient region is greater than or equal to a second threshold; 其中,所述整体特征提取模型基于第一卷积神经网络构建,并通过第一类样本车辆图像及所述第一类样本车辆图像中第一类样本车辆的整体特征训练得到;所述显著性区域特征提取模型基于第二卷积神经网络以及注意力机制网络构建,并通过第二类样本车辆图像训练得到。Wherein, the overall feature extraction model is constructed based on the first convolutional neural network, and is obtained by training the first-type sample vehicle images and the overall features of the first-type sample vehicles in the first-type sample vehicle images; the saliency The regional feature extraction model is constructed based on the second convolutional neural network and the attention mechanism network, and is obtained by training the second type of sample vehicle images. 9.一种电子设备,包括:存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1-7中任一项所述的车辆重识别方法的步骤。9. An electronic device, comprising: a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the program as in claims 1-7 when the processor executes the program The steps of any one of the vehicle re-identification methods. 10.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现如权利要求1-7中任一项所述的车辆重识别方法的步骤。10. A non-transitory computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the vehicle re-identification method according to any one of claims 1-7 is implemented A step of.
CN201911032114.3A 2019-10-28 2019-10-28 Vehicle re-identification method and system Active CN112733578B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911032114.3A CN112733578B (en) 2019-10-28 2019-10-28 Vehicle re-identification method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911032114.3A CN112733578B (en) 2019-10-28 2019-10-28 Vehicle re-identification method and system

Publications (2)

Publication Number Publication Date
CN112733578A true CN112733578A (en) 2021-04-30
CN112733578B CN112733578B (en) 2024-05-24

Family

ID=75588826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911032114.3A Active CN112733578B (en) 2019-10-28 2019-10-28 Vehicle re-identification method and system

Country Status (1)

Country Link
CN (1) CN112733578B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177533A (en) * 2021-05-28 2021-07-27 济南博观智能科技有限公司 Face recognition method and device and electronic equipment
CN118015343A (en) * 2024-01-18 2024-05-10 中移信息系统集成有限公司 Image filtering method, device and electronic equipment
CN119714104A (en) * 2024-12-23 2025-03-28 中咨数据有限公司 Quick comparison and judgment method for slope deformation without targets

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102610102A (en) * 2012-02-27 2012-07-25 安科智慧城市技术(中国)有限公司 Suspect vehicle inspection and control method and system
CN105320923A (en) * 2014-08-05 2016-02-10 北京大学 Vehicle type recognition method and apparatus
WO2018121690A1 (en) * 2016-12-29 2018-07-05 北京市商汤科技开发有限公司 Object attribute detection method and device, neural network training method and device, and regional detection method and device
CN109034086A (en) * 2018-08-03 2018-12-18 北京旷视科技有限公司 Vehicle recognition methods, apparatus and system again
CN109063768A (en) * 2018-08-01 2018-12-21 北京旷视科技有限公司 Vehicle recognition methods, apparatus and system again
CN109145777A (en) * 2018-08-01 2019-01-04 北京旷视科技有限公司 Vehicle recognition methods, apparatus and system again
CN109165589A (en) * 2018-08-14 2019-01-08 北京颂泽科技有限公司 Vehicle based on deep learning recognition methods and device again
CN109189970A (en) * 2018-09-20 2019-01-11 北京京东尚科信息技术有限公司 Picture similarity comparison method and device
CN109815924A (en) * 2019-01-29 2019-05-28 成都旷视金智科技有限公司 Expression recognition method, device and system
WO2019153908A1 (en) * 2018-02-11 2019-08-15 北京达佳互联信息技术有限公司 Image recognition method and system based on attention model
CN110298240A (en) * 2019-05-21 2019-10-01 北京迈格威科技有限公司 A kind of user vehicle recognition methods, device, system and storage medium
CN110309880A (en) * 2019-07-01 2019-10-08 天津工业大学 An Attention Mechanism-Based CNN-Based Image Classification Method for 5-Day and 9-Day Hatching Egg Embryos

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102610102A (en) * 2012-02-27 2012-07-25 安科智慧城市技术(中国)有限公司 Suspect vehicle inspection and control method and system
CN105320923A (en) * 2014-08-05 2016-02-10 北京大学 Vehicle type recognition method and apparatus
WO2018121690A1 (en) * 2016-12-29 2018-07-05 北京市商汤科技开发有限公司 Object attribute detection method and device, neural network training method and device, and regional detection method and device
WO2019153908A1 (en) * 2018-02-11 2019-08-15 北京达佳互联信息技术有限公司 Image recognition method and system based on attention model
CN109063768A (en) * 2018-08-01 2018-12-21 北京旷视科技有限公司 Vehicle recognition methods, apparatus and system again
CN109145777A (en) * 2018-08-01 2019-01-04 北京旷视科技有限公司 Vehicle recognition methods, apparatus and system again
CN109034086A (en) * 2018-08-03 2018-12-18 北京旷视科技有限公司 Vehicle recognition methods, apparatus and system again
CN109165589A (en) * 2018-08-14 2019-01-08 北京颂泽科技有限公司 Vehicle based on deep learning recognition methods and device again
CN109189970A (en) * 2018-09-20 2019-01-11 北京京东尚科信息技术有限公司 Picture similarity comparison method and device
CN109815924A (en) * 2019-01-29 2019-05-28 成都旷视金智科技有限公司 Expression recognition method, device and system
CN110298240A (en) * 2019-05-21 2019-10-01 北京迈格威科技有限公司 A kind of user vehicle recognition methods, device, system and storage medium
CN110309880A (en) * 2019-07-01 2019-10-08 天津工业大学 An Attention Mechanism-Based CNN-Based Image Classification Method for 5-Day and 9-Day Hatching Egg Embryos

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
ASHISH VASWANI ET AL: "Attention Is All You Need", 《31ST CONFERENCE ON NEURAL INFORMATION PROCESSING SYSTEMS (NIPS 2017)》, pages 105 - 108 *
SANGHYUN WOO ET AL: "CBAM: Convolutional Block Attention Module", 《ARXIV》, pages 1 - 17 *
张琳 等: "一种改进的视频分割网络及其全局信息优化方法", 《自动化学报》, pages 1 - 11 *
陈旭东 等: "基于 SoC FPGA 和 CNN 模型的动作识别系统设计", 《电子技术应用 》, vol. 45, no. 2, pages 97 - 108 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177533A (en) * 2021-05-28 2021-07-27 济南博观智能科技有限公司 Face recognition method and device and electronic equipment
CN113177533B (en) * 2021-05-28 2022-09-06 济南博观智能科技有限公司 Face recognition method and device and electronic equipment
CN118015343A (en) * 2024-01-18 2024-05-10 中移信息系统集成有限公司 Image filtering method, device and electronic equipment
CN119714104A (en) * 2024-12-23 2025-03-28 中咨数据有限公司 Quick comparison and judgment method for slope deformation without targets

Also Published As

Publication number Publication date
CN112733578B (en) 2024-05-24

Similar Documents

Publication Publication Date Title
CN107767405B (en) Nuclear correlation filtering target tracking method fusing convolutional neural network
Jung et al. ResNet-based vehicle classification and localization in traffic surveillance systems
WO2021238281A1 (en) Neural network training method, image classification system, and related device
CN113159073B (en) Knowledge distillation method and device, storage medium and terminal
CN114241282A (en) Knowledge distillation-based edge equipment scene identification method and device
CN109325418A (en) Pedestrian recognition method in road traffic environment based on improved YOLOv3
CN107563372A (en) A kind of license plate locating method based on deep learning SSD frameworks
CN111340850A (en) Ground target tracking method of unmanned aerial vehicle based on twin network and central logic loss
CN110728294A (en) Cross-domain image classification model construction method and device based on transfer learning
CN112434599B (en) Pedestrian re-identification method based on random occlusion recovery of noise channel
CN114419672A (en) Cross-scene continuous learning pedestrian re-identification method and device based on consistency learning
CN108664844A (en) Image target semantic recognition and tracking of convolutional deep neural network
CN114202743A (en) Small object detection method based on improved faster-RCNN in autonomous driving scenarios
CN106415594A (en) A method and a system for face verification
CN106022273A (en) Handwritten form identification system of BP neural network based on dynamic sample selection strategy
CN104717468B (en) Cluster scene intelligent monitoring method and system based on the classification of cluster track
CN111079847A (en) Remote sensing image automatic labeling method based on deep learning
CN112733578B (en) Vehicle re-identification method and system
CN113792606A (en) A low-cost self-supervised pedestrian re-identification model building method based on multi-target tracking
CN111612100B (en) Object re-identification method, device, storage medium and computer equipment
CN113516227A (en) Neural network training method and device based on federal learning
CN114742224A (en) Pedestrian re-identification method, device, computer equipment and storage medium
KR102842348B1 (en) Method for semi-supervised learning of a neural network and object detection within images using the trained neural network, and a computing device that performs the same
CN112861840A (en) Complex scene character recognition method and system based on multi-feature fusion convolutional network
CN115424090A (en) Target re-identification method and its model acquisition method, device and terminal equipment

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