Day-and-night vehicle re-identification method, device and equipment with glare suppression function

By constructing a vehicle re-identification model with a day/night glare extraction module, a glare suppression module, and a cross-domain feature fusion module, the problem of decreased recognition accuracy caused by glare interference and cross-time period illumination changes was solved, and high-precision vehicle re-identification was achieved in complex environments.

CN121640402BActive Publication Date: 2026-05-01CHONGQING SHOUXUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING SHOUXUN TECH CO LTD
Filing Date
2026-02-05
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies for vehicle re-identification models in complex real-world environments face problems such as glare interference, decreased recognition accuracy due to changes in lighting conditions across time periods, and poor robustness. They are unable to effectively suppress glare interference or enhance the ability to adapt to lighting conditions across day and night.

Method used

A vehicle re-identification model employing a day/night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module achieves adaptive identification and feature alignment of glare regions through glare mask image, feature map stitching, cross-domain feature fusion, and loss function optimization.

Benefits of technology

It improves the generalization ability and robustness of the vehicle re-identification model, reduces inter-domain differences, and enhances the recognition accuracy and precision in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121640402B_ABST
    Figure CN121640402B_ABST
Patent Text Reader

Abstract

The application provides a cross-day-and-night vehicle re-identification method, device and equipment with a glare suppression function. The method comprises the following steps: obtaining a to-be-identified vehicle image, inputting the to-be-identified vehicle image into a vehicle re-identification model, and obtaining a vehicle matching result. The vehicle re-identification model is obtained by training a pre-constructed re-identification model based on sample images. The sample images include daytime collected vehicle sample images or nighttime collected vehicle sample images. The pre-constructed re-identification model comprises a day-and-night glare extraction module, a glare suppression module, a first residual module and a cross-domain feature fusion module. The application realizes an adaptive identification suppression mechanism for a glare area in the to-be-identified vehicle image. Moreover, the setting of the cross-domain feature fusion module realizes feature fusion and feature alignment for the to-be-identified vehicle image across time periods, which is beneficial to reducing domain differences and improving the generalization ability and robustness of the vehicle re-identification model.
Need to check novelty before this filing date? Find Prior Art

Description

A method, apparatus, and equipment for cross-day and night vehicle re-identification with glare suppression function. Technical Field

[0001] This application relates to the field of computer vision technology, and in particular to a method, apparatus and equipment for cross-day and night vehicle re-identification with glare suppression function. Background Technology

[0002] With the acceleration of urbanization and the continuous development of intelligent transportation systems, cross-regional, 24 / 7 vehicle dynamic monitoring has become a core requirement for improving traffic management efficiency and ensuring public safety. Vehicle Re-Identification (VeRi), as a key technology of intelligent monitoring systems, aims to use computer vision methods to accurately match and continuously track specific vehicles from non-overlapping camera perspectives. It is widely used in practical scenarios such as traffic incident retrospective analysis, identification of cloned license plates, and vehicle management in parking lots and industrial parks.

[0003] In recent years, deep learning technology has driven significant progress in the field of vehicle re-identification. However, it faces the following challenges in real-world complex scenarios: First, due to the high similarity in appearance between vehicles of the same brand and model, and the weak inter-class differences, the same vehicle exhibits significant intra-class differences under different viewing angles, drastic changes in lighting conditions, or strong glare interference (e.g., headlights, reflections, sunlight glare, etc.), making fine-grained identification difficult and leading to a significant decrease in feature extraction capabilities, resulting in a sharp drop in recognition accuracy. Second, cross-time periods (e.g., differences in lighting and color distribution between day and night) further weaken the generalization ability of the recognition model. Moreover, factors such as the vehicle's motion characteristics can easily cause blurred images, preventing the recognition model from effectively extracting image features at the feature level, thus seriously affecting recognition accuracy and resulting in poor robustness of the recognition model, which restricts the rapid development of vehicle re-identification technology.

[0004] Therefore, there is an urgent need for a vehicle re-identification method that can effectively suppress glare interference and enhance the ability to adapt to different lighting conditions across day and night, so as to improve the robustness, generalization and recognition accuracy of deep learning models in complex real-world environments and meet the practical needs of all-weather, high-precision vehicle re-identification. Summary of the Invention

[0005] In view of the shortcomings of the prior art described above, this application provides a cross-day and night vehicle re-identification method, apparatus, and equipment with glare suppression function to solve the above-mentioned technical problems.

[0006] According to one aspect of the embodiments of this application, a cross-day / night vehicle re-identification method with glare suppression function is provided. The method includes: acquiring a vehicle image to be identified; the vehicle image to be identified includes: a vehicle image acquired during the day or a vehicle image acquired at night; inputting the vehicle image to be identified into a vehicle re-identification model to obtain a vehicle matching result; the vehicle matching result is used to characterize the degree of matching between the label category corresponding to the vehicle to be identified and the identification result output by the vehicle re-identification model; the vehicle re-identification model is obtained by training a pre-constructed re-identification model based on sample images, the sample images including: vehicle sample images acquired during the day or vehicle sample images acquired at night; the pre-constructed re-identification model includes: a day / night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module.

[0007] In one embodiment of this application, the process of training a pre-built re-identification model based on sample images to obtain the vehicle re-identification model includes: inputting the sample images into the day / night glare extraction module to obtain a glare mask image; inputting the sample images into the first residual module to obtain an initial feature map, and concatenating the glare mask image with the initial feature map to obtain an enhanced feature map; inputting the enhanced feature map into the glare suppression module to obtain a suppressed feature map; and inputting the suppressed feature map into the cross-domain feature fusion module to obtain a cross-domain fusion feature map; the cross-domain feature fusion module includes: a second residual module and a dual-domain structure. The system includes an enhancement module and a cross-domain category perception module. The cross-domain fusion feature map is pooled to obtain a global feature vector. The global feature vector is normalized to obtain a normalized feature vector. A fully connected operation is performed on the normalized feature vector to obtain a sample matching result. The parameters in the pre-built re-identification model are adjusted with the goal of minimizing the sum of the differences between the suppressed feature map and the feature map corresponding to the sample image, the differences between the global feature vector and the feature vector corresponding to the sample image, and the differences between the sample matching result and the label category corresponding to the sample image, to obtain the vehicle re-identification model.

[0008] In one embodiment of this application, the process of inputting the sample image into the day / night glare extraction module to obtain a glare mask image includes: converting the sample image into a grayscale image, and dividing the grayscale image into multiple local image blocks through a sliding window of a preset size; calculating the pixel mean and pixel variance in each local image block; determining a segmentation threshold for pixels in the grayscale image based on the pixel mean and pixel variance in each local image block; comparing the pixel values ​​in the grayscale image with the segmentation threshold, and binarizing the pixel values ​​in the grayscale image based on the comparison result to obtain a binary mask image; and inputting the binary mask image into a learnable convolutional kernel to obtain the glare mask image.

[0009] In one embodiment of this application, the process of determining the segmentation threshold of pixels in the grayscale image based on the pixel mean and pixel variance in each local image block includes: determining an image segmentation mode based on the acquisition time period of the sample image; the image segmentation mode includes: a daytime image segmentation mode and a nighttime image segmentation mode; determining segmentation control parameters based on the image segmentation mode; and determining the segmentation threshold based on the segmentation control parameters, the pixel mean and pixel variance in each local image block.

[0010] In one embodiment of this application, the process of inputting the enhanced feature map into the glare suppression module to obtain the suppression feature map includes: performing a fully connected operation, a nonlinear activation operation, and a normalization operation on the initial feature map in the enhanced feature map to obtain a feature attention map; performing a scaling operation and a normalization operation on the glare mask map in the enhanced feature map to obtain a glare mask enhancement map; performing a weighted summation of the glare mask enhancement map and the attention map to obtain a joint mask feature map; and suppressing the sample image according to the joint mask feature map and the suppression intensity parameter to obtain the suppression feature map.

[0011] In one embodiment of this application, the process of inputting the suppressed feature map into the cross-domain feature fusion module to obtain a cross-domain fusion feature map includes: inputting the suppressed feature map into the second residual module to obtain a second enhanced feature map; inputting the second enhanced feature map into the dual-domain structure enhancement module to obtain a spatial domain-channel domain enhanced feature map; and inputting the spatial domain-channel domain enhanced feature map into the cross-domain category perception module to obtain a cross-domain fusion feature map.

[0012] In one embodiment of this application, if the sum of the differences between the suppressed feature map and the feature map corresponding to the sample image, the differences between the global feature vector and the feature vector corresponding to the sample image, and the differences between the sample matching result and the label category corresponding to the sample image are represented by a loss function, then the expression of the loss function includes: ,in, Represents the loss function. The label smoothing cross-entropy loss function is used to characterize the difference between the sample matching result and the label category corresponding to the sample image. The direction-invariant triplet loss function is used to characterize the difference between the global feature vector and the feature vector corresponding to the sample image. This represents the loss weighting coefficient. The glare suppression guided loss function is used to characterize the difference between the suppression feature map and the feature map corresponding to the sample image.

[0013] In one embodiment of this application, the expression for the label smoothing cross-entropy loss function includes:

[0014] ,in, This represents the label smooth cross-entropy loss function. Represents the smoothing coefficient. This represents the total number of label categories c. This represents the probability that the predicted sample image belongs to label category y, where label category y is the label category corresponding to the sample image. This represents the probability that a predicted sample image belongs to label category c, which is different from label category y; the expression for the probability that a predicted sample image belongs to label category y includes: ,in, This represents the probability that the predicted sample image belongs to label category y. Indicates the label category corresponding to the sample image. The sum of the exponents of all category scores; the expression for the probability that the predicted sample image belongs to label category c includes: ,

[0015] in, This represents the probability that the predicted sample image belongs to label class c. Indicates the label category in the sample matching results. The expression for the direction-invariant triplet loss function is: (The expression represents the exponential sum of scores across all categories.) ,in, This represents the direction-invariant triplet loss function. This represents the feature vector corresponding to the sample image. This represents the feature vector obtained by predicting positive samples. This represents the feature vector obtained by predicting negative samples. Indicates the interval value. The distance between two feature vectors is represented; the expression for the glare suppression guidance loss function includes: ,in, This represents the glare suppression guidance loss function. This represents the suppression feature map obtained by predicting positive samples. This represents the suppression feature map obtained from predicting negative samples. This represents the Sigmoid function. This represents the global pooling operation function.

[0016] According to one aspect of the embodiments of this application, a cross-day / night vehicle re-identification device with glare suppression function is provided. The device includes: an image acquisition module for acquiring an image of a vehicle to be identified; the image of the vehicle to be identified includes: a vehicle image acquired during the day or a vehicle image acquired at night; an image recognition module for inputting the image of the vehicle to be identified into a vehicle re-identification model to obtain a vehicle matching result; the vehicle matching result is used to characterize the degree of matching between the label category corresponding to the vehicle to be identified and the recognition result output by the vehicle re-identification model; the vehicle re-identification model is obtained by training a pre-constructed re-identification model based on sample images, the sample images including: vehicle sample images acquired during the day or vehicle sample images acquired at night; the pre-constructed re-identification model includes: a day / night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module.

[0017] According to one aspect of the embodiments of this application, an electronic device is provided, characterized in that it includes:

[0018] One or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the cross-day / night vehicle re-identification method with glare suppression function as described above.

[0019] The beneficial effects of this application are as follows: This application acquires an image of a vehicle to be identified, inputs the image into a vehicle re-identification model, and obtains a vehicle matching result. The vehicle matching result is used to characterize the degree of matching between the label category corresponding to the vehicle to be identified and the identification result output by the vehicle re-identification model. The vehicle re-identification model is trained on a pre-built re-identification model based on sample images, including vehicle sample images collected during the day or at night. The pre-built re-identification model includes a day and night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module. In the above process, by setting the day and night glare extraction module and the glare suppression module in the vehicle re-identification model, an adaptive identification suppression mechanism for glare regions in the vehicle image to be identified is realized during the re-identification process. Moreover, the setting of the cross-domain feature fusion module enables feature fusion and feature alignment of vehicle images to be identified across time periods, which helps to reduce inter-domain differences and improve the generalization ability and robustness of the vehicle re-identification model.

[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0022] Figure 1 is a schematic diagram illustrating an exemplary system architecture of an exemplary embodiment of this application;

[0023] Figure 2 is a flowchart illustrating a cross-day / night vehicle re-identification method with glare suppression function, as shown in an exemplary embodiment of this application;

[0024] Figure 3 is a schematic diagram of the structure of a pre-built re-identification model shown in an exemplary embodiment of this application;

[0025] Figure 4 is a schematic diagram of the internal structure of the dual-domain structure enhancement module and the cross-domain category perception module, as shown in an exemplary embodiment of this application;

[0026] Figure 5 is a schematic diagram of the internal structure of a glare suppression module shown in an exemplary embodiment of this application;

[0027] Figure 6 is a block diagram of a cross-day / night vehicle re-identification device with glare suppression function, illustrating an exemplary embodiment of this application;

[0028] Figure 7 is a schematic diagram of the structure of a computer system of an electronic device according to an exemplary embodiment of this application. Detailed Implementation

[0029] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0030] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0031] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.

[0032] Figure 1 is a schematic diagram illustrating an exemplary system architecture in an exemplary embodiment of this application.

[0033] Referring to Figure 1, the system architecture may include an acquisition device 101 and an electronic device 102. The electronic device 102 may be at least one of a desktop graphics processing unit (GPU) computer, a GPU computing cluster, or a neural network computer. Those skilled in the art can use the electronic device 102 to acquire images of vehicles to be identified, input these images into a vehicle re-identification model, and obtain vehicle matching results. The vehicle matching results characterize the degree of matching between the label category corresponding to the vehicle to be identified and the identification result output by the vehicle re-identification model. The vehicle re-identification model is trained based on sample images, including vehicle sample images acquired during the day or at night. The pre-built re-identification model includes a day / night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module. The acquisition device 101 is used to acquire images of vehicles to be identified and provide them to the electronic device 102 for processing.

[0034] Indicatively, after acquiring the image of the vehicle to be identified from the acquisition device 101, the electronic device 102 inputs the image into the vehicle re-identification model to obtain the vehicle matching result. The vehicle matching result is used to characterize the degree of matching between the label category corresponding to the vehicle to be identified and the identification result output by the vehicle re-identification model. The vehicle re-identification model is trained on a pre-built re-identification model based on sample images. The sample images include vehicle sample images acquired during the day or at night. The pre-built re-identification model includes a day and night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module. In the above process, by setting the day and night glare extraction module and the glare suppression module in the vehicle re-identification model, an adaptive identification suppression mechanism for glare regions in the image of the vehicle to be identified is realized during the re-identification of the image of the vehicle to be identified. Moreover, the setting of the cross-domain feature fusion module enables feature fusion and feature alignment of the image of the vehicle to be identified across time periods, which helps to reduce inter-domain differences and improve the generalization ability and robustness of the vehicle re-identification model.

[0035] The implementation details of the technical solutions in the embodiments of this application are described in detail below:

[0036] Figure 2 is a flowchart illustrating a cross-day / night vehicle re-identification method with glare suppression function according to an exemplary embodiment of this application. Referring to Figure 2, the cross-day / night vehicle re-identification method with glare suppression function includes at least steps S210 to S220, which are described in detail below:

[0037] In step S210, an image of the vehicle to be identified is acquired. In one embodiment of this application, the image of the vehicle to be identified includes: a vehicle image acquired during the day or a vehicle image acquired at night, which is acquired through a camera or other device. The image of the vehicle to be identified is an image obtained after preprocessing.

[0038] In step S220, the image of the vehicle to be identified is input into the vehicle re-identification model to obtain the vehicle matching result. In one embodiment of this application, the vehicle matching result is used to characterize the degree of matching between the label category corresponding to the vehicle to be identified and the identification result output by the vehicle re-identification model; the vehicle re-identification model is obtained by training a pre-built re-identification model based on sample images, including: vehicle sample images collected during the day or vehicle sample images collected at night; the pre-built re-identification model includes: a day / night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module, wherein the number of cross-domain feature fusion modules can be set to multiple, and the cross-domain feature fusion modules include: a second residual module, a dual-domain structure enhancement module, and a cross-domain category perception module. The vehicle sample image is an image obtained after preprocessing. The preprocessing of the vehicle sample image includes: performing contrast adjustment, brightness adjustment, color enhancement, geometric transformation, filtering, and other operations on the images of the same vehicle collected from non-overlapping camera perspectives to obtain the preprocessed images collected from non-overlapping camera perspectives, and fusing the preprocessed images collected from non-overlapping camera perspectives to obtain the vehicle sample image.

[0039] In one embodiment of this application, by setting a day and night glare extraction module and a glare suppression module in the vehicle re-identification model, an adaptive recognition suppression mechanism for glare regions in the vehicle image to be identified is realized during the re-identification process. Moreover, the setting of the cross-domain feature fusion module enables feature fusion and feature alignment of vehicle images to be identified across time periods, which helps to reduce inter-domain differences and improve the generalization ability and robustness of the vehicle re-identification model.

[0040] In one embodiment of this application, the process of training a pre-built re-identification model based on sample images to obtain a vehicle re-identification model includes:

[0041] The sample image is input into the day-night glare extraction module to obtain a glare mask image; the sample image is then input into the first residual module to obtain an initial feature map, and the glare mask image and the initial feature map are concatenated to obtain an enhanced feature map. In one embodiment of this application, the day-night glare extraction module (DNGEM) is used to perform grayscale conversion on the sample image, binarize the grayscale image, and fill the binary mask image with pixels to obtain a glare mask image, thereby realizing the detection and extraction of bright areas in the sample image; the first residual module is a ResNet50 module, which is used to perform hierarchical feature extraction and conversion on the sample image to obtain an initial feature map, which is beneficial to improving the expressive power of the features.

[0042] The enhanced feature map is input into the glare suppression module to obtain the suppressed feature map. In one embodiment of this application, the glare suppression module (GSM) is used to perform fully connected operations, nonlinear activation operations, and normalization operations on the initial feature map (located in the first 64 channels) in the enhanced feature map to obtain a feature attention map. The glare mask map in the enhanced feature map is then scaled and normalized to obtain a glare mask enhancement map. The glare mask enhancement map and the attention map are weighted and summed to obtain a joint mask feature map. Based on the joint mask feature map and the suppression intensity parameter, the sample image is suppressed to obtain the suppressed feature map. In the above process, the generation of the feature attention map can highlight important feature information in the initial feature map, while the glare mask enhancement map strengthens the representation of the glare region. By weighted summing the feature attention map and the glare mask enhancement map to obtain the joint mask feature map, and then combining it with the suppression intensity parameter to suppress the sample image, the intensity of the glare region in the sample image can be accurately adjusted, avoiding interference from glare in the subsequent recognition process.

[0043] The suppressed feature map is input into the cross-domain feature fusion module to obtain the cross-domain fused feature map. In one embodiment of this application, the cross-domain feature fusion module includes: a second residual module, a dual-domain structure enhancement module, and a cross-domain category-aware module. During the process of inputting the suppressed feature map into the cross-domain feature fusion module to obtain the cross-domain fused feature map, the second residual module is used to perform hierarchical feature extraction and transformation on the suppressed feature map to obtain a second enhanced feature map; the dual-domain structure enhancement module (DSE) is used to enhance the feature structure of the second enhanced feature map in the spatial domain and channel domain through local gradient calculation to obtain a spatial domain-channel domain enhanced feature map; the cross-domain category-aware module (CCA) is used to perform cross-domain feature alignment and category-aware enhancement operations on the spatial domain-channel domain enhanced feature map through a cross-domain attention mechanism to obtain the cross-domain fused feature map. Through the combination of the dual-domain structure enhancement module (DSE) and the cross-domain category-aware module (CCA), the expressive ability and inter-domain alignment ability of the pre-built re-identification model for features in the sample image are synergistically improved.

[0044] The cross-domain fusion feature map is pooled to obtain a global feature vector; the global feature vector is normalized to obtain a normalized feature vector; and a fully connected operation is performed on the normalized feature vector to obtain the sample matching result. In one embodiment of this application, the pooling operation on the cross-domain fusion feature map is a global average pooling (GAP) operation, the normalization operation on the global feature vector is a batch normalization (BN) operation, and the fully connected operation on the normalized feature vector is implemented through a fully connected layer.

[0045] The vehicle re-identification model is obtained by adjusting the parameters of a pre-built re-identification model with the goal of minimizing the sum of the differences between the suppressed feature map and the feature map corresponding to the sample image, the differences between the global feature vector and the feature vector corresponding to the sample image, and the differences between the sample matching result and the label category corresponding to the sample image. In one embodiment of this application, if the sum of the differences between the suppressed feature map and the feature map corresponding to the sample image, the global feature vector and the feature vector corresponding to the sample image, and the differences between the sample matching result and the label category corresponding to the sample image are represented by a loss function, then the expression of the loss function includes:

[0046] Equation (1)

[0047] in, Represents the loss function. This represents the label smoothing cross-entropy loss function, used to characterize the difference between the sample matching result and the label category corresponding to the sample image. This represents the direction-invariant triplet loss function, used to characterize the difference between the global feature vector and the feature vector corresponding to the sample image. This represents the loss weighting coefficient. This represents the glare suppression guided loss function, used to characterize the difference between the suppressed feature map and the feature map corresponding to the sample image.

[0048] In one embodiment of this application, the expression for the label smoothing cross-entropy loss function includes:

[0049] Equation (2)

[0050] in, This represents the label smooth cross-entropy loss function. Represents the smoothing coefficient. This represents the total number of label categories c. This represents the probability that the predicted sample image belongs to label category y, where label category y is the label category corresponding to the sample image. This represents the probability that the predicted sample image belongs to label category c. The sum of the probabilities of all label categories c is equal to 1. Label category c is different from label category y. Label category y represents the true category label of the sample image, while label category c represents all possible category labels that can be obtained by predicting the sample image, including correctly predicted and incorrectly predicted category labels.

[0051] In one embodiment of this application, the expression for predicting the probability that a sample image belongs to label category y includes:

[0052] Equation (3)

[0053] in, This represents the probability that the predicted sample image belongs to label category y. This represents the label category corresponding to the sample image. The label category corresponding to the sample image is represented by one-hot encoding, for example, 0, 1. This represents the sum of the indices for all category scores.

[0054] In one embodiment of this application, the expression for predicting the probability that a sample image belongs to label category c includes:

[0055] Equation (4)

[0056] in, This represents the probability that the predicted sample image belongs to label class c. This represents the label category in the sample matching result. The label category in the sample matching result is represented by one-hot encoding, for example, 0, 1. This represents the sum of the indices for all category scores.

[0057] In one embodiment of this application, the expression for the direction-invariant triplet loss function includes:

[0058] Equation (5)

[0059] in, This represents the direction-invariant triplet loss function. This represents the feature vector corresponding to the sample image. This represents the feature vector obtained by predicting positive samples. This represents the feature vector obtained by predicting negative samples. Indicates the interval value. This represents the distance between two feature vectors.

[0060] The expression for the glare suppression guidance loss function includes:

[0061] Equation (6)

[0062] in, This represents the glare suppression guidance loss function. This represents the suppression feature map obtained by predicting positive samples. This represents the suppression feature map obtained from predicting negative samples. This represents the Sigmoid function. This represents the global pooling operation function. Positive samples represent sample images without glare, while negative samples represent sample images with glare.

[0063] In one embodiment of this application, the label smoothing cross-entropy loss function takes into account the uncertainty of labels. By setting the smoothing coefficient, it mitigates the risk of overfitting to a certain extent, making the vehicle re-identification model more stable and reliable in predicting sample matching results. The direction-invariant triplet loss function, from the perspective of feature vectors, clarifies the training objective by defining the distance relationship between the feature vectors of the sample image, positive samples, and negative samples, making the generated feature vectors of the vehicle re-identification model more discriminative and able to highlight the differences between different categories. The glare suppression guided loss function targets the key aspect of glare suppression. By calculating the suppression feature maps of positive and negative samples, it uses the Sigmoid function to map the calculation results to an appropriate range, allowing the vehicle re-identification model to better learn how to effectively suppress glare. The label smoothing cross-entropy loss function, the direction-invariant triplet loss function, and the glare suppression guided loss function work together to continuously adjust and optimize the parameters in the pre-built re-identification model, guided by minimizing the total loss. This process is a dynamic iterative one, with each iteration gradually improving the performance of the pre-built re-identification model in key aspects such as glare suppression, feature extraction, feature fusion, and sample matching. As training progresses, the pre-built re-identification model becomes increasingly accurate in detecting and extracting bright areas in sample images, its glare suppression becomes better, and the generated feature vectors become more representative and discriminative. The sample matching results more accurately correspond to the true label category of the sample image. After multiple rounds of training and parameter adjustments, the final vehicle re-identification model effectively suppresses glare interference and improves the accuracy of vehicle feature extraction and recognition when dealing with vehicle images in day-night environments. This enables accurate vehicle identification in complex scenes, providing strong support for practical applications such as traffic monitoring and vehicle management.

[0064] In one embodiment of this application, the process of inputting a sample image into a day / night glare extraction module to obtain a glare mask image includes:

[0065] The sample image is converted to a grayscale image, and then divided into multiple local image blocks using a sliding window of a preset size. In one embodiment of this application, the formula for calculating the grayscale image is as follows:

[0066] Equation (7)

[0067] in, Represents a grayscale image. Indicates the value of the red pixel. Indicates the green pixel value. This represents the value of the blue pixel.

[0068] In one embodiment of this application, the sliding window of the preset size can be an 8×8 sliding window or a sliding window of other sizes. The process of dividing a grayscale image into multiple local image blocks by using a sliding window of the preset size includes: setting the step size of the sliding window to 8, using an 8×8 sliding window, and performing non-overlapping block division of the grayscale image with a step size of 8 to generate a set of local image blocks.

[0069] Equation (8)

[0070] in, Represents a set of local image patches. Represents a grayscale image. This indicates the length and width of the sliding window. This indicates the step size of the sliding window.

[0071] Calculate the pixel mean and pixel variance in each local image block; determine the segmentation threshold for pixels in the grayscale image based on the pixel mean and pixel variance of each local image block. In one embodiment of this application, the formula for calculating the pixel mean in a local image block is as follows:

[0072] Equation (9)

[0073] in, Indicates the first The average pixel value in a local image patch Indicates the first The first local image patch pixel value, This represents the total number of pixel values ​​in each local image block.

[0074] The formula for calculating the pixel variance in each local image patch is as follows:

[0075] Equation (10)

[0076] in, Indicates the first Pixel variance in a local image patch Indicates the first The first local image patch pixel value, Indicates the first The average pixel value in a local image patch This represents the total number of pixel values ​​in each local image block.

[0077] The formula for calculating the segmentation threshold of pixels in a grayscale image is as follows:

[0078] Equation (11)

[0079] in, This represents the segmentation threshold for pixels in a grayscale image. Indicates the first The average pixel value in a local image patch Indicates the first Pixel variance in a local image patch This represents the nighttime segmentation control parameters for segmenting vehicle images acquired at night. These represent the daytime segmentation control parameters for segmenting vehicle images acquired during the day, and the segmentation control parameters for segmenting vehicle images acquired at night. Segmentation control parameters for segmenting vehicle images acquired during the day. All of these are learnable parameters. When segmenting vehicle images acquired at night, the corresponding nighttime image segmentation mode is used; when segmenting vehicle images acquired during the day, the corresponding daytime image segmentation mode is used.

[0080] The pixel values ​​in the grayscale image are compared with a segmentation threshold. Based on the comparison result, the pixel values ​​in the grayscale image are binarized to obtain a binary mask image. In one embodiment of this application, the expression of the binary mask image is as follows:

[0081] Equation (12)

[0082] in, Represents a binary mask image. Represents the first grayscale image. Line number Column pixel values, Indicates passing through the first Line number The segmentation threshold for the pixel point determined by the local image block to which the pixel value of the column belongs, in the grayscale image. Line number When the pixel value of a column is greater than the corresponding segmentation threshold, the pixel value of the column in the grayscale image is... Line number The pixel value of column 1 is set to 1, which is the first pixel in the grayscale image. Line number When the pixel value of a column is less than or equal to the corresponding segmentation threshold, the pixel value of the column in the grayscale image is... Line number The column's pixel value is set to 0.

[0083] The binary mask image is input into a learnable convolutional kernel to obtain a glare mask image. In one embodiment of this application, the calculation formula for the glare mask image is as follows:

[0084] Equation (13)

[0085] in, This represents a glare mask. Represents a binary mask image. This represents the convolution kernel.

[0086] In one embodiment of this application, formula (13) means that a convolution operation is performed on a binary mask image by a convolution kernel to obtain the result of the convolution operation. Then, the result of the convolution operation is binarized by setting an activation threshold of 8. That is, when the result of the convolution operation is greater than 8, the pixel value is set to 1, and when the result of the convolution operation is less than or equal to 8, the pixel value is set to 0, thereby realizing the morphological filling of the binary mask image to close the glare area and eliminate isolated noise points.

[0087] In one embodiment of this application, the process of determining the segmentation threshold of pixels in a grayscale image based on the pixel mean and pixel variance in each local image block includes:

[0088] The image segmentation mode is determined based on the time period during which the sample images were acquired. In one embodiment of this application, the image segmentation mode includes a daytime image segmentation mode and a nighttime image segmentation mode. If the sample images were acquired during the daytime, the daytime image segmentation mode is used; if the sample images were acquired at night, the nighttime image segmentation mode is used.

[0089] Based on the image segmentation mode, segmentation control parameters are determined, and a segmentation threshold is determined based on the segmentation control parameters, the pixel mean, and the pixel variance in each local image block. In one embodiment of this application, if the image segmentation mode is a daytime image segmentation mode, the segmentation control parameters are set to daytime segmentation control parameters; if the image segmentation mode is a nighttime image segmentation mode, the segmentation control parameters are set to nighttime segmentation control parameters. The calculation formula for determining the segmentation threshold based on the segmentation control parameters, the pixel mean, and the pixel variance in each local image block is shown in equation (11).

[0090] In one embodiment of this application, distinguishing between daytime and nighttime image segmentation modes helps improve the segmentation accuracy of vehicle images under different lighting conditions. For example, during the day, when the light is abundant and the overall brightness of the vehicle image is high, daytime segmentation control parameters can better adapt to the characteristics of daytime lighting, accurately identify and segment glare areas, and avoid misjudgments caused by excessively bright light. At night, when the light is dim, vehicle headlights and reflected light from the surrounding environment may create glare. Using nighttime segmentation control parameters can more accurately handle glare problems in nighttime images, improving image segmentation performance in low-light environments. By setting daytime and nighttime image segmentation modes, glare interference can be effectively suppressed, and vehicle feature information can be accurately extracted, regardless of whether it's in strong sunlight during the day or dim lighting at night. This improves the accuracy and reliability of vehicle re-identification, making the cross-day / nighttime vehicle re-identification method more adaptable and robust.

[0091] In one embodiment of this application, since the lighting conditions in different areas of the image may vary greatly, for example, in the area directly illuminated by the vehicle's headlights, the light intensity is high, and the pixel mean and variance of the local image block may be large, while in the shadow area of ​​the vehicle, the light intensity is low, and the pixel mean and variance of the local image block will be small. By adaptively calculating the segmentation threshold (calculated as in formula (11)), a higher segmentation threshold can be set in the area with strong light to avoid misjudging normal bright areas as glare; and a lower segmentation threshold can be set in the area with weak light to prevent some important feature information from being missed due to insufficient light. This allows for more accurate identification and segmentation of glare areas, reduces misjudgments caused by uneven lighting, and further improves the segmentation quality of vehicle images under complex lighting conditions. At the same time, adaptively calculating the segmentation threshold also helps to improve the generalization ability of the vehicle re-identification model, enabling the vehicle re-identification model to maintain good performance under various lighting conditions. Whether in sunny, cloudy, strong light, or weak light environments, it can effectively suppress glare interference and accurately extract the feature information of the vehicle, providing a more reliable foundation for cross-day and night vehicle re-identification. Furthermore, adaptive calculation of segmentation thresholds can reduce the need for manual intervention, improve the automation and accuracy of processing, and reduce labor costs and human error.

[0092] In one embodiment of this application, the process of inputting the enhanced feature map into the glare suppression module to obtain the suppressed feature map includes:

[0093] The initial feature map in the enhanced feature map is subjected to fully connected operations, nonlinear activation operations, and normalization operations to obtain a feature attention map. In one embodiment of this application, the expression of the feature attention map is as follows:

[0094] Equation (14)

[0095] in, Represents the attention feature map, This represents the initial feature map in the augmented feature map, consisting of the first 64 channels of features. This represents a fully connected layer, which performs a fully connected operation on the initial feature map in the enhanced feature map. This represents a non-linear activation function used to perform non-linear activation operations on the initial feature map after fully connected operations. This represents the Sigmoid function, which normalizes the initial feature map after the linear activation operation.

[0096] The glare mask image in the enhanced feature map is scaled and normalized to obtain the glare mask enhancement image. In one embodiment of this application, the calculation formula for the glare mask enhancement image is as follows:

[0097] Equation (15)

[0098] in, This represents a glare mask enhancement map. This represents the glare mask in the enhanced feature map, specifically the 65th channel feature. This represents the learnable scaling factor, with an initial value of 1.0. This represents the Sigmoid function, which is used to normalize the scaled glare mask image.

[0099] The glare enhancement map and the attention map are weighted and summed to obtain the joint mask feature map. In one embodiment of this application, the calculation formula for the joint mask feature map is as follows:

[0100] Equation (16)

[0101] in, Represents the joint mask feature map. Represents the attention feature map, This represents a glare mask enhancement map. This represents the learnable fusion coefficient, with an initial value set between [0.4, 0.6].

[0102] Based on the joint mask feature map and the suppression strength parameter, the sample image is suppressed to obtain a suppressed feature map. In one embodiment of this application, the expression of the suppressed feature map is as follows:

[0103] Equation (17)

[0104] in, Represents the suppressed feature map. This represents the feature map corresponding to the vehicle sample image. This represents the learnable inhibition strength parameter, with an initial value set to... , Represents the joint mask feature map. This indicates element-wise multiplication.

[0105] In one embodiment of this application, the sample image is suppressed based on the joint mask feature map and the suppression intensity parameter, which helps to reduce the interference of the glare region on feature extraction in the vehicle sample image and improves the vehicle feature extraction capability.

[0106] In one embodiment of this application, the process of inputting the suppressed feature map into the cross-domain feature fusion module to obtain the cross-domain fused feature map includes:

[0107] The suppressed feature map is input into the second residual module to obtain the second enhanced feature map. In one embodiment of this application, the second residual module is used to perform hierarchical feature extraction and transformation on the suppressed feature map to obtain the second enhanced feature map. The second residual module is ResNet50, etc.

[0108] The second enhanced feature map is input into the dual-domain structure enhancement module to obtain a spatial-channel enhanced feature map. In one embodiment of this application, the dual-domain structure enhancement module is used to enhance the feature structure of the second enhanced feature map in the spatial and channel domains through local gradient calculation to obtain a spatial-channel enhanced feature map.

[0109] The spatial domain-channel domain enhanced feature map is input into the cross-domain category perception module to obtain a cross-domain fused feature map. In one embodiment of this application, the cross-domain category perception module is used to perform cross-domain feature alignment and category perception enhancement operations on the spatial domain-channel domain enhanced feature map through a cross-domain attention mechanism to obtain a cross-domain fused feature map. By integrating the dual-domain structure enhancement module and the cross-domain category perception module in the second residual module, it is beneficial to improve the consistency of structural feature representation and category discrimination between the day and night domains.

[0110] In one embodiment of this application, the number of cross-domain feature fusion modules can be set to multiple. By sequentially inputting the suppressed feature maps into the cross-domain feature fusion modules, the suppressed feature maps can be further fused and enhanced in a multi-level and multi-dimensional manner, and feature information between different domains can be gradually mined and integrated in depth, making the final cross-domain fused feature map richer and more comprehensive. Moreover, with the increase in the number of cross-domain feature fusion modules, the vehicle re-identification model can better adapt to the feature changes of vehicle images under different lighting conditions during the day and night, improve the consistency and distinguishability of vehicle features between different domains, help reduce feature differences between day and night domains, and enable the vehicle re-identification model to accurately identify vehicles during both day and night. At the same time, the cascading use of multiple cross-domain feature fusion modules can also enhance the nonlinear fitting ability of the vehicle re-identification model and better capture complex features and patterns in vehicle images.

[0111] Figure 3 is a schematic diagram of the structure of a pre-built re-identification model shown in an exemplary embodiment of this application. As shown in Figure 3, the pre-built re-identification model includes: a day / night glare extraction module, a glare suppression module, a first residual module, a cross-domain feature fusion module, a global average pooling layer, a batch normalization layer, and a fully connected layer. The cross-domain feature fusion module includes: a second residual module, a dual-domain structure enhancement module, and a cross-domain category perception module. The day / night glare extraction module is used to perform grayscale conversion on the sample image, binarize the grayscale image, and fill the binary mask image with pixels to obtain a glare mask image. The glare suppression module is used to perform fully connected operations, nonlinear activation operations, and normalization operations on the initial feature map (located in the first 64 channels) in the enhanced feature map to obtain feature attention. The algorithm employs several methods: First, it scales and normalizes the glare mask map in the enhanced feature map to obtain a glare mask enhancement map. Then, it weights and sums the glare mask enhancement map and the attention map to obtain a joint mask feature map. Based on the joint mask feature map and suppression intensity parameters, it suppresses the sample image to obtain a suppressed feature map. A cross-domain category awareness module performs cross-domain feature alignment and category awareness enhancement on the spatial-channel enhanced feature map using a cross-domain attention mechanism to obtain a cross-domain fusion feature map. A global average pooling layer pools the cross-domain fusion feature map to obtain a global feature vector. A batch normalization layer normalizes the global feature vector to obtain a normalized feature vector. Finally, a fully connected layer performs a fully connected operation on the normalized feature vector to obtain the sample matching result.

[0112] In Figure 3, the daytime image is a vehicle image acquired during the day. The daytime vehicle image contains glare areas, resulting in uneven brightness. The daytime image is input into the day / night glare extraction module to obtain a daytime mask image. The nighttime image is a vehicle image acquired at night. The nighttime vehicle image contains glare areas, resulting in uneven brightness. The nighttime image is input into the day / night glare extraction module to obtain a nighttime mask image.

[0113] Figure 4 is a schematic diagram of the internal structure of the dual-domain structure enhancement module and the cross-domain category perception module, illustrating an exemplary embodiment of this application. In Figure 4, the process of the dual-domain structure enhancement module processing the second enhanced feature map includes: inputting the second enhanced feature map into the residual block to obtain the extracted feature map; performing a mask convolution operation on the extracted feature map to obtain the mask feature map; concatenating the mask feature map and the extracted feature map to obtain the night feature map; the process of inputting the night feature map into the cross-domain category perception module includes: performing a global average pooling operation on the night feature map to generate a night channel weight vector and a day channel weight vector; multiplying the night feature map with the night channel weight vector to obtain the night response map; multiplying the night feature map with the day channel weight vector to obtain the day response map; and fusing the night response map, the day response map, and the night feature map to obtain the cross-domain fused feature map.

[0114] In one embodiment of this application, the calculation formula for extracting the feature map is as follows:

[0115] Equation (18)

[0116] in, This indicates the extraction of feature maps. This represents the second enhanced feature map. This represents the intermediate transform layer features of residual block processing.

[0117] In one embodiment of this application, the formula for calculating the mask feature map is as follows:

[0118] Equation (19)

[0119] in, Represents the mask feature map. This indicates the extraction of feature maps. This represents the weight matrix of the masked convolution.

[0120] In one embodiment of this application, the calculation formula for the nighttime feature map is as follows:

[0121] Equation (20)

[0122] in, Represents nighttime feature maps, This indicates the extraction of feature maps. Represents the mask feature map. This represents the concatenation function.

[0123] In one embodiment of this application, the calculation formula for the nighttime response map is as follows:

[0124] Equation (21)

[0125] in, This represents the nighttime response map. Represents nighttime feature maps, represents the night channel weight vector, and ⊙ represents the channel multiplication operation.

[0126] The formula for calculating the daytime response diagram is as follows:

[0127] Equation (22)

[0128] in, This represents the daytime response diagram. Represents nighttime feature maps, ⊙ represents the daytime channel weight vector, and ⊙ represents the channel multiplication operation.

[0129] In one embodiment of this application, the calculation formula for the cross-domain fusion feature map is as follows:

[0130] Equation (23)

[0131] in, Represents cross-domain fusion feature maps. This represents the nighttime response map. This represents the daytime response diagram. Represents nighttime feature maps, This represents the fusion function, which can represent weighted fusion, channel splicing, or attention mechanism fusion, etc.

[0132] Figure 5 is a schematic diagram of the internal structure of the glare suppression module shown in an exemplary embodiment of this application. As shown in Figure 5, the process of the glare suppression module processing the enhanced feature map includes: performing a fully connected operation, a nonlinear activation operation, and a normalization operation on the initial feature map in the enhanced feature map to obtain a feature attention map; performing a scaling operation and a normalization operation on the glare mask map in the enhanced feature map to obtain a glare mask enhancement map; performing a weighted summation of the glare mask enhancement map and the attention map to obtain a joint mask feature map; and suppressing the sample image according to the joint mask feature map and the suppression intensity parameter to obtain a suppression feature map.

[0133] The performance of the vehicle re-identification model in this application was tested using a test dataset (e.g., the DN348 day-night dataset). The test results are shown in the table below:

[0134] Table 1

[0135]

[0136] As shown in Table 1, when the query sample is a vehicle image collected during the day and the vehicle matching result is a vehicle image collected at night (i.e., the Day-to-Night scenario), the Rank-1 is 0.791, the Rank-5 is 0.921, and the mAP is 0.450. When the query sample is a vehicle image collected at night and the vehicle matching result is a vehicle image collected during the day (i.e., the Night-to-Day scenario), the Rank-1 is 0.825, the Rank-5 is 0.934, and the mAP is 0.472. Compared with existing vehicle re-identification methods, the average improvement in Rank-1 and mAP exceeds 5%, which fully demonstrates that the vehicle re-identification model in this application has stronger robustness and discriminative power under complex lighting conditions.

[0137] In this application, when the input query sample is a vehicle image collected during the day, the matching degree of the night vehicle matching results output by the vehicle re-identification model decreases sequentially from the top 1 to the top 10. When the input query sample is a vehicle image collected at night, the matching degree of the day vehicle matching results output by the vehicle re-identification model decreases sequentially from the top 1 to the top 10. This verifies the generalization ability and stability of the vehicle re-identification model in the reverse illumination conversion scenario.

[0138] This application constructs a day-night glare extraction module (DNGEM) to adaptively detect bright or glare regions in images through local statistical analysis, and designs a glare suppression module (GSM) to dynamically reduce the interference of glare and semantically salient regions on feature extraction by fusing an attention mechanism, thereby improving the robustness of the vehicle re-identification model. Furthermore, a multi-task loss function is introduced to jointly optimize the classification, metric learning, and glare suppression objectives, enhancing the discriminative power of vehicle features. Experimental results show that this application significantly improves the accuracy of vehicle re-identification on the DN348 day-night dataset, with both mAP and Rank-1 metrics outperforming existing vehicle re-identification methods, effectively improving vehicle re-identification performance under complex lighting conditions, and is suitable for practical scenarios such as intelligent traffic monitoring and parking management.

[0139] The vehicle re-identification model designed in this application can be obtained by comparing vehicle sample images collected during the day or at night with a pre-built re-identification model. After obtaining the vehicle re-identification model, the vehicle re-identification model has a high matching success rate regardless of whether the vehicle image to be identified is collected during the day or at night, which verifies the effectiveness and robustness of the vehicle re-identification model.

[0140] The following describes an embodiment of the apparatus described in this application, which can be used to execute the cross-day / night vehicle re-identification method with glare suppression function described in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the cross-day / night vehicle re-identification method with glare suppression function described above in this application.

[0141] Figure 6 is a block diagram of a cross-day / night vehicle re-identification device with glare suppression function, illustrating an exemplary embodiment of this application.

[0142] As shown in Figure 6, this exemplary cross-day / night vehicle re-identification device 600 with glare suppression function includes:

[0143] The image acquisition module 601 is used to acquire images of the vehicle to be identified.

[0144] The image recognition module 602 is used to input the image of the vehicle to be recognized into the vehicle re-recognition model to obtain the vehicle matching result.

[0145] In one embodiment of this application, the vehicle image to be identified includes: a vehicle image acquired during the day or a vehicle image acquired at night, which is obtained through a camera or other device. The vehicle image to be identified is an image obtained after preprocessing.

[0146] In one embodiment of this application, the vehicle matching result is used to characterize the degree of matching between the label category corresponding to the vehicle to be identified and the recognition result output by the vehicle re-identification model. The vehicle re-identification model is obtained by training a pre-built re-identification model based on sample images. The sample images include vehicle sample images collected during the day or at night. The pre-built re-identification model includes: a day / night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module. The number of cross-domain feature fusion modules can be set to multiple, and the cross-domain feature fusion modules include: a second residual module, a dual-domain structure enhancement module, and a cross-domain category perception module. The vehicle sample images are images obtained after preprocessing. The preprocessing of the vehicle sample images includes: performing contrast adjustment, brightness adjustment, color enhancement, geometric transformation, filtering, and other operations on images of the same vehicle collected from non-overlapping camera perspectives to obtain images collected from non-overlapping camera perspectives after preprocessing; and fusing the images collected from non-overlapping camera perspectives after preprocessing to obtain the vehicle sample images.

[0147] In one embodiment of this application, by setting a day and night glare extraction module and a glare suppression module in the vehicle re-identification model, an adaptive recognition suppression mechanism for glare regions in the vehicle image to be identified is realized during the re-identification process. Moreover, the setting of the cross-domain feature fusion module enables feature fusion and feature alignment of vehicle images to be identified across time periods, which helps to reduce inter-domain differences and improve the generalization ability and robustness of the vehicle re-identification model.

[0148] In one embodiment of this application, the image recognition module further includes a glare extraction module, a feature enhancement and suppression module, a multi-task training module, and a vehicle matching module. The glare extraction module inputs a sample image into the day-night glare extraction module to obtain a glare mask image. The feature enhancement and suppression module inputs a sample image into a first residual module to obtain an initial feature map, and concatenates the glare mask image with the initial feature map to obtain an enhanced feature map. The enhanced feature map is then input into the glare suppression module to obtain a suppressed feature map. The multi-task training module constructs a loss function with the goal of minimizing the sum of the differences between the suppressed feature map and the feature map corresponding to the sample image, the differences between the global feature vector and the feature vector corresponding to the sample image, and the differences between the sample matching result and the label category corresponding to the sample image. Iteratively optimizes the pre-built recognition model. The vehicle matching module performs similarity matching between the vehicle feature vector output by the optimized recognition model and vehicle images in the cross-day-night image database to obtain a vehicle matching result.

[0149] It should be noted that the cross-day / night vehicle re-identification device with glare suppression function provided in the above embodiments and the cross-day / night vehicle re-identification method with glare suppression function provided in the above embodiments belong to the same concept. The specific operation methods of each module and unit have been described in detail in the method embodiments and will not be repeated here. In practical applications, the cross-day / night vehicle re-identification device with glare suppression function provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.

[0150] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the highway scene video segmentation method provided in the above embodiments.

[0151] Figure 7 is a schematic diagram illustrating the structure of a computer system for an electronic device according to an exemplary embodiment of this application. It should be noted that the computer system 700 for the electronic device shown in Figure 7 is merely an example and should not impose any limitations on the functionality or scope of use of the embodiments of this application.

[0152] As shown in Figure 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on programs stored in Read-Only Memory (ROM) 702 or programs loaded from storage portion 708 into Random Access Memory (RAM) 703. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An Input / Output (I / O) interface 705 is also connected to the bus 704.

[0153] The following components are connected to I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 710 as needed so that computer programs read from it can be installed into storage section 708 as needed.

[0154] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs various functions defined in the system of this application.

[0155] Another aspect of this application provides a computer-readable storage medium storing computer-readable instructions that, when executed by a computer's processor, cause the computer to perform the vehicle weight dynamic estimation method provided in the various embodiments described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not incorporated into the electronic device.

[0156] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0157] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A cross-day / night vehicle re-identification method with glare suppression function, characterized in that, The method includes: acquiring an image of a vehicle to be identified; the image of the vehicle to be identified includes: a vehicle image acquired during the day or a vehicle image acquired at night; inputting the image of the vehicle to be identified into a vehicle re-identification model to obtain a vehicle matching result; the vehicle matching result is used to characterize the degree of matching between the label category corresponding to the vehicle to be identified and the identification result output by the vehicle re-identification model; the vehicle re-identification model is obtained by training a pre-constructed re-identification model based on sample images, the sample images including: vehicle sample images acquired during the day or vehicle sample images acquired at night; the pre-constructed re-identification model includes: day and night glare detection... The process of training a pre-built re-identification model based on sample images to obtain the vehicle re-identification model includes: inputting the sample images into the day / night glare extraction module to obtain a glare mask image; specifically, this includes: converting the sample images into grayscale images, and dividing the grayscale images into multiple local image blocks through a sliding window of a preset size; calculating the pixel mean and pixel variance in each local image block; determining the pixel segmentation threshold in the grayscale image based on the pixel mean and pixel variance in each local image block; and segmenting the pixels in the grayscale image... The pixel values ​​in the grayscale image are compared with the segmentation threshold. Based on the comparison result, the pixel values ​​are binarized to obtain a binary mask image. The binary mask image is input into a learnable convolutional kernel to obtain a glare mask image. The sample image is input into the first residual module to obtain an initial feature map. The glare mask image and the initial feature map are then concatenated to obtain an enhanced feature map. The enhanced feature map is input into the glare suppression module to obtain a suppressed feature map. The suppressed feature map is input into the cross-domain feature fusion module to obtain a cross-domain fusion feature map. The cross-domain feature fusion module includes: a second residual module and a dual-domain structure enhancement module. The system includes a cross-domain category perception module; it pools the cross-domain fusion feature map to obtain a global feature vector; it normalizes the global feature vector to obtain a normalized feature vector; it performs a fully connected operation on the normalized feature vector to obtain a sample matching result; and it adjusts the parameters in the pre-built re-identification model with the goal of minimizing the sum of the differences between the suppressed feature map and the feature map corresponding to the sample image, the differences between the global feature vector and the feature vector corresponding to the sample image, and the differences between the sample matching result and the label category corresponding to the sample image, to obtain the vehicle re-identification model.

2. The cross-day / night vehicle re-identification method with glare suppression function according to claim 1, characterized in that, The process of determining the segmentation threshold of pixels in the grayscale image based on the pixel mean and pixel variance in each local image block includes: determining the image segmentation mode based on the acquisition time period of the sample image; the image segmentation mode includes: daytime image segmentation mode and nighttime image segmentation mode; determining the segmentation control parameters based on the image segmentation mode; and determining the segmentation threshold based on the segmentation control parameters, the pixel mean and pixel variance in each local image block.

3. The cross-day / night vehicle re-identification method with glare suppression function according to claim 1, characterized in that, The process of inputting the enhanced feature map into the glare suppression module to obtain the suppression feature map includes: performing a fully connected operation, a nonlinear activation operation, and a normalization operation on the initial feature map in the enhanced feature map to obtain a feature attention map; performing a scaling operation and a normalization operation on the glare mask map in the enhanced feature map to obtain a glare mask enhancement map; performing a weighted summation of the glare mask enhancement map and the attention map to obtain a joint mask feature map; and suppressing the sample image according to the joint mask feature map and the suppression intensity parameter to obtain the suppression feature map.

4. The cross-day / night vehicle re-identification method with glare suppression function according to claim 1, characterized in that, The process of inputting the suppressed feature map into the cross-domain feature fusion module to obtain the cross-domain fused feature map includes: inputting the suppressed feature map into the second residual module to obtain the second enhanced feature map; inputting the second enhanced feature map into the dual-domain structure enhancement module to obtain the spatial domain-channel domain enhanced feature map; and inputting the spatial domain-channel domain enhanced feature map into the cross-domain category perception module to obtain the cross-domain fused feature map.

5. The cross-day / night vehicle re-identification method with glare suppression function according to claim 1, characterized in that, If the sum of the differences between the suppressed feature map and the feature map corresponding to the sample image, the differences between the global feature vector and the feature vector corresponding to the sample image, and the differences between the sample matching result and the label category corresponding to the sample image are represented by a loss function, then the expression of the loss function includes: ,in, Represents the loss function. The label smoothing cross-entropy loss function is used to characterize the difference between the sample matching result and the label category corresponding to the sample image. The direction-invariant triplet loss function is used to characterize the difference between the global feature vector and the feature vector corresponding to the sample image. This represents the loss weighting coefficient. The glare suppression guided loss function is used to characterize the difference between the suppression feature map and the feature map corresponding to the sample image.

6. The cross-day / night vehicle re-identification method with glare suppression function according to claim 5, characterized in that, The expression for the label-smooth cross-entropy loss function includes: ,in, This represents the label smooth cross-entropy loss function. Represents the smoothing coefficient. This represents the total number of label categories c. This represents the probability that the predicted sample image belongs to label category y, where label category y is the label category corresponding to the sample image. This represents the probability that a predicted sample image belongs to label category c, which is different from label category y; the expression for the probability that a predicted sample image belongs to label category y includes: ,in, This represents the probability that the predicted sample image belongs to label category y. Indicates the label category corresponding to the sample image. The sum of the exponents of all category scores; the expression for the probability that the predicted sample image belongs to label category c includes: ,in, This represents the probability that the predicted sample image belongs to label class c. Indicates the label category in the sample matching results. The expression for the direction-invariant triplet loss function is: (The expression represents the exponential sum of scores across all categories.) ,in, This represents the direction-invariant triplet loss function. This represents the feature vector corresponding to the sample image. This represents the feature vector obtained by predicting positive samples. This represents the feature vector obtained by predicting negative samples. Indicates the interval value. The distance between two feature vectors is represented; the expression for the glare suppression guidance loss function includes: ,in, This represents the glare suppression guidance loss function. This represents the suppression feature map obtained by predicting positive samples. This represents the suppression feature map obtained from predicting negative samples. This represents the Sigmoid function. This represents the global pooling operation function.

7. A cross-day / night vehicle re-identification device with glare suppression function, characterized in that, The device includes: an image acquisition module for acquiring images of vehicles to be identified; the images of vehicles to be identified include: vehicle images acquired during the day or vehicle images acquired at night; an image recognition module for inputting the images of vehicles to be identified into a vehicle re-identification model to obtain vehicle matching results; the vehicle matching results are used to characterize the degree of matching between the label category corresponding to the vehicle to be identified and the recognition results output by the vehicle re-identification model; the vehicle re-identification model is obtained by training a pre-built re-identification model based on sample images, the sample images including: vehicle sample images acquired during the day or vehicle sample images acquired at night; the pre-built... The re-identification model includes: a day / night glare extraction module, a glare suppression module, a first residual module, and a cross-domain feature fusion module. The process of training the pre-constructed re-identification model based on sample images to obtain the vehicle re-identification model includes: inputting the sample images into the day / night glare extraction module to obtain a glare mask image; specifically, this includes: converting the sample images into grayscale images, and dividing the grayscale image into multiple local image blocks using a sliding window of a preset size; calculating the pixel mean and pixel variance in each local image block; determining the segmentation threshold for pixels in the grayscale image based on the pixel mean and pixel variance of each local image block; and then... The pixel values ​​in the grayscale image are compared with the segmentation threshold. Based on the comparison result, the pixel values ​​in the grayscale image are binarized to obtain a binary mask image. The binary mask image is input into a learnable convolutional kernel to obtain a glare mask image. The sample image is input into the first residual module to obtain an initial feature map, and the glare mask image and the initial feature map are concatenated to obtain an enhanced feature map. The enhanced feature map is input into the glare suppression module to obtain a suppressed feature map. The suppressed feature map is input into the cross-domain feature fusion module to obtain a cross-domain fusion feature map. The cross-domain feature fusion module includes: a second residual module, a dual-domain... The system comprises a structure enhancement module and a cross-domain category perception module. The cross-domain fusion feature map is pooled to obtain a global feature vector. The global feature vector is normalized to obtain a normalized feature vector. A fully connected operation is performed on the normalized feature vector to obtain a sample matching result. The parameters in the pre-built re-identification model are adjusted with the goal of minimizing the sum of the differences between the suppressed feature map and the feature map corresponding to the sample image, the differences between the global feature vector and the feature vector corresponding to the sample image, and the differences between the sample matching result and the label category corresponding to the sample image, thus obtaining the vehicle re-identification model.

8. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the cross-day / night vehicle re-identification method with glare suppression function as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Day and night crossing vehicle re-identification method and system

    CN118351473A

  • Day and night cross-domain vehicle re-identification method and device

    CN119399713A