A night vehicle re-identification method based on average precision loss function

By constructing a nighttime vehicle re-identification dataset and using a neural network model based on the average precision loss function, the problem of low recognition accuracy caused by insufficient lighting in nighttime vehicle re-identification was solved, and high-precision vehicle matching in nighttime scenes was achieved.

CN116343140BActive Publication Date: 2025-12-16HANGZHOU ZHONGKE TONGXIN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310212777.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2025-12-16
Estimated Expiration
2043-03-06

AI Technical Summary

Technical Problem

Existing vehicle re-identification technologies have low accuracy in nighttime scenes, mainly due to insufficient lighting causing blurred vehicle appearance features and uneven brightness, which affects recognition accuracy.

Method used

A nighttime vehicle re-identification dataset was constructed, and a neural network model based on the average precision loss function was used for training. By metric learning and optimizing the parameters of the neural network model, the accuracy of vehicle matching was improved.

Benefits of technology

The accuracy and matching precision of vehicle recognition in nighttime scenarios have been improved. An image dataset with data diversity has been constructed, the interference of lighting changes on recognition has been resolved, and the parameters of the neural network model have been optimized, resulting in a higher accuracy of the sorting list of images with the same identity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116343140B_ABST
    Figure CN116343140B_ABST
Patent Text Reader

Abstract

The application discloses a kind of night vehicle re-identification methods based on average precision loss function, specifically includes: collection night video and extract effective video frame;Effective image is detected from effective video frame, so as to obtain the vehicle bounding box corresponding to vehicle in effective image;Vehicle graphics is cut based on the coordinates of vehicle bounding box, so as to obtain night vehicle dataset;Night vehicle dataset is labeled and classified to night vehicle dataset;Night vehicle dataset is input to neural network model and is measured learning and average precision optimization, so as to optimize neural network model, the vehicle image to be inquired in test set is input to the optimized neural network model, so as to obtain the ranking list of vehicle image in test gallery;The night vehicle re-identification method based on average precision loss function proposed in the application is trained by inputting night scene image, and mAP is directly optimized in the training process, which greatly improves the accuracy of night re-identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image retrieval, and more specifically to a nighttime vehicle re-identification method based on an average precision loss function. Background Technology

[0002] Vehicle re-identification is a technology that involves matching surveillance video feeds of the same vehicle from cameras at different locations and from different perspectives in order to identify the target vehicle. It has wide applications in intelligent transportation systems, public security criminal investigation, and information security.

[0003] Traditional vehicle classification, as discussed by Zehang Sun and ETreppid in their paper "On-road vehicle detection: a review," presents a challenge in vehicle re-identification. The goal is to identify a specific vehicle among a group of similar-looking vehicles, making the task even more difficult. Furthermore, in real-world scenarios, potential visual factors such as lighting, resolution, and weather can severely negatively impact vehicle re-identification. Based on the lighting sources in publicly available datasets, this can be categorized into vehicle re-identification tasks based on daytime scenes and those based on nighttime scenes.

[0004] With the introduction of vehicle re-identification datasets (such as Veri-776, VehicleID, and VARI), vehicle re-identification technology has developed rapidly in the past two years, attracting a large number of scholars to conduct research. Existing techniques include using a "PROVID" vehicle re-identification model, employing visual features, license plates, and spatiotemporal information to explore the vehicle re-identification task. Alternatively, a two-stage framework can be used, which combines complex spatiotemporal information to effectively normalize the vehicle re-identification results. Another approach employs a multi-view reasoning scheme to generate feature representations of the global view to improve the accuracy of vehicle re-identification.

[0005] However, current vehicle re-identification research largely relies on daytime lighting datasets to search for vehicles in image and video series. Therefore, current methods are applicable only to daytime scenes and rarely consider nighttime scenes in real-world surveillance environments. In low-light conditions such as at night, insufficient illumination blurs the appearance of suspicious vehicles. Furthermore, the distance between light sources and vehicles at the same location varies, causing uneven brightness across different areas of the image. This creates a discrepancy between the suspicious vehicle and the background, significantly reducing recognition accuracy. Therefore, in target monitoring and search systems for nighttime scenes, improving vehicle matching accuracy is crucial for successful vehicle re-identification. Summary of the Invention

[0006] To overcome the shortcomings of the above technologies, this invention provides a nighttime vehicle re-identification method based on the average precision loss function. By constructing a vehicle re-identification dataset for nighttime scenes and performing specific vehicle retrieval based on the average precision loss function, the method directly optimizes the average accuracy of all classes during training to improve the accuracy of recognition. This solves the problem that the average accuracy of all classes is reduced due to the bright spots caused by streetlights and car lights under nighttime surveillance cameras, as well as the large appearance changes caused by background changes in dynamic scenes.

[0007] The technical solution adopted by this invention to overcome its technical problems is as follows: This invention proposes a nighttime vehicle re-identification method based on an average precision loss function, specifically including: S1, acquiring nighttime video and extracting valid video frames; S2, detecting valid images from the valid video frames to obtain vehicle bounding boxes corresponding to vehicles in the valid images; S3, cropping vehicle images in the valid images based on the coordinates of the vehicle bounding boxes to obtain a nighttime vehicle dataset; S4, labeling the nighttime vehicle dataset with vehicle IDs and camera IDs, and classifying all vehicle images in the nighttime vehicle dataset; S5, dividing the classified nighttime vehicle dataset into a training set and a test set; S6, inputting the training set into a neural network model, and performing metric learning and average precision optimization on the neural network model to optimize the neural network model; S7, inputting the query vehicle images from the test set into the optimized neural network model to obtain a sorted list of image library vehicles in the corresponding test set.

[0008] Furthermore, in step S4, classifying all vehicle images in the nighttime vehicle dataset includes: S41, randomly selecting one image from the nighttime vehicle dataset as the query image, and the remaining images as the image library; S42, ranking and visualizing the query vehicles based on the vehicle recognition benchmark FastReID; S43, selecting all images corresponding to the vehicles in the query images based on the visualization results and labeling them; S44, repeating the above process until all images in the vehicle dataset have been classified.

[0009] Furthermore, the neural network model is a ResNet50 network model f(a|θ,λ), which includes at least a feature extractor e(a|θ) and a unified classifier c(p|λ), where a represents the input training sample, θ and λ are the parameters of the neural network model, and p is the output of the feature extractor e(a|θ).

[0010] Furthermore, in S6, metric learning is performed on the neural network model to optimize it. Specifically, this includes optimizing the feature space based on the metric learning loss function to optimize the weight coefficients of the unified classifier. The metric learning loss function includes at least the cross-entropy loss function and the triplet loss function.

[0011] Furthermore, the metric learning loss function As shown in the following formula (1), The cross-entropy loss function is shown in formula (2) below. The loss function for the triplet is shown in formula (3) below;

[0012]

[0013]

[0014]

[0015] Where D represents the number of training samples in one training iteration, and a i and b i These represent the input training sample and the corresponding label, a and b, respectively. i As a baseline sample, Indicates a positive sample. p(a) represents a negative sample. i ) represents the predicted identity probability from the input training samples, m represents the margin and is set to a constant, and d max and d min This represents the maximum distance between positive sample pairs and the minimum distance between negative sample pairs.

[0016] Furthermore, the nighttime vehicle dataset after classification is divided into a training set and a test set, specifically including: dividing the training set into a training query library and a training image library, and dividing the test set into a test query library and a test image library.

[0017] Furthermore, in step S6, the average accuracy of the neural network model is optimized, thereby optimizing the neural network model. Specifically, this includes: S61, inputting training samples and normalizing the features of the training samples to obtain embedded samples; S62, calculating the cosine similarity between the training query library and the training graph library, and obtaining a similarity vector; S63, approximating the similarity vectors using a triangular kernel, optimizing the ranking by constraining the average accuracy loss function, and optimizing the mAP accuracy based on a histogram; S64, optimizing the parameters of the network model based on backpropagation (BP).

[0018] Furthermore, the triangular kernel is as shown in formula (4).

[0019]

[0020] Among them, g c ∈[-1,1] represents the c-th cell in the histogram. Let C represent the interval between adjacent warehouses, and the number of warehouses be C. eij ∈[-1,1] represents the cosine similarity between the training query library and the training graph library.

[0021] Furthermore, the approximate sorting of similarity vectors based on a triangular kernel specifically includes: inputting the similarity vectors into a triangular kernel composed of C triangles; if the cosine similarity e ij Not here Within the interval, the output is Δ(e). ij c) will be set to zero, while the cosine similarity e ij This will be deleted; repeat the above process to obtain a ranking list of all cosine similarities in the similarity vector e.

[0022] Furthermore, it also includes calculating precision P and recall R based on the ranking list, thereby obtaining the average precision loss function as shown in formula (5), and the formulas for precision P and recall R are shown in formula (6) and formula (7).

[0023]

[0024]

[0025]

[0026] Where, ΔR i (j)=R i (j)-R i (j-1), h in It is the similarity between the training query database and the training graph database. Indicates whether they belong to the same identity, N Q This represents the number of nighttime vehicle images in the training query library.

[0027] The beneficial effects of this invention are:

[0028] 1. Construct an image dataset of nighttime scenes to ensure data diversity, including occlusion, brightness, contrast, reflection, blur, noise, color difference, and complex weather conditions;

[0029] 2. Training on a dataset of nighttime scene images addresses the issue that in large-scale nighttime scenes, the same vehicle can exhibit significant appearance changes due to variations in lighting, which can interfere with retrieval and lead to lower accuracy.

[0030] 3. Perform metric learning and mAP optimization on the neural network model to optimize the neural network model parameters, thereby improving the accuracy of the sorting list of images with the same identity in the image library vehicles.

[0031] 4. mAP was directly optimized during the training process, improving the accuracy of vehicle matching;

[0032] 5. The images in the training set are divided into a query library and an image library, similar to the test set, and the corresponding sorted lists are obtained. By converting the good and bad sorted lists into a differentiable calculation function, gradient backpropagation is achieved to optimize the model parameters. Attached Figure Description

[0033] Figure 1 This is a flowchart of a nighttime vehicle re-identification method based on the average precision loss function, according to an embodiment of the present invention.

[0034] Figure 2 This is a schematic diagram illustrating the process of obtaining a nighttime vehicle dataset according to an embodiment of the present invention;

[0035] Figure 3 This is a schematic diagram illustrating the principle of a nighttime vehicle re-identification method based on the average precision loss function according to an embodiment of the present invention.

[0036] Figure 4 This is a schematic diagram comparing the dataset of this invention with other vehicle datasets;

[0037] Figure 5 This is a comparison of the nighttime vehicle re-identification method based on the average precision loss function of the present invention with other vehicle re-identification methods;

[0038] Figure 6 Comparative data for preprocessing vehicle images at night using two enhancement methods: ZERO-DCE and EC. Detailed Implementation

[0039] First, some abbreviations and key terms mentioned in this invention will be explained.

[0040] AP: Average Precision;

[0041] mAP: mean Average Precision, average precision loss;

[0042] Vehicle re-identification: Vehicle re-identification.

[0043] To further understand the present invention, preferred embodiments are described below with reference to examples. However, it should be understood that these descriptions are only for further illustrating the features and advantages of the present invention, and not for limiting the scope of the claims. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0044] The following is in conjunction with the appendix Figure 1 The invention will be further described in detail with reference to specific embodiments, such as... Figure 1 As shown in the flowchart, a nighttime vehicle re-identification method based on the average precision loss function described in this embodiment specifically includes:

[0045] S1, captures nighttime video and extracts valid video frames.

[0046] In one embodiment of the invention, video footage from 17:00 to 23:00 over a seven-hour period was manually extracted from 43 cameras on campus. Since there are fewer vehicles at night, the number of frames without vehicles is significantly higher than during the day. To reduce these invalid frames, the invention first removes video frames without vehicles, and then uses FFmpeg to extract valid video frames at a frequency of 16 video frames per second.

[0047] S2, detect valid images from valid video frames to obtain the vehicle bounding boxes corresponding to the vehicles in the valid images.

[0048] In one embodiment of the present invention, the YOLO-v4 detector is used. When the detector is used to detect valid video, a total of 250,000 bounding boxes can be obtained, in which all vehicles appearing in the valid video frames have bounding boxes.

[0049] To ensure the quality and accuracy of vehicle detection results, manual assistance was also conducted. This invention invited 11 volunteers to use Colabeler software to manually inspect vehicle bounding boxes in video frames, checking and correcting mislabeled bounding boxes. To further ensure the quality and accuracy of vehicle detection results, some mislabeled vehicle bounding boxes were removed through manual inspection; if 5000 vehicle bounding boxes were mislabeled, the corresponding bounding boxes were deleted.

[0050] S3, cropping the vehicle image based on the coordinates of the vehicle bounding box, thus obtaining the nighttime vehicle dataset.

[0051] In one embodiment of the present invention, the coordinates of the upper left and lower right corners of the detected vehicle bounding boxes are saved in a text file. Based on the saved coordinates, i.e. the coordinates of the corresponding vehicle bounding boxes, the vehicle images are located and cropped using a Python script. Then, the present invention can obtain 200,000 vehicle images from 100,000 original video frames, i.e., initially generate an unlabeled nighttime vehicle dataset.

[0052] S4 labels the vehicle IDs and camera IDs in the nighttime vehicle dataset and classifies all vehicle images in the nighttime vehicle dataset.

[0053] The camera ID is labeled during the recording process. This section focuses on labeling the vehicle ID, including the following steps.

[0054] S41, randomly select one image from the nighttime vehicle dataset as the query image, and the remaining images as the image library.

[0055] S42, rank and visualize the queried vehicles based on the vehicle recognition benchmark FastReID;

[0056] S43, Based on the visualization results, select all images corresponding to the vehicles in the query images and label them;

[0057] S44. Repeat the above process until all images in the vehicle dataset have been classified.

[0058] S5 divides the classified nighttime vehicle dataset into training and test sets.

[0059] The number of training sets is less than the number of test sets. The ratio of training to test sets is set to 10:13 because data annotation is costly in real-world scenarios, and this aims to encourage more efficient training strategies. The training set for vehicle re-identification is divided into a training query library and a training image library, while the test set is divided into a test query library and a test image library.

[0060] Since vehicle re-identification involves randomly selecting an image from the query database and searching the database for vehicle image sequences with similar features, the database needs to contain more images than the query database. Therefore, in one embodiment of the present invention, the ratio of the training query database to the training image database is set to 1:10, and the ratio of the test query database to the test image database is also set to 1:10.

[0061] Assume the query library is represented by Q, and the image library by G. The vehicle image q i For vehicle re-identification, the goal is to retrieve images with the same identity from a library G. Existing work involves learning a deep embedding network f(x|θ) to embed x into a high-dimensional Euclidean space.

[0062] S6 inputs the training and test sets into the neural network model and performs metric learning and average accuracy optimization on the neural network model to optimize the neural network model.

[0063] In one embodiment of the present invention, the neural network model is a ResNet50 network model f(a|θ,λ), and the baseline consists of a feature extractor e(a|θ) and a unified classifier c(p|λ), where a represents the input training sample, θ and λ are the parameters of the neural network model, and p is the output of the feature extractor e(a|θ). The ultimate goal of optimizing the network model in this invention is to optimize the parameters θ and λ, so that the ranking list of images with the same identity in the image library vehicles has a higher accuracy.

[0064] The images of the training set obtained in step S5 are input into the neural network model for training. The training process includes metric learning and average accuracy optimization. Metric learning uses the triplet loss function and cross-entropy loss function to optimize the model, while average accuracy optimization uses histogram approximation to directly optimize mAP accuracy.

[0065] In one embodiment of the present invention, a neural network model is optimized using metric learning based on cross-entropy loss and triplet loss functions. Cross-entropy loss is the most commonly used loss function in classification, used to measure the difference between the distribution learned by the model and the true distribution. Triplet loss, for a given set of triples, attempts to learn a feature space such that anchors of the same class are closer to positive samples, while anchors of different classes are farther from negative samples. Therefore, this is applied to image recognition tasks, i.e., given training and test image sets, determining whether two images belong to the same label class.

[0066] Cross-entropy loss function and triplet loss function are used to guide the unified classifier weight adjustment of neural network models. By measuring the learning loss function, we can know how to improve the weight coefficients.

[0067] The training set of vehicle images in nighttime scenes is input into the network model based on average precision loss proposed in this invention, and the cross-entropy loss function is utilized. and triplet loss function To optimize the embedded network, these loss functions are expressed as follows:

[0068]

[0069]

[0070]

[0071] Where D represents the batch size, i.e., the number of samples in one training session. Due to the large number of training samples, a batch method is used to input the training samples for testing. i and b i These represent the input training samples and their corresponding labels in this batch, respectively. i As a baseline sample, Indicates a positive sample. p(a) represents a negative sample. i ) represents the predicted identity probability from the input training samples, m represents the margin and is set to a constant of 0.3, and d max and d min This represents the maximum distance between positive sample pairs and the minimum distance between negative sample pairs.

[0072] It should be noted that the metric learning loss function It is constantly being updated during the learning process.

[0073] In one embodiment of the present invention, a schematic diagram illustrating the principle of average accuracy optimization is shown below. Figure 3 As shown, it consists of the following steps.

[0074] S61, obtain the embedded samples of the training samples. The length of the embedded features is 2048, and the features of the training samples are normalized using the L2 norm.

[0075] S62, Calculate the cosine similarity e between the training query library and the training graph library. ij ∈[-1,1], and obtain the similarity vector. Where, e ij To find the cosine similarity between the i-th nighttime vehicle image in the training query database and the j-th nighttime vehicle image in the training image database, where i and j are the number of nighttime vehicle images in the training query database and the training image database, respectively, the similarity vector can be represented as e = [ei1; ei2; ...:eiNG].

[0076] S63 performs triangular kernel approximation sorting on similarity vectors, optimizes the sorting by constrained average precision loss function, and optimizes mAP accuracy based on histogram.

[0077] Since the sorting operation is non-differentiable, a triangular kernel is used as an approximation to approximate the similarity vectors e by sorting them using the triangular kernel and calculating their histograms. The triangular kernel is defined as shown in equation (4).

[0078]

[0079] Among them, g c ∈[-1,1], which is the c-th cell in the histogram. This represents the interval between adjacent warehouses. Assuming the number of warehouses is C, then...

[0080] The triangular kernel consists of C triangles. The similarity vector e is input into the triangular kernel. If the cosine similarity e... ij Not here Within the interval, the output is Δ(e). ij c) will be set to zero, while the cosine similarity e ij These will be deleted. In this way, all similar items in e are sorted, thus obtaining a ranking list of similarity vectors e. After the above operations, all items in e are assigned to their corresponding positions.

[0081] Precision P and recall R can be calculated using formulas (5) and (6).

[0082]

[0083]

[0084] Where ΔR i (j)=R i (j)-R i (j-1). h in It is the similarity between the training query database and the training graph database. This indicates whether they belong to the same identity. The average precision loss function, or mAP function, can be expressed as:

[0085]

[0086] In summary, the overall loss function can be expressed as follows:

[0087]

[0088] S64, the parameters of the network model are optimized based on the backpropagation process of the neural network, specifically using BP backpropagation to optimize the parameters of the network model.

[0089] It should be noted that the nighttime vehicle re-identification method based on the average precision loss function proposed in this invention directly optimizes the average precision loss mAP. The images in the training set are partitioned into a training query library and a training image library, mimicking the test set, and corresponding sorting lists are obtained. By transforming the sorting quality of this list into a differentiable computational function, gradient backpropagation is achieved, thereby optimizing the model parameters. Here, the average precision loss mAP is an important performance indicator calculated based on the image sorting list.

[0090] S7. Input the vehicle image to be queried from the test query library into the optimized neural network model to obtain the sorted list of vehicle images in the test library corresponding to the test set.

[0091] During the testing phase, each query Q returns a ranked list G of the image library, where images G that are closer in Euclidean distance rank higher. Finally, mAP is used to evaluate the ranking results. mAP is the average precision across all query images, while AP refers to the area under the PR curve, which consists of precision and recall. Therefore, mAP can be represented as follows:

[0092]

[0093]

[0094] Where P and R represent precision and recall, respectively. N Q and N G This indicates the number of images in the test query library and the test image library.

[0095] To verify the difficulty of the nighttime dataset obtained in this invention, experiments were conducted on the dataset obtained in this invention and the widely used vehicle re-identification dataset Veri-776, combining cutting-edge vehicle re-identification methods such as Bagtricks, AGW, MGN, and SBS. The performance comparison results are as follows: Figure 5 As shown, it is clear that the advanced vehicle re-identification method performs poorly on the dataset of this invention, indicating that the nighttime dataset proposed in this invention is challenging.

[0096] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0097] like Figure 6 As shown, this invention first preprocesses nighttime vehicle images using two enhancement methods, ZERO-DCE and EC, but finds the results unsatisfactory. Image enhancement is a low-level visual task aimed at generating visually appealing vehicle images, while vehicle re-identification is a high-level visual task aimed at improving the accuracy of vehicle recognition. This difference in objectives between low-level and high-level tasks leads to domain differences. Next, this invention finds that the mAP on its own dataset is significantly lower than on the Veri-776 dataset. Therefore, this invention directly optimizes mAP during training and achieves performance competitive with current methods. As shown in Table 6, this invention achieves 90.08% accuracy on Rank-1, which is similar to Bagtricks' performance, but achieves 44.87% mAP, surpassing most existing methods. This demonstrates the effectiveness of this invention for the nighttime vehicle re-identification task.

[0098] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

Claims

1. A nighttime vehicle re-identification method based on average precision loss function, characterized in that, Specifically, it includes: S1, captures nighttime video and extracts valid video frames; S2, detect valid images from valid video frames to obtain the vehicle bounding boxes corresponding to the vehicles in the valid images; S3, cropping vehicle images from valid images based on the coordinates of vehicle bounding boxes to obtain a nighttime vehicle dataset; S4, label the vehicle IDs and camera IDs in the nighttime vehicle dataset, and classify all vehicle images in the nighttime vehicle dataset; S5, the nighttime vehicle dataset after classification is divided into training set and test set; S6, input the training set into the neural network model, and perform metric learning on the neural network model. Average accuracy is optimized, thereby optimizing the neural network model; S7. Input the vehicle images to be queried from the test set into the optimized neural network model to obtain the sorted list of the image library vehicles in the corresponding test set. The nighttime vehicle dataset after classification is divided into a training set and a test set, specifically including: dividing the training set into a training query library and a training image library, and dividing the test set into a test query library and a test image library; In step S6, the average accuracy of the neural network model is optimized, thereby optimizing the neural network model. Specifically, this includes: S61, Input training samples and normalize the features of the training samples to obtain embedded samples; S62, calculate the cosine similarity between the training query library and the training image library, and obtain the similarity vector; S63, similarity vectors are approximated and sorted based on triangular kernel, sorting is optimized by constrained average precision loss function, and mAP accuracy is optimized based on histogram; S64, Parameters of the network model optimized based on BP backpropagation.

2. The nighttime vehicle re-identification method based on the average precision loss function according to claim 1, characterized in that, S4 classifies all vehicle images in the nighttime vehicle dataset, including: S41, randomly select one image from the nighttime vehicle dataset as the query image, and the remaining images as the image library; S42, rank and visualize the queried vehicles based on the vehicle recognition benchmark FastReID; S43, Based on the visualization results, select all images corresponding to the vehicles in the query images and label them; S44. Repeat the above process until all images in the vehicle dataset have been classified.

3. The nighttime vehicle re-identification method based on the average precision loss function according to claim 1, characterized in that, The neural network model is a ResNet50 network model f(a| , ), including at least the feature extractor e(a| ) and a unified classifier c(p| ), where a represents the input training sample, θ and These are the parameters of the neural network model, where p is the feature extractor e(a| The output of ).

4. The nighttime vehicle re-identification method based on the average precision loss function according to claim 3, characterized in that, In step S6, metric learning is performed on the neural network model to optimize it. Specifically, this includes optimizing the feature space based on the metric learning loss function to optimize the weight coefficients of the unified classifier. The metric learning loss function includes at least the cross-entropy loss function and the triplet loss function.

5. The nighttime vehicle re-identification method based on the average precision loss function according to claim 4, characterized in that, The metric learning loss function As shown in the following formula (1), The cross-entropy loss function is shown in the following formula (2). The loss function for the triplet is shown in the following formula (3). (1) (2) (3) Where D represents the number of training samples in one training session. and These represent the input training sample and the corresponding label, respectively. As a baseline sample, Indicates a positive sample. Indicates a negative sample. This represents the predicted identity probability from the input training samples, where m represents the margin and is set to a constant. and This represents the maximum distance between positive sample pairs and the minimum distance between negative sample pairs.

6. The nighttime vehicle re-identification method based on the average precision loss function according to claim 1, characterized in that, The triangular kernel is shown in formula (4). (4) in, [-1,1] represents the c-th cell in the histogram. Let C represent the interval between adjacent warehouses, and the number of warehouses be C. , [-1,1] represents the cosine similarity between the query library and the training graph library.

7. The nighttime vehicle re-identification method based on the average precision loss function according to claim 1, characterized in that, The sorting of similarity vectors based on the triangular kernel approximation specifically includes: The similarity vector is input into a triangular kernel consisting of C triangles; If cosine similarity Not here Within the interval, the output is ∆( c) will be set to zero, while cosine similarity It will be deleted; Repeat the above process to obtain a ranking list of all cosine similarities in the similarity vector e.

8. The nighttime vehicle re-identification method based on the average precision loss function according to claim 7, characterized in that, It also includes calculating precision P and recall R based on the ranking list, thus obtaining the average precision loss function as shown in formula (5), and the formulas for precision P and recall R are as shown in formula (6) and formula (7). (5) (6) (7) in, , It is the similarity between the training query database and the training graph database. Indicate whether they belong to the same identity. This represents the number of nighttime vehicle images in the training query library.