Unsupervised cross-domain vehicle re-identification method based on topology perception structure alignment and related device
By constructing a mutual information dictionary and a cross-domain topology graph, and combining intra-domain and extra-domain similarity, an adaptive alignment loss function is used to train the vehicle re-identification model. This solves the problem of decreased accuracy in vehicle re-identification under varying illumination conditions and achieves robustness and accuracy in cross-domain alignment.
Patent Information
- Application Number
- CN202511554937.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-02-10
AI Technical Summary
Existing vehicle re-identification technologies suffer from a significant drop in accuracy under drastic lighting conditions, especially during daytime and nighttime scenarios, making it difficult to maintain stable recognition precision.
An unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment is adopted. By constructing a mutual information dictionary and a cross-domain topology graph, a cross-domain bidirectional mapping pseudo-label set is generated. Combining intra-domain similarity and inter-domain similarity, an adaptive alignment loss function is determined to train the vehicle re-identification model.
The vehicle re-identification model has improved its recognition accuracy under different lighting conditions, and achieved robustness and accuracy in cross-domain alignment.
Smart Images

Figure CN121505552A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle re-identification technology, and in particular to an unsupervised cross-domain vehicle re-identification method and related apparatus based on topology-aware structure alignment. Background Technology
[0002] Vehicle re-identification, aiming to match images of the same vehicle captured by non-overlapping cameras, plays a crucial role in intelligent transportation systems. Existing technologies can ensure stable recognition accuracy in complex traffic scenarios, but most implementations still operate under single lighting conditions. The ability to identify the same vehicle from different monitoring facilities drops significantly between day and night. This is because daytime images contain ample vehicle details, making the features learnable by the model more readily apparent. However, at night, the details available for model recognition are limited, leading to a significant feature asymmetry in the information about the same vehicle between day and night. This makes it difficult for models trained in a single environment to adapt to drastically changing lighting conditions, resulting in decreased recognition accuracy. Summary of the Invention
[0003] To address the aforementioned issues, this application provides an unsupervised cross-domain vehicle re-identification method and related apparatus based on topology-aware structure alignment, which can improve the accuracy of vehicle re-identification for the trained model.
[0004] According to one aspect of the embodiments of this application, an unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment is proposed and applied to a vehicle re-identification model. The method includes:
[0005] The daytime image and the nighttime image of the vehicle are input into the vehicle re-identification model to obtain the cluster centers in the daytime domain and the cluster centers in the nighttime domain.
[0006] A mutual information dictionary is constructed based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0007] Based on the mutual information dictionary, a cross-domain topology graph is constructed for the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0008] Based on the cross-domain topology graph, a cross-domain bidirectional mapping pseudo-label set for the daytime domain and the nighttime domain is generated;
[0009] Based on the cross-domain bidirectional mapping pseudo-label set, a first mapping loss function for the daytime domain to the nighttime domain and a second mapping loss function for the nighttime domain to the daytime domain are determined;
[0010] The overall mapping loss function for the cross-domain topology graph is determined based on the first mapping loss function and the second mapping loss function;
[0011] Determine the intra-domain similarity and inter-domain similarity of the cluster centers in the daytime domain and the cluster centers in the nighttime domain;
[0012] The intra-domain weights corresponding to the intra-domain similarity and the inter-domain weights corresponding to the inter-domain similarity are determined based on the intra-domain similarity and the inter-domain similarity.
[0013] The adaptive alignment loss function is determined based on the intra-domain weights and the inter-domain weights.
[0014] The target loss function is determined based on the overall mapping loss function and the adaptive alignment loss function;
[0015] The vehicle re-identification model is trained according to the target loss function to obtain the trained vehicle re-identification model;
[0016] The image of the vehicle to be input is input into the trained vehicle re-identification model to re-identify the vehicle.
[0017] In the above scheme, constructing a mutual information dictionary based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain includes:
[0018] Determine the cosine similarity between the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0019] The mutual information dictionary is constructed based on the cosine similarity and the preset piecewise continuous weighting function;
[0020] The preset piecewise continuous weighted function is represented by the following formula: ; In the formula, For the mutual information dictionary, The cosine similarity is... The preset similarity threshold, These are preset adjustable parameters.
[0021] In the above scheme, generating a cross-domain bidirectional mapping pseudo-label set for the daytime domain and the nighttime domain based on the cross-domain topology graph includes:
[0022] A dynamic threshold strategy is used to determine the edge weights for the cross-domain topology graph;
[0023] A weighted cost matrix is constructed based on the mutual information dictionary and the edge weights;
[0024] The Hungarian algorithm is used to perform global optimal matching on the weighted cost matrix to obtain the cross-domain bidirectional mapping pseudo-label set.
[0025] In the above scheme, the cross-domain bidirectional mapping pseudo-label set includes daytime sample features corresponding to the cluster centers in the daytime domain, a first pseudo-label obtained by mapping the cluster centers in the daytime domain to the nighttime domain, nighttime sample features corresponding to the cluster centers in the nighttime domain, and a second pseudo-label obtained by mapping the cluster centers in the nighttime domain to the daytime domain. The daytime sample features correspond to the cluster centers in the nighttime domain, and the nighttime sample features correspond to the cluster centers in the daytime domain. Determining the first mapping loss function from the daytime domain to the nighttime domain and the second mapping loss function from the nighttime domain to the daytime domain based on the cross-domain bidirectional mapping pseudo-label set includes:
[0026] The first mapping loss function is determined based on the daytime sample features and the first pseudo-label.
[0027] The second mapping loss function is determined based on the nighttime sample features and the second pseudo-label.
[0028] In the above scheme, determining the overall mapping loss function for the cross-domain topology graph based on the first mapping loss function and the second mapping loss function includes:
[0029] The first mapping loss function is added to the second mapping loss function to obtain the overall mapping loss function.
[0030] In the above scheme, determining the target loss function based on the overall mapping loss function and the adaptive alignment loss function includes:
[0031] The target loss function is determined based on the preset first hyperparameter, the preset second hyperparameter, the overall mapping loss function, and the adaptive alignment loss function.
[0032] According to one aspect of the embodiments of this application, an unsupervised cross-domain vehicle re-identification device based on topology-aware structure alignment is proposed and applied in a vehicle re-identification model. The device includes:
[0033] The input unit is used to input daytime images and nighttime images of the vehicle into the vehicle re-identification model to obtain cluster centers in the daytime domain and cluster centers in the nighttime domain.
[0034] The first construction unit is used to construct a mutual information dictionary based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0035] The second construction unit is used to construct a cross-domain topology graph based on the mutual information dictionary for the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0036] The generation unit is used to generate a set of cross-domain bidirectional mapping pseudo-labels for the daytime domain and the nighttime domain based on the cross-domain topology graph;
[0037] The first determining unit is configured to determine, based on the cross-domain bidirectional mapping pseudo-label set, a first mapping loss function for the period from daytime domain to nighttime domain and a second mapping loss function for the period from nighttime domain to daytime domain;
[0038] The second determining unit is used to determine the overall mapping loss function for the cross-domain topology graph based on the first mapping loss function and the second mapping loss function;
[0039] The third determining unit is used to determine the intra-domain similarity and inter-domain similarity of the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0040] The fourth determining unit is used to determine the intra-domain weight corresponding to the intra-domain similarity and the inter-domain weight corresponding to the inter-domain similarity based on the intra-domain similarity and the inter-domain similarity;
[0041] The fifth determining unit is used to determine the adaptive alignment loss function based on the intra-domain weights and the inter-domain weights;
[0042] The sixth determining unit is used to determine the target loss function based on the overall mapping loss function and the adaptive alignment loss function;
[0043] The training unit is used to train the vehicle re-identification model according to the target loss function to obtain the trained vehicle re-identification model.
[0044] The re-identification unit is used to input the image of the vehicle to be input into the trained vehicle re-identification model in order to re-identify the vehicle.
[0045] According to one aspect of the embodiments of this application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment as described above.
[0046] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program that is read and executed by a processor of an electronic device, causing the electronic device to perform the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment as described above.
[0047] The beneficial effects of this application are as follows: This application uses daytime and nighttime images as training samples to input into the vehicle re-identification model, thereby obtaining cluster centers in the daytime domain and nighttime domain, and learning effective features in the daytime and nighttime domains. Based on this, a mutual information dictionary is constructed to better distinguish between reliable matching and fuzzy matching, enabling daytime and nighttime images of the same vehicle to be matched more effectively.
[0048] Furthermore, by constructing a cross-domain topology graph to capture the structural correlations between cluster centers in different domains, a cross-domain bidirectional mapping pseudo-label set is generated. This enables better index matching between the daytime and nighttime domains, achieving alignment solely at the cluster level. Based on this, a first mapping loss function from the daytime domain to the nighttime domain and a second mapping loss function from the nighttime domain to the daytime domain, i.e., the overall mapping loss function, can be constructed, providing a training foundation for the vehicle re-identification model.
[0049] On the other hand, cluster-level alignment alone cannot completely solve the cross-domain alignment problem. Therefore, this application uses intra-domain similarity and inter-domain similarity for multi-factor adaptive alignment, i.e., an adaptive alignment loss function. By combining the overall mapping loss function and the adaptive alignment loss function, a target loss function for training the vehicle re-identification model can be obtained. The vehicle re-identification model trained in this way can effectively re-identify vehicles from the input image, thereby improving the accuracy of vehicle re-identification. Attached Figure Description
[0050] Figure 1 This is a system architecture diagram of the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment provided in the embodiments of this application;
[0051] Figure 2 This is an architecture diagram of the vehicle re-identification model provided in the embodiments of this application;
[0052] Figure 3 A flowchart illustrating the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment provided in this application embodiment;
[0053] Figure 4 A block diagram of an unsupervised cross-domain vehicle re-identification device based on topology-aware structure alignment provided in an embodiment of this application;
[0054] Figure 5 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0055] Figure 6 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0056] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] It should be noted that while some processes described in the specification, claims, and accompanying drawings include multiple steps appearing in a specific order, it should be clearly understood that these steps may not be performed in the order they appear herein, or may be performed in parallel. The step numbers are merely used to distinguish different steps and do not themselves represent any execution order. Furthermore, descriptions such as "first," "second," or "objective" in this document are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. "Multiple" in this document refers to at least two.
[0058] It is worth noting that in the specific embodiments of this application, input images of vehicles (e.g., daytime images, nighttime images) and related data are involved. When the above embodiments of this application are applied to specific products or technologies, permission or consent from the target object is required, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, when an embodiment of this application needs to obtain input images of vehicles (e.g., daytime images, nighttime images) and related data, separate permission or consent from the target object can be obtained through pop-up windows or redirection to a confirmation page. After obtaining separate permission or consent from the target object, the necessary input images (e.g., daytime images, nighttime images) and related data for enabling the embodiments of this application to operate normally can then be obtained.
[0059] Please see Figure 1 , Figure 1 This is a system architecture diagram of the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment provided in this application embodiment. It includes a terminal 140, an Internet connection 130, a gateway 120, a server 110, etc.
[0060] Terminal 140 can take various forms, including desktop computers, laptops, PDAs (personal digital assistants), mobile phones, vehicle terminals, and dedicated terminals. Furthermore, it can be a single device or a collection of multiple devices. For example, multiple desktop computers can be interconnected via a local area network, sharing a single monitor to work collaboratively, forming a single terminal 140. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data.
[0061] Server 110 refers to a computer system capable of providing certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines). Server 110 can also communicate with the Internet 130 via wired or wireless means to exchange data.
[0062] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120.
[0063] The structure of the vehicle re-identification model in this application is described below, such as... Figure 2 As shown:
[0064] By inputting daytime images (i.e., daytime images as described in this application) and nighttime images (i.e., nighttime images as described in this application) into a shared layer, the cluster centers of the daytime domain are obtained through feature extraction from the shared layer. Figure 2 The clusters shown in blue) and the cluster centers of the night domain ( Figure 2 The clusters mentioned in yellow are used for instance alignment, which is achieved by constructing a mutual information dictionary and generating a cross-domain bidirectional mapping pseudo-label set.
[0065] The following provides a detailed description of the specific implementation methods of the embodiments of this application:
[0066] Please see Figure 3 , Figure 3 This is a flowchart illustrating the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment provided in this application embodiment. The unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment can be implemented by server 110 and / or terminal 140. Figure 3 The unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment shown includes:
[0067] Step 310: Input the daytime image of the vehicle and the nighttime image of the vehicle into the vehicle re-identification model to obtain the cluster centers in the daytime domain and the cluster centers in the nighttime domain.
[0068] Step 320: Construct a mutual information dictionary based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0069] Step 330: Construct a cross-domain topology graph based on the mutual information dictionary for the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0070] Step 340: Generate a cross-domain bidirectional mapping pseudo-label set for the daytime domain and the nighttime domain based on the cross-domain topology graph;
[0071] Step 350: Determine a first mapping loss function for the periodic domain to the nighttime domain and a second mapping loss function for the nighttime domain to the periodic domain based on the cross-domain bidirectional mapping pseudo-label set;
[0072] Step 360: Determine the overall mapping loss function for the cross-domain topology graph based on the first mapping loss function and the second mapping loss function;
[0073] Step 370: Determine the intra-domain similarity and inter-domain similarity of the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0074] Step 380: Determine the intra-domain weight corresponding to the intra-domain similarity and the inter-domain weight corresponding to the inter-domain similarity based on the intra-domain similarity and the inter-domain similarity;
[0075] Step 390: Determine the adaptive alignment loss function based on the intra-domain weights and the inter-domain weights;
[0076] Step 400: Determine the target loss function based on the overall mapping loss function and the adaptive alignment loss function;
[0077] Step 410: Train the vehicle re-identification model according to the target loss function to obtain the trained vehicle re-identification model;
[0078] Step 420: Input the image of the vehicle to be input into the trained vehicle re-identification model to re-identify the vehicle.
[0079] The complete embodiment of this application will be explained in detail below with reference to steps 310-420:
[0080] In step 310, daytime images and nighttime images of the vehicle are input into the vehicle re-identification model to obtain cluster centers in the daytime domain and cluster centers in the nighttime domain. For example... Figure 2 As shown, Figure 2The document illustrates the implementation details of the clustering instance double alignment framework for the vehicle re-identification model proposed in this application. The backbone network employs a two-stream residual network, ResNet-50. In a single batch, images representing eight identities are randomly selected, consisting of four daytime images and four nighttime images for training. All input images are first resized to 3 × 288 × 144, and data augmentation techniques such as random horizontal flipping, random grayscale, and random erasure are employed during the training phase. The Adam optimizer is used, with an initial learning rate set to 3.5 × 10⁻⁻⁶. 4 The weight is reduced by a factor of 0.1 every 20 epochs. The training process lasts for 100 epochs. For the first 50 epochs, only the multi-factor adaptive alignment method (i.e., through the adaptive alignment loss function) is used for initial cross-domain alignment, and it is given a weight of 0.5. For the next 50 epochs, a dictionary-guided graph matching method (i.e., using a mutual information dictionary) is introduced to enhance the cross-domain matching effect, and the loss weight of the multi-factor adaptive alignment method is reduced to 0.3.
[0081] In step 320, a mutual information dictionary is constructed based on the cluster centers of the daytime domain and the nighttime domain. Specifically, to enhance the robustness of cross-domain association and alignment, this application abandons the traditional approach of directly calculating the cosine similarity of cluster centers. Instead, it utilizes the mutual information between clusters to construct a structured topology and adaptively discovers reliable cross-domain correspondences.
[0082] In some embodiments, constructing a mutual information dictionary based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain includes:
[0083] Determine the cosine similarity between the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0084] The mutual information dictionary is constructed based on the cosine similarity and the preset piecewise continuous weighting function;
[0085] The preset piecewise continuous weighted function is represented by the following formula: ; In the formula, For the mutual information dictionary, The cosine similarity is... The preset similarity threshold, These are preset adjustable parameters.
[0086] To capture subtle associations with different confidence levels between cross-domain clusters, we construct a mutual information dictionary based on the cross-domain similarity matrix of cluster centers. Given the cluster centers in the daytime domain... Cluster centers in the nighttime domain We calculate their cosine similarity using the following formula: ; To better distinguish between reliable matching and fuzzy matching, we further introduce a piecewise continuous weighted function to construct a mutual information dictionary: ; in It is a preset similarity threshold. It is an adjustable parameter used to control the sensitivity and scaling of the mapping.
[0087] In step 230, a cross-domain topology graph is constructed based on the mutual information dictionary for the cluster centers of the daytime domain and the cluster centers of the nighttime domain.
[0088] Based on the aforementioned mutual information dictionary, we construct a cross-domain topology graph to capture the structural correlations between cluster centers in different domains. In this graph, cluster centers in different domains are treated as nodes, and edge weights are determined using a dynamic threshold strategy, defined as follows: ; in As the initial threshold, The difference between the final threshold and the initial threshold. This is the ratio of the current epoch count to the total epoch count. This ratio linearly increases the threshold to dynamically adjust the filtering strategy.
[0089] In step 340, a cross-domain bidirectional mapping pseudo-label set for the daytime domain and the nighttime domain is generated based on the cross-domain topology graph. In some embodiments, generating the cross-domain bidirectional mapping pseudo-label set for the daytime domain and the nighttime domain based on the cross-domain topology graph includes:
[0090] A dynamic threshold strategy is used to determine the edge weights for the cross-domain topology graph;
[0091] A weighted cost matrix is constructed based on the mutual information dictionary and the edge weights;
[0092] The Hungarian algorithm is used to perform global optimal matching on the weighted cost matrix to obtain the cross-domain bidirectional mapping pseudo-label set.
[0093] Based on continuous adjustments to the dynamic threshold, the vehicle re-identification model gradually filters and retains only the most reliable mutual information connections, ultimately forming a sparse but reliable cross-domain topology graph. Based on the established cross-domain topology graph structure, the weighted cost matrix is constructed as follows: ; Next, we apply the Hungarian algorithm to the weighted cost matrix to obtain the globally optimal match, thereby generating reliable cross-domain bidirectional mapping pseudo-labels. Based on the mapping relationships of these pseudo-labels, we construct a bidirectional cross-domain pseudo-label set. ,in This represents the index of daytime samples aligned with the nighttime samples.
[0094] Specifically, this application proposes an innovative dictionary-guided graph matching strategy that imposes dual topological constraints through a mutual information dictionary and a cross-domain topological graph. The mutual information dictionary encodes the latent semantic dependencies between clusters, while the cross-domain topological graph structure captures the cluster associations across domains. By jointly reasoning with these two structures, noisy matches can be effectively filtered, and high-confidence cluster pairs can be selected to guide alignment. Furthermore, we introduce cross-domain cross-image loss to achieve alignment of cross-domain feature distributions.
[0095] In step 350, a first mapping loss function for the daytime domain to the nighttime domain and a second mapping loss function for the nighttime domain to the daytime domain are determined based on the cross-domain bidirectional mapping pseudo-label set.
[0096] Specifically, the cross-domain bidirectional mapping pseudo-label set includes daytime sample features corresponding to the cluster centers in the daytime domain, a first pseudo-label obtained by mapping the cluster centers in the daytime domain to the nighttime domain, nighttime sample features corresponding to the cluster centers in the nighttime domain, and a second pseudo-label obtained by mapping the cluster centers in the nighttime domain to the daytime domain. The daytime sample features correspond to the cluster centers in the nighttime domain, and the nighttime sample features correspond to the cluster centers in the daytime domain.
[0097] After obtaining the bidirectional pseudo-label mapping set for the daytime and nighttime domains, a cross-domain mapping loss is introduced to mitigate the differences between cross-domain features. For the mapping between the daytime and nighttime domains, the first mapping loss function is calculated as follows: ; in For the features of i daytime samples, For nighttime cluster centers that match the features of daytime samples, j represents the pseudo-label assigned after mapping the i-th daytime domain cluster center to the nighttime domain cluster center. This refers to temperature hyperparameters.
[0098] Similarly, the second mapping loss function from night to day It can also be calculated using a similar method.
[0099] In step 360, the overall mapping loss function is as follows: ; In step 370, due to the significant neighborhood shift introduced by the strong lighting contrast between day and night scenes, cluster-level alignment alone cannot completely solve the cross-domain alignment problem. To enhance instance-level consistency, this application proposes a multi-factor adaptive alignment method. This method dynamically assigns higher weights to cross-domain samples with high alignment confidence, explicitly emphasizing their importance during the distribution alignment process.
[0100] This application first calculates intra-domain similarity. Inter-domain similarity These metrics quantify the relevance of instances within and across domains. To achieve precise alignment, we dynamically assign weights to instance pairs based on basic confidence, similarity strength, and semantic consistency, calculated as follows: ; in Control the basic match confidence. Emphasizing the strength of similarity, while This is used to capture semantic consistency. Initially, all weight factors are set to 1.0. Then, these weight factors are adaptively adjusted for intra-domain and inter-domain cases.
[0101] In step 380, (1) for intra-domain weights: To alleviate overfitting of the model to easily aligned samples and to encourage the model to focus on more challenging positive samples, this application optimizes the intra-domain weights. Specifically, for positive samples that satisfy pseudo-label consistency, the basic weights are defined as: ;
[0102] (2) For inter-domain weights: An adaptive threshold strategy is used to suppress noise or unreliable matching. The calculation method is as follows: ; If the sample pair satisfies Then assign a value ,in This is a predefined constant. If the cross-domain similarity exceeds the adaptive threshold, i.e. Then, soft nonlinear modulation is used to enhance the weights: ; If a sample pair meets the high similarity threshold and shares the same pseudo-label, then the class weight factor will be adjusted. By setting the maximum value to highlight semantic consistency, we achieve a more robust adaptive weighting through this hierarchical weight stacking strategy, which effectively enhances all positive matching sample pairs while suppressing noisy or unreliable matching results.
[0103] In step 390, the forced alignment problem inherent in traditional maximum mean squared error loss is alleviated through the multi-level adaptive weighting strategy described above. The squared form of the overall multi-factor adaptive alignment loss, and the definition of the adaptive alignment loss function, are as follows: ;
[0104] In step 400, after processing by the two core modules of this application, the vehicle re-identification model can significantly alleviate the domain differences caused by day and night scenes, thereby improving the model's adaptability to drastic lighting changes and reducing overall loss. Cross-domain intermapping loss and multi-factor adaptive loss Combined, the target loss function is defined as: ; in (First hyperparameter) and (Second hyperparameters) are all hyperparameters that balance the contribution of the corresponding auxiliary loss.
[0105] In step 410, the vehicle re-identification model is trained according to the target loss function to obtain the trained vehicle re-identification model. The target loss function can make the trained vehicle re-identification model more robust.
[0106] In step 420, the trained vehicle re-identification model is used to identify the input image of the vehicle. For example, if the input image is a daytime image of a vehicle, the corresponding nighttime image can be quickly matched to complete the vehicle re-identification and improve the accuracy of vehicle re-identification.
[0107] This application proposes a novel unsupervised cross-day and night domain vehicle re-identification task and designs a method such as Figure 2 The novel clustering-instance dual alignment framework shown here achieves two-level cross-domain alignment in a completely unsupervised manner.
[0108] A dictionary-guided graph matching module (also known as a mutual information dictionary) was developed. This module models the topological structure of cluster centers by capturing mutual information between them, thereby achieving reliable cross-domain cluster alignment.
[0109] A multi-factor adaptive alignment method is proposed, which explicitly considers the correlation between instances during the alignment process, thereby achieving more flexible and efficient feature adaptation.
[0110] In summary, this application proposes an unsupervised learning paradigm suitable for day and night vehicle re-identification, namely the clustering-instance dual alignment framework. This framework simultaneously considers topology-based clustering-level cross-domain alignment and adaptive weight-based instance-level alignment, thereby achieving reliable unsupervised cross-domain matching in both day and night scenarios.
[0111] The proposed dual alignment framework has two core components (or modules): First, from the perspective of clustering, a mutual information dictionary is constructed by estimating the cosine similarity scores between cluster centers. Then, this mutual information dictionary is used to construct a cross-domain topology graph to encode high-confidence correspondences. The Hungarian algorithm is used to achieve globally optimal clustering matching. Finally, the robustness of pseudo-labels is optimized using the cross-domain mapping loss function.
[0112] On the other hand, from the instance level, a multi-factor adaptive alignment method is designed. This method explicitly captures the correlation between instances during the alignment process, thereby achieving more adaptive and efficient feature alignment. By introducing a multi-factor adaptive weight strategy, the structural correlation between samples is emphasized, and higher weights are assigned to sample pairs with higher similarity, thereby mitigating the adverse effects of hard sample pairs on the alignment process.
[0113] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of the unsupervised cross-domain vehicle re-identification device based on topology-aware structure alignment provided in this application embodiment. This unsupervised cross-domain vehicle re-identification device based on topology-aware structure alignment is applied to a computer device, and may include:
[0114] The input unit 401 is used to input daytime images of the vehicle and nighttime images of the vehicle into the vehicle re-identification model to obtain cluster centers in the daytime domain and cluster centers in the nighttime domain.
[0115] The first construction unit 402 is used to construct a mutual information dictionary based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain;
[0116] The second construction unit 403 is used to construct a cross-domain topology graph for the cluster centers of the daytime domain and the nighttime domain based on the mutual information dictionary;
[0117] The generation unit 404 is used to generate a set of cross-domain bidirectional mapping pseudo-labels for the daytime domain and the nighttime domain based on the cross-domain topology graph;
[0118] The first determining unit 405 is used to determine a first mapping loss function for the daytime domain to the nighttime domain and a second mapping loss function for the nighttime domain to the daytime domain based on the cross-domain bidirectional mapping pseudo-label set.
[0119] The second determining unit 406 is used to determine the overall mapping loss function for the cross-domain topology graph based on the first mapping loss function and the second mapping loss function;
[0120] The third determining unit 407 is used to determine the intra-domain similarity and inter-domain similarity of the cluster centers of the daytime domain and the cluster centers of the nighttime domain.
[0121] The fourth determining unit 408 is used to determine the intra-domain weight corresponding to the intra-domain similarity and the inter-domain weight corresponding to the inter-domain similarity based on the intra-domain similarity and the inter-domain similarity;
[0122] The fifth determining unit 409 is used to determine an adaptive alignment loss function based on the intra-domain weights and the inter-domain weights;
[0123] The sixth determining unit 410 is used to determine the target loss function based on the overall mapping loss function and the adaptive alignment loss function;
[0124] Training unit 411 is used to train the vehicle re-identification model according to the target loss function to obtain the trained vehicle re-identification model;
[0125] The re-identification unit 412 is used to input the image of the vehicle to be input into the trained vehicle re-identification model in order to re-identify the vehicle.
[0126] Reference Figure 5 , Figure 5 To implement the structural block diagram of a portion of the terminal 140 in this application embodiment, the terminal 140 includes: a radio frequency (RF) circuit 710, a memory 715, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780, and a power supply 790, among other components. Those skilled in the art will understand that... Figure 5 The terminal 140 structure shown does not constitute a limitation on a mobile phone or computer, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0127] The RF circuit 710 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 780; in addition, it transmits uplink data to the base station.
[0128] The memory 715 can be used to store software programs and modules. The processor 780 executes various functional applications of the terminal and unsupervised cross-domain vehicle re-identification processing based on topology-aware structure alignment by running the software programs and modules stored in the memory 715.
[0129] The input unit 730 can be used to receive input numeric or character information, and to generate key signal inputs related to the terminal's settings and function control. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732.
[0130] The display unit 740 can be used to display input or provided information, as well as various menus of the terminal. The display unit 740 may include a display panel 741.
[0131] Audio circuitry 760, speaker 761, and microphone 762 provide an audio interface.
[0132] In this embodiment, the processor 780 included in the terminal 140 can execute the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment from the previous embodiment.
[0133] The terminal 140 in this application embodiment includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, and aircraft. This application embodiment can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.
[0134] Figure 6 This is a partial structural block diagram of a server 110 implementing an embodiment of this application. The server 110 can vary significantly due to different configurations or performance characteristics, and may include one or more central processing units (CPUs) 822 (e.g., one or more processors) and memory 832, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 842 or data 844. The memory 832 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server 110. Furthermore, the CPU 822 may be configured to communicate with the storage media 830 and execute the series of instruction operations in the storage media 830 on the server 110.
[0135] Server 110 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input / output interfaces 858, and / or one or more operating systems 841, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0136] The central processing unit 822 in server 110 can be used to execute the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment according to the embodiments of this application.
[0137] This application also provides a computer-readable storage medium for storing program code for executing the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment of the foregoing embodiments.
[0138] This application also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the above-described unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment.
[0139] Furthermore, the terms “comprising” and “including”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.
[0140] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0141] It should be understood that in the description of the embodiments of this application, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0144] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0145] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0146] It should also be understood that the various implementation methods provided in this application can be combined arbitrarily to achieve different technical effects.
[0147] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0148] The above is a detailed description of the embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. An unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment, characterized in that, The method, applied in vehicle re-identification models, includes: The daytime image and the nighttime image of the vehicle are input into the vehicle re-identification model to obtain the cluster centers in the daytime domain and the cluster centers in the nighttime domain. A mutual information dictionary is constructed based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain; Based on the mutual information dictionary, a cross-domain topology graph is constructed for the cluster centers of the daytime domain and the cluster centers of the nighttime domain; Based on the cross-domain topology graph, a cross-domain bidirectional mapping pseudo-label set for the daytime domain and the nighttime domain is generated; Based on the cross-domain bidirectional mapping pseudo-label set, a first mapping loss function for the period from the daytime domain to the nighttime domain and a second mapping loss function for the period from the nighttime domain to the daytime domain are determined; The overall mapping loss function for the cross-domain topology graph is determined based on the first mapping loss function and the second mapping loss function; Determine the intra-domain similarity and inter-domain similarity of the cluster centers in the daytime domain and the cluster centers in the nighttime domain; The intra-domain weights corresponding to the intra-domain similarity and the inter-domain weights corresponding to the inter-domain similarity are determined based on the intra-domain similarity and the inter-domain similarity. The adaptive alignment loss function is determined based on the intra-domain weights and the inter-domain weights. The target loss function is determined based on the overall mapping loss function and the adaptive alignment loss function; The vehicle re-identification model is trained according to the target loss function to obtain the trained vehicle re-identification model; The image of the vehicle to be input is input into the trained vehicle re-identification model to re-identify the vehicle.
2. The unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment according to claim 1, characterized in that, The construction of a mutual information dictionary based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain includes: Determine the cosine similarity between the cluster centers of the daytime domain and the cluster centers of the nighttime domain; The mutual information dictionary is constructed based on the cosine similarity and the preset piecewise continuous weighting function; The preset piecewise continuous weighted function is represented by the following formula: ; In the formula, For the mutual information dictionary, The cosine similarity is... The preset similarity threshold, These are preset adjustable parameters.
3. The unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment according to claim 2, characterized in that, The step of generating a cross-domain bidirectional mapping pseudo-label set for the daytime domain and the nighttime domain based on the cross-domain topology graph includes: A dynamic threshold strategy is used to determine the edge weights for the cross-domain topology graph; A weighted cost matrix is constructed based on the mutual information dictionary and the edge weights; The Hungarian algorithm is used to perform global optimal matching on the weighted cost matrix to obtain the cross-domain bidirectional mapping pseudo-label set.
4. The unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment according to claim 3, characterized in that, The cross-domain bidirectional mapping pseudo-label set includes daytime sample features corresponding to the cluster centers in the daytime domain, a first pseudo-label obtained by mapping the cluster centers in the daytime domain to the nighttime domain, nighttime sample features corresponding to the cluster centers in the nighttime domain, and a second pseudo-label obtained by mapping the cluster centers in the nighttime domain to the daytime domain. The daytime sample features correspond to the cluster centers in the nighttime domain, and the nighttime sample features correspond to the cluster centers in the daytime domain. Determining a first mapping loss function from the daytime domain to the nighttime domain and a second mapping loss function from the nighttime domain to the daytime domain based on the cross-domain bidirectional mapping pseudo-label set includes: The first mapping loss function is determined based on the daytime sample features and the first pseudo-label. The second mapping loss function is determined based on the nighttime sample features and the second pseudo-label.
5. The unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment according to claim 4, characterized in that, The step of determining the overall mapping loss function for the cross-domain topology graph based on the first mapping loss function and the second mapping loss function includes: The first mapping loss function is added to the second mapping loss function to obtain the overall mapping loss function.
6. The unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment according to claim 1, characterized in that, The step of determining the target loss function based on the overall mapping loss function and the adaptive alignment loss function includes: The target loss function is determined based on the preset first hyperparameter, the preset second hyperparameter, the overall mapping loss function, and the adaptive alignment loss function.
7. An unsupervised cross-domain vehicle re-identification device based on topology-aware structure alignment, characterized in that, The device, used in vehicle re-identification models, includes: The input unit is used to input daytime images and nighttime images of the vehicle into the vehicle re-identification model to obtain cluster centers in the daytime domain and cluster centers in the nighttime domain. The first construction unit is used to construct a mutual information dictionary based on the cluster centers of the daytime domain and the cluster centers of the nighttime domain; The second construction unit is used to construct a cross-domain topology graph based on the mutual information dictionary for the cluster centers of the daytime domain and the cluster centers of the nighttime domain; The generation unit is used to generate a set of cross-domain bidirectional mapping pseudo-labels for the daytime domain and the nighttime domain based on the cross-domain topology graph; The first determining unit is configured to determine, based on the cross-domain bidirectional mapping pseudo-label set, a first mapping loss function for the period from daytime domain to nighttime domain and a second mapping loss function for the period from nighttime domain to daytime domain; The second determining unit is used to determine the overall mapping loss function for the cross-domain topology graph based on the first mapping loss function and the second mapping loss function; The third determining unit is used to determine the intra-domain similarity and inter-domain similarity of the cluster centers of the daytime domain and the cluster centers of the nighttime domain; The fourth determining unit is used to determine the intra-domain weight corresponding to the intra-domain similarity and the inter-domain weight corresponding to the inter-domain similarity based on the intra-domain similarity and the inter-domain similarity; The fifth determining unit is used to determine the adaptive alignment loss function based on the intra-domain weights and the inter-domain weights; The sixth determining unit is used to determine the target loss function based on the overall mapping loss function and the adaptive alignment loss function; The training unit is used to train the vehicle re-identification model according to the target loss function to obtain the trained vehicle re-identification model. The re-identification unit is used to input the image of the vehicle to be input into the trained vehicle re-identification model in order to re-identify the vehicle.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment as described in any one of claims 1 to 6.
9. A computer program product, the computer program product comprising a computer program, characterized in that, The computer program is read and executed by the processor of the electronic device, causing the electronic device to perform the unsupervised cross-domain vehicle re-identification method based on topology-aware structure alignment as described in any one of claims 1 to 6.