Vehicle re-identification method, device, storage medium and electronic device
Through the self-supervised learning algorithm and noise contrast estimation algorithm, combined with global and local feature detection networks, the problem of lack of annotation data in vehicle re-identification is solved, and the accuracy and efficiency of vehicle re-identification are improved.
Patent Information
- Application Number
- CN202210124381.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-10
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-02-10
AI Technical Summary
Due to the lack of annotation data required for training the model, the existing vehicle re-identification technology has a low accuracy of vehicle re-identification results, and it is difficult to label all types of data in a changing traffic vehicle environment, resulting in poor prediction performance of the model. Poor.
Use a self-supervised learning algorithm to learn the features of unknown vehicle images, determine the noise data and real data in the features through a noise contrast estimation algorithm, build a vehicle re-identification attribute knowledge base, and use global feature detection network, local feature detection network and attribute feature detection Network fusion recognition results reduce the use of annotated data.
It improves the accuracy of vehicle re-identification, enables instance learning without annotated data, extracts high-quality features, and uses a smaller amount of annotated data to train the model, which improves the accuracy and efficiency of vehicle re-identification.
Smart Images

Figure CN114463707B_ABST
Abstract
Description
Background Art
[0002] In recent years, computer vision has developed rapidly and has been applied in many fields. However, the actual application of vehicle re-identification technology still needs to be improved. Under different traffic cameras, even the same vehicle will produce different images due to different lighting, angles, and resolutions. At present, the cost of annotating data required for training models is high, and in a changing traffic vehicle environment, the data is numerous and it is difficult to annotate all types of data. The current supervised learning model mainly relies on annotated data for training, and the model is less effective when making predictions based on data outside the training range.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The purpose of the present disclosure is to provide a vehicle re-identification method, device, storage medium and electronic device, which can at least to some extent overcome the problem in vehicle re-identification technology that the accuracy of vehicle re-identification results is not high due to the lack of labeled data required for training models.
[0005] According to a first aspect of the present disclosure, a vehicle re-identification method is provided, comprising: acquiring an unknown vehicle image; learning features of the unknown vehicle image based on a self-supervised learning algorithm; training a vehicle re-identification model using some of the features of the unknown vehicle image and labels of the some of the features; and using the vehicle re-identification model to identify a vehicle image to be detected, obtaining a vehicle identification result, so as to identify an image of a target vehicle from the vehicle image to be detected.
[0006] Optionally, the vehicle re-identification method also includes: after learning the features of the unknown vehicle image based on a self-supervised learning algorithm, constructing a vehicle re-identification attribute knowledge base according to the features of the unknown vehicle image; wherein the vehicle re-identification attribute knowledge base includes at least one of the following vehicle features: license plate, interior decoration, vehicle model, tire type, vehicle color and body logo.
[0007] Optionally, the vehicle re-identification method includes: after learning the features of the unknown vehicle image based on a self-supervised learning algorithm, labeling the partial features to obtain labels corresponding to each feature in the partial features, wherein the labels include a vehicle identification and at least one of the above vehicle features.
[0008] Optionally, in the process of learning the features of the unknown vehicle image based on the self-supervised learning algorithm, the noise data and the real data in the features of the unknown vehicle image are determined by a noise contrast estimation algorithm.
[0009] Optionally, learning the features of the unknown vehicle image based on a self-supervised learning algorithm includes: in the process of learning the features of the unknown vehicle image based on the self-supervised learning algorithm, storing the learned features of the vehicle image in a pre-established discrete memory block; obtaining the features of the unknown vehicle image from the discrete memory block each time the probability of the features of the unknown vehicle image to the unknown vehicle image is calculated; calculating the probability that the features of each unknown vehicle image correspond to the unknown vehicle image based on the features of each unknown vehicle image obtained from the discrete memory block; and determining whether the features of each unknown vehicle image are noise data or real data based on the probability.
[0010] Optionally, the vehicle re-identification model includes: a global feature detection network, a local feature detection network and an attribute feature detection network; using the vehicle re-identification model to identify the vehicle image to be detected to identify the image of the target vehicle from the vehicle image to be detected, including: inputting the image to be detected into the vehicle re-identification model; obtaining a first classification retrieval result output by the global feature detection network, a second classification retrieval result output by the local feature detection network and a third classification retrieval result output by the attribute feature detection network; fusing the first classification retrieval result, the second classification retrieval result and the third classification retrieval result to obtain the vehicle identification result.
[0011] Optionally, obtaining an unknown vehicle image includes: obtaining an unknown vehicle image captured by different traffic cameras.
[0012] According to a second aspect of the present disclosure, a vehicle re-identification device is also provided, including: an acquisition module for acquiring an unknown vehicle image; a learning module for learning features of the unknown vehicle image based on a self-supervised learning algorithm; a training module for training a vehicle re-identification model using some of the features of the unknown vehicle image and labels of the some of the features; and a recognition module for using the vehicle re-identification model to recognize a vehicle image to be detected, so as to recognize an image of a target vehicle from the vehicle image to be detected.
[0013] According to a third aspect of the present disclosure, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the vehicle re-identification methods provided in the embodiments of the present disclosure by executing the executable instructions.
[0014] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the vehicle re-identification methods provided in the embodiments of the present disclosure is implemented.
[0015] The vehicle re-identification method, device, storage medium and electronic device of the disclosed embodiments learn the features of unknown vehicle images through a self-supervised learning algorithm, can directly use unlabeled vehicle data for example learning, learn meaningful visual features of vehicles, and use them to distinguish the similarities and differences between the visual features of vehicles, so as to extract high-quality features of vehicles. The vehicle re-identification model is trained using some features of the features of unknown vehicle images and the labels of the features, and a vehicle re-identification model can be obtained by training with a small amount of labeled data. The trained vehicle re-identification model is used to identify the vehicle image to be detected to obtain a vehicle identification result, and the image of the target vehicle is identified from the vehicle image to be detected, thereby improving the accuracy of vehicle re-identification.
[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0018] Figure 1 is a flow chart of a vehicle re-identification method in an exemplary embodiment of the present disclosure;
[0019] Figure 2 is a flow chart of a vehicle re-identification method in an exemplary embodiment of the present disclosure;
[0020] Figure 3 is a flow chart of a vehicle re-identification method in an exemplary embodiment of the present disclosure;
[0021] Figure 4 is a schematic diagram of a training process of a vehicle re-identification model in an exemplary embodiment of the present disclosure;
[0022] Figure 5 is a schematic structural diagram of a vehicle re-identification device in an exemplary embodiment of the present disclosure; and
[0023] Figure 6 It is a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0025] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0026] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0027] Before describing the vehicle re-identification method of the present disclosure, the vehicle re-identification technology involved in the present disclosure is first described.
[0028] Vehicle re-identification refers to the technology of finding a specified vehicle in images taken by different cameras. It has a strong application scenario in intelligent video surveillance systems and can track the trajectory of the target and find the target's location.
[0029] Self-supervised learning, self-supervised learning mainly uses auxiliary tasks (pretext) to mine its own supervisory information from large-scale unsupervised data, and trains the network through this constructed supervisory information, so as to learn representations that are valuable for downstream tasks.
[0030] At present, in vehicle re-identification technology, in addition to the development obstacles brought by the lack of labeled data required for training models, the size of the hardware required for model training also hinders the training of the model. When there are many training image categories, such as reaching millions of vehicle images, the memory required for parameter training will be very large, which requires more expensive hardware equipment to meet the model training requirements, such as millions of data, which is difficult to achieve in many cases. In addition, the application of self-supervised learning in the field of vehicle re-identification is mostly clustering, and the accuracy is far from meeting the actual use requirements. Finally, in related technologies, there is also a way to use unsupervised learning to label data and then use it for transfer learning, but the quality of unsupervised labeling data needs to be improved, and incorrect labeling will affect the training effect of subsequent supervised learning models, and still cannot improve the vehicle re-identification effect.
[0031] Based on the above problems, the present disclosure provides a vehicle re-identification method. Figure 1 FIG. 1 is a flow chart of a vehicle re-identification method in an exemplary embodiment of the present disclosure. Figure 1 As shown, the method provided by the embodiment of the present disclosure may include the following steps.
[0032] In step S102, an unknown vehicle image is acquired;
[0033] In the embodiment of the present disclosure, the unknown vehicle image may include images captured by different traffic cameras, which may include multiple vehicles, one vehicle, or no vehicles. The embodiment of the present disclosure aims to identify an image containing a target vehicle based on the acquired images. In the embodiment of the present disclosure, the unknown vehicle image may be an unlabeled image captured by different traffic cameras.
[0034] In step S104, learning the features of the unknown vehicle image based on a self-supervised learning algorithm;
[0035] In the embodiment of the present disclosure, the self-supervised learning algorithm takes the contrastive learning algorithm as an example, wherein the contrastive learning algorithm does not necessarily pay attention to every detail of the sample, but learns the features that can distinguish other samples (i.e., the features of the unknown vehicle image in the embodiment of the present disclosure). The core of contrastive learning is to learn a mapping f, encode the sample x into its representation f(x), so that this f satisfies the following relationship (1):
[0036] s(f(x), f(x + ))>>s(f(x),f(x - ))(1)
[0037] In the above formula, x + is a sample similar to x, x -is a sample that is not similar to x, and s(.,.) is a function that measures the similarity between samples. In the subsequent embodiments of the present disclosure, samples that are similar to the target to be identified are called "real data" and samples that are not similar to the target to be identified are called "noise data".
[0038] In the disclosed embodiment, the self-supervised model is based on instance-level learning, rather than category-based learning in supervised learning. Each vehicle image can be regarded as a unique instance to learn its similarities and differences with other instances. Using this self-supervised learning method, based on a large number of unlabeled vehicle images, the model can autonomously learn the similarity and difference features between vehicle data, and learn the high-quality visual features of the vehicle.
[0039] In an exemplary embodiment, a SOTA (state-of-the-art) convolutional neural network can be selected as a representation learning extractor to learn high-quality features. For example, Vit-G / 14 can be selected as a feature extractor to achieve better feature extraction effects.
[0040] In step S106, a vehicle re-identification model is trained using some of the features of the unknown vehicle image and labels of the some of the features;
[0041] In an exemplary embodiment, labeled vehicle data can be obtained by manually labeling a small number of features in the unknown vehicle image obtained by self-supervised learning, and a supervised vehicle re-identification model can be trained using the labeled vehicle data to obtain a trained vehicle re-identification model.
[0042] In step S108, the vehicle re-identification model is used to identify the image of the vehicle to be detected, so as to identify the image of the target vehicle from the image of the vehicle to be detected.
[0043] Among them, the image of the vehicle to be detected includes the image of the target vehicle. The purpose of vehicle re-identification is to identify the image of the target vehicle from multiple vehicle images. In an embodiment of the present disclosure, the image of the vehicle to be detected can be input into a trained vehicle re-identification model to obtain a vehicle recognition result output by the vehicle re-identification model, wherein the vehicle recognition result may include the classification of the image of the target vehicle and the classification of the image of the non-target vehicle, or the recognition result may further include the attribute information of the vehicle. Exemplarily, the attribute information of the vehicle may include one or more of the license plate, interior decoration, vehicle model, tire type, vehicle color and body logo.
[0044] The vehicle re-identification method of the disclosed embodiment learns the features of unknown vehicle images through a self-supervised learning algorithm, and can directly use unlabeled vehicle data for example learning to learn meaningful visual features of vehicles, which are used to distinguish the similarities and differences between the visual features of vehicles, and can extract high-quality features of vehicles. The vehicle re-identification model is trained using some features of the features of the unknown vehicle image and the labels of the some features, and a vehicle re-identification model can be obtained by training with a small amount of labeled data. The trained vehicle re-identification model is used to identify the vehicle image to be detected, and the image of the target vehicle is identified from the vehicle image to be detected, thereby improving the accuracy of vehicle re-identification.
[0045] Figure 2 is a flow chart of a vehicle re-identification method according to an exemplary embodiment of the present disclosure, Figure 2 As shown, this method Figure 1 Based on the method shown, it can further include:
[0046] In step S202, after learning the features of the unknown vehicle image based on the self-supervised learning algorithm, a vehicle re-identification attribute knowledge base is constructed according to the features of the unknown vehicle image;
[0047] In the embodiments of the present disclosure, the attributes of the vehicle may be divided in detail according to different characteristics of the vehicle, and an attribute knowledge base for the vehicle may be created.
[0048] The vehicle re-identification attribute knowledge base may include at least one of the following vehicle features: license plate, interior decoration, vehicle model, tire type, vehicle color, and vehicle body logo.
[0049] It should be noted that the above vehicle characteristics are only examples, and the vehicle characteristics in the embodiments of the present disclosure may also include other attribute characteristics of the vehicle, which are not listed one by one here.
[0050] In one or more embodiments of the present disclosure, the vehicle re-identification method may further include: after learning the features of the unknown vehicle image based on a self-supervised learning algorithm, labeling the partial features to obtain labels corresponding to each feature in the partial features, wherein the labels include a vehicle identification and at least one of the above vehicle features.
[0051] In an exemplary embodiment, the labels of some features used to train the vehicle re-identification model may include only the vehicle identification, or the labels of some features may include the vehicle identification and at least one of the above vehicle features.
[0052] In an exemplary embodiment, after learning the features of a large number of unknown vehicle images based on an unsupervised learning algorithm, only a small number of features among the large number of features may be manually annotated, such as only the vehicle ID (identification) to which the small number of features belong may be annotated. Based on this, when the vehicle re-identification model trained based on the annotated vehicle data detects unknown vehicle images, the output of the model may include the vehicle identification. Alternatively, at least one vehicle feature among the license plate, interior decoration, vehicle model, tire type, vehicle color, and vehicle body logo corresponding to the small number of features may be further annotated. Based on this, when the vehicle re-identification model trained based on the annotated vehicle data detects unknown vehicle images, the output of the model may include at least one of the above vehicle features in addition to the vehicle identification.
[0053] In an exemplary embodiment, during the process of training a vehicle re-identification model, the supervised vehicle re-identification model is trained using labeled vehicle data and vehicle features in a vehicle attribute knowledge base. This allows the vehicle's attribute information to be further obtained based on identifying the image of the target vehicle from the image of the vehicle to be detected when the vehicle re-identification model is used to detect the vehicle image to be detected.
[0054] In traditional supervised learning, the softmax function (normalized exponential function) is used for classification, and wi is used as the class weight. When the number of classes n is very large, for example, when the number of classes n is in the millions, in each round of training, the probability P(i|v) needs to be calculated based on the following formula (2). Softmax will calculate more than one million parameters, so the memory usage cost is very high.
[0055]
[0056] In the above formula (2), the probability of event i occurring is P(i|v), where v represents the input image feature, w represents the weight, and n represents the number of samples.
[0057] In an exemplary embodiment, in order to reduce the calculation of parameters during training, the NCE (Noise-Contrastive Estimation) algorithm can be used to convert the multi-classification task into a series of binary classification tasks. In one or more embodiments of the present disclosure, the binary classification task is used to determine whether the sample comes from real data or noise data, that is, the binary classification task is used to distinguish the similarity features of the target data and the features of the non-target data, where the noise data refers to the features of the non-target data. Using the NCE algorithm, instance-level classification can be regarded as a metric learning problem, where the distance (similarity) between instances can be calculated directly from the features in a non-parametric manner. In other words, the features of each instance can be stored in discrete memory blocks instead of weights in the network. Specifically, the weight parameter w is no longer used, but the probability of the feature representation v corresponding to the i-th instance is used. The NCE formula is shown in the following formula (3):
[0058]
[0059] In the above formula (3), the probability of event i occurring is P(i|v), where v represents the input image feature, n represents the number of samples, and τ represents the temperature parameter.
[0060] In one or more embodiments of the present disclosure, in the process of learning the features of the unknown vehicle image based on the self-supervised learning algorithm, the noise data and the real data in the features of the unknown vehicle image can be determined by the NCE algorithm.
[0061] Figure 3 is a flow chart of a vehicle re-identification method according to an exemplary embodiment of the present disclosure, Figure 3 As shown, in one or more embodiments of the present disclosure, learning the features of the unknown vehicle image based on a self-supervised learning algorithm may include:
[0062] In step S1042, in the process of learning the features of the unknown vehicle image based on the self-supervised learning algorithm, the learned features of the vehicle image are stored in discrete memory blocks;
[0063] In step S1044, each time the probability of the feature of the unknown vehicle image to the unknown vehicle image is calculated, the feature of the unknown vehicle image is obtained from the discrete memory block;
[0064] In step S1046, the probability that the feature of each unknown vehicle image corresponds to the unknown vehicle image is calculated based on the feature of each unknown vehicle image obtained from the discrete memory block;
[0065] In step S1048, the feature of each unknown vehicle image is determined to be noise data or real data according to the probability.
[0066] In an exemplary embodiment, when calculating the probability P(i|v) that the features of each unknown vehicle image correspond to the unknown vehicle image, the features v of all images need to be used each time. In order to avoid the need to calculate the features v of each image each time the probability P(i|v) is calculated, a memory bank (feature group, which is an example of the above-mentioned vehicle feature attribute knowledge base) can be pre-established to store the features v of each image. In each iteration of model training, the learning features fi and network parameters θ can be optimized by stochastic gradient descent. Then, the feature group is updated in its corresponding instance. Optionally, the features in the feature group can be initialized as random unit vectors.
[0067] When calculating the probability that the features of each unknown vehicle image correspond to the unknown vehicle image, the features of the unknown vehicle image are obtained from the pre-established discrete memory blocks, which can avoid the need to calculate the features of all images every time the network is updated when using parameters and training, greatly reducing the memory required for model training. For example, with millions of images, model training only requires hundreds of megabytes of memory.
[0068] In one or more embodiments of the present disclosure, the vehicle re-identification model may include:
[0069] Global Feature Network (GFN), Part Feature Network (PFN) and Attribute Feature Network (AFN);
[0070] In an exemplary embodiment, the global feature detection network is responsible for the overall vehicle identification task, such as retrieving an image containing target vehicle data based on an input image and utilizing the global information of the image; the local feature detection network is responsible for dividing the global image into blocks to detect local areas of the image, such as extracting local features of the vehicle and retrieving an image containing target vehicle data; the attribute feature detection network is responsible for the key attribute detection task of the vehicle, such as outputting the classification information of the vehicle based on the attribute information of the vehicle.
[0071] In an embodiment of the present disclosure, feature maps generated from features of vehicle images obtained based on self-supervised learning can be input into a global feature detection network, a local feature detection network, and an attribute feature detection network, respectively, to train the global feature detection network, the local feature detection network, and the attribute feature detection network.
[0072] In an exemplary embodiment, the above-mentioned feature map and part or all of the vehicle features in a pre-established vehicle attribute feature knowledge base can also be input into the global feature detection network, the local feature detection network and the attribute feature detection network to train the global feature detection network, the local feature detection network and the attribute feature detection network.
[0073] Using the vehicle re-identification model to identify the image of the vehicle to be detected to obtain a vehicle identification result, so as to identify the image of the target vehicle from the image of the vehicle to be detected, may include:
[0074] The vehicle image to be detected is input into the vehicle re-identification model; for example, the vehicle image to be detected is input into the global feature detection network, the local feature detection network and the attribute feature detection network respectively.
[0075] Obtaining a first classification retrieval result output by the global feature detection network, a second classification retrieval result output by the local feature detection network, and a third classification retrieval result output by the attribute feature detection network;
[0076] The first classification retrieval result, the second classification retrieval result and the third classification retrieval result are merged to obtain the vehicle recognition result.
[0077] In an exemplary embodiment, the global feature detection network, the local feature detection network, and the attribute feature detection network each output a classification retrieval result. By integrating the classification retrieval results output by the global feature detection network, the local feature detection network, and the attribute feature detection network, a final vehicle recognition result can be obtained, and the image of the target vehicle can be recognized from a large number of vehicle images to be detected.
[0078] In an embodiment of the present disclosure, the final classification result obtained by the vehicle re-identification model may include the class to which the image of the target vehicle belongs, and the class to which the image of the non-target vehicle belongs.
[0079] Exemplarily, when the first category retrieval results, the second category retrieval results and the third category retrieval results are fused, homoscedastic uncertainty can be introduced to assign weights to each detection result, and then the first category retrieval results, the second category retrieval results and the third category retrieval results are weighted and summed to obtain the final classification results.
[0080] In one or more embodiments of the present disclosure, acquiring an unknown vehicle image may include:
[0081] Get unknown vehicle images collected by different traffic cameras.
[0082] In an exemplary embodiment, images captured by multiple traffic cameras in a period of time may be collected as samples. In addition, images captured by multiple traffic cameras in different time periods may also be collected. The multiple traffic cameras may be traffic cameras in different geographical areas or traffic cameras in a certain geographical area.
[0083] The following combination Figure 4 The training process of the vehicle re-identification model according to the embodiment of the present disclosure is exemplified.
[0084] like Figure 4 As shown, in step S402, a large number of images captured by different traffic cameras are collected;
[0085] In step S404, self-supervised parameter-free training is performed on the image collected in step S402 to obtain high-quality vehicle features;
[0086] Specifically, during the self-supervised parameter-free training process, the SOTA convolutional neural network can be selected as a representation learning extractor to learn high-quality vehicle features. For example, Vit-G / 14 can be selected as a feature extractor. Vit-G / 14 has a better feature extraction effect and can improve the quality of the extracted vehicle features. In addition, during the self-supervised parameter-free training process, the NCE algorithm and the vehicle feature group can be used to store features during training, avoiding the use of parameters and all parameter calculations performed for each network update during training, so as to significantly reduce the memory required for model training.
[0087] In step S406, a vehicle feature group is established;
[0088] Specifically, the attributes of the vehicle may be divided in detail in advance to establish a vehicle feature group, so that the vehicle features in the vehicle feature group may be applied during the vehicle re-identification process.
[0089] In step S408, the feature extraction part of the self-supervised model is applied to the supervised model;
[0090] Specifically, the feature extraction part of the self-supervised model can be applied to the supervised model as a feature extractor to extract high-quality features of the vehicle.
[0091] In step S410, some labeled vehicle data is collected as input of a supervised model to train a vehicle re-identification model;
[0092] like Figure 4As shown, the feature extraction part of the self-supervised model is followed by a global vehicle detection network 412, a vehicle local detection network 414, and a vehicle attribute detection network 416. After the labeled data are input into the three detection networks, the three detection networks are trained. During the detection process, the three detection networks use the features of the vehicles in the vehicle feature group to detect the vehicle image, and obtain the detection results respectively. The detection results obtained by the three detection networks are fused to obtain the final detection result 418.
[0093] The disclosed embodiment also provides a vehicle re-identification device, Figure 5 is a schematic diagram of the structure of the device, such as Figure 5 As shown, the device 510 includes:
[0094] An acquisition module 512 is used to acquire an unknown vehicle image;
[0095] A learning module 514, configured to learn features of the unknown vehicle image based on a self-supervised learning algorithm;
[0096] A training module 516, configured to train a vehicle re-identification model using some of the features of the unknown vehicle image and labels of the some of the features;
[0097] The recognition module 518 is used to use the vehicle re-recognition model to recognize the image of the vehicle to be detected, obtain a vehicle recognition result, and recognize the image of the target vehicle from the image of the vehicle to be detected.
[0098] In one or more embodiments of the present disclosure, the vehicle re-identification device may further include:
[0099] A construction module, configured to construct a vehicle re-identification attribute knowledge base according to the features of the unknown vehicle image after learning the features of the unknown vehicle image based on a self-supervised learning algorithm;
[0100] The vehicle re-identification attribute knowledge base includes at least one of the following vehicle features:
[0101] License plates, interior decorations, vehicle model, tire type, vehicle color and body logos.
[0102] In one or more embodiments of the present disclosure, the vehicle re-identification device may further include: a labeling model, which is used to label the partial features after learning the features of the unknown vehicle image based on the self-supervised learning algorithm, and obtain the labels corresponding to each feature in the partial features, wherein the labels include the vehicle identification and at least one of the above vehicle features. The labels of the partial features include the vehicle identification and at least one of the above vehicle features.
[0103] In one or more embodiments of the present disclosure, the learning module may be specifically used to determine noise data and real data in the features of the unknown vehicle image through a noise contrast estimation algorithm during the process of learning the features of the unknown vehicle image based on a self-supervised learning algorithm.
[0104] In one or more embodiments of the present disclosure, the above learning module may be specifically used for:
[0105] In the process of learning the features of the unknown vehicle image based on the self-supervised learning algorithm, the learned features of the vehicle image are stored in a pre-established discrete memory block;
[0106] Acquire the feature of the unknown vehicle image from the discrete memory block each time the probability of the feature of the unknown vehicle image to the unknown vehicle image is calculated;
[0107] Calculating the probability that the feature of each unknown vehicle image corresponds to the unknown vehicle image based on the feature of each unknown vehicle image obtained from the discrete memory block;
[0108] The feature of each unknown vehicle image is determined to be noise data or real data according to the probability.
[0109] In one or more embodiments of the present disclosure, the vehicle re-identification model may include:
[0110] Global feature detection network, local feature detection network and attribute feature detection network;
[0111] The identification module can be specifically used for:
[0112] Inputting the image to be detected into the vehicle re-identification model;
[0113] Obtaining a first classification retrieval result output by the global feature detection network, a second classification retrieval result output by the local feature detection network, and a third classification retrieval result output by the attribute feature detection network;
[0114] The first classification retrieval result, the second classification retrieval result and the third classification retrieval result are merged to obtain the vehicle recognition result.
[0115] In an embodiment of the present disclosure, the final classification result obtained by the vehicle re-identification model may include the class to which the image of the target vehicle belongs, and the class to which the image of the non-target vehicle belongs.
[0116] In one or more embodiments of the present disclosure, the acquisition module may be specifically used for:
[0117] Get unknown vehicle images collected by different traffic cameras.
[0118] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0119] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present invention is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0120] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).
[0121] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 Step S102 shown in: acquiring an unknown vehicle image; step S104: learning features of the unknown vehicle image based on a self-supervised learning algorithm; step S106: training a vehicle re-identification model using some of the features of the unknown vehicle image and labels of the some of the features; step S108: using the vehicle re-identification model to identify the vehicle image to be detected, obtaining a vehicle identification result, so as to identify the image of the target vehicle from the vehicle image to be detected.
[0122] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0123] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0124] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0125] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0126] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0127] A program product for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0128] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0129] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0130] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0131] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0132] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0133] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0134] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0135] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A vehicle re-identification method, It is characterized in that include: Obtain unknown vehicle images; learning features of the unknown vehicle image based on a self-supervised learning algorithm; After learning the features of the unknown vehicle image based on the self-supervised learning algorithm, a vehicle re-identification attribute knowledge base is constructed according to the features of the unknown vehicle image; wherein the vehicle re-identification attribute knowledge base includes at least one of the following vehicle features: License plate, interior decorations, vehicle model, tire type, vehicle color and body logos; After learning the features of the unknown vehicle image based on the self-supervised learning algorithm, annotating some of the features to obtain labels corresponding to each feature in the some of the features, wherein the labels include a vehicle identification and at least one of the above vehicle features; Using the partial features and labels of the partial features in the features of the unknown vehicle image to train a vehicle re-identification model; The vehicle re-identification model is used to identify the vehicle image to be detected to obtain a vehicle identification result, so as to identify the image of the target vehicle from the vehicle image to be detected.
2. The vehicle re-identification method according to claim 1, It is characterized in that In the process of learning the features of the unknown vehicle image based on the self-supervised learning algorithm, noise data and real data in the features of the unknown vehicle image are determined by a noise contrast estimation algorithm.
3. The vehicle re-identification method according to claim 2, It is characterized in that Learning the features of the unknown vehicle image based on a self-supervised learning algorithm includes: In the process of learning the features of the unknown vehicle image based on the self-supervised learning algorithm, the learned features of the vehicle image are stored in discrete memory blocks; Acquire the feature of the unknown vehicle image from the discrete memory block each time the probability of the feature of the unknown vehicle image to the unknown vehicle image is calculated; Calculating the probability that the feature of each unknown vehicle image corresponds to the unknown vehicle image based on the feature of each unknown vehicle image obtained from the discrete memory block; The feature of each unknown vehicle image is determined to be noise data or real data according to the probability.
4. The vehicle re-identification method according to claim 1, It is characterized in that The vehicle re-identification model includes: Global feature detection network, local feature detection network and attribute feature detection network; Using the vehicle re-identification model to identify the image of the vehicle to be detected, so as to identify the image of the target vehicle from the image of the vehicle to be detected, includes: Inputting the image to be detected into the vehicle re-identification model; Obtaining a first classification retrieval result output by the global feature detection network, a second classification retrieval result output by the local feature detection network, and a third classification retrieval result output by the attribute feature detection network; The first classification retrieval result, the second classification retrieval result and the third classification retrieval result are merged to obtain the vehicle recognition result.
5. The vehicle re-identification method according to any one of claims 1 to 4, It is characterized in that Get unknown vehicle images, including: Get unknown vehicle images collected by different traffic cameras.
6. A vehicle re-identification device, It is characterized in that include: An acquisition module, used to acquire an unknown vehicle image; A learning module, for learning the features of the unknown vehicle image based on a self-supervised learning algorithm, and after learning the features of the unknown vehicle image based on the self-supervised learning algorithm, constructing a vehicle re-identification attribute knowledge base according to the features of the unknown vehicle image; wherein the vehicle re-identification attribute knowledge base includes at least one of the following vehicle features: license plate, interior ornaments, vehicle model, tire type, vehicle color, and vehicle body logo; after learning the features of the unknown vehicle image based on the self-supervised learning algorithm, annotating some of the features to obtain labels corresponding to each feature in the some of the features, wherein the labels include a vehicle identification and at least one of the above vehicle features; A training module, used for training a vehicle re-identification model using some of the features of the unknown vehicle image and labels of the some of the features; The recognition module is used to use the vehicle re-recognition model to recognize the image of the vehicle to be detected, obtain a vehicle recognition result, and recognize the image of the target vehicle from the image of the vehicle to be detected.
7. An electronic device, It is characterized in that include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to perform the vehicle re-identification method described in any one of claims 1 to 5 by executing the executable instructions.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the vehicle re-identification method according to any one of claims 1 to 5 is implemented.
