Image semantic alignment re-identification method and device, equipment and storage medium
By automatically generating alignment features using a latent space diffusion model and combining it with masking techniques, the problem of high cost and conflicting optimization objectives in semantic re-identification is solved, achieving efficient semantic re-identification results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PENG CHENG LAB
- Filing Date
- 2025-12-03
- Publication Date
- 2026-05-01
AI Technical Summary
Existing semantic re-identification technologies are costly to construct large-scale fine-grained labeled datasets, and the simultaneous learning of discriminative and alignment representations by a single network presents a conflict in optimization objectives, affecting recognition performance.
The latent space diffusion model is used to automatically generate alignment query features and alignment candidate features. Masking is used to achieve accurate localization of key semantic regions. Feature association is strengthened through three-dimensional semantic matching of global, target and alignment dimensions, which reduces annotation cost and improves recognition accuracy.
It eliminates the need for manual annotation of semantic correspondences, automatically generates alignment features, reduces annotation workload, significantly improves recognition accuracy, and achieves dual optimization of annotation cost and recognition accuracy.
Smart Images

Figure CN121962650A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to image semantic alignment re-identification methods, apparatus, devices, and storage media. Background Technology
[0002] Semantic re-identification (Re-ID) aims to determine whether targets in different images share the same semantic identity, such as a specific person or vehicle, by analyzing the semantic representation matching degree between images. This technology is widely used in fields such as intelligent surveillance, image retrieval, and autonomous driving. However, semantic re-identification algorithms mainly face two core challenges: first, "high inter-class similarity," meaning that different targets with similar appearances are prone to mismatches; and second, "high intra-class dissimilarity," meaning that the same target can exhibit significant appearance differences in different images due to factors such as viewing angle, lighting, and occlusion.
[0003] Related technologies use fine-grained information, such as key points and component annotations, manually labeled to guide the semantic alignment process. However, these methods incur high costs when constructing large-scale fine-grained labeled datasets, limiting their practicality. Furthermore, the simultaneous learning of discriminative and alignment representations by a single network presents a conflict in optimization objectives, affecting the overall re-identification performance. Summary of the Invention
[0004] The main objective of this application is to propose an image semantic alignment re-identification method, apparatus, device, and storage medium to reduce annotation costs and improve the recognition accuracy of semantic re-identification.
[0005] To achieve the above objectives, a first aspect of this application proposes an image semantic alignment re-identification method, comprising: For the obtained query image and candidate image, the feature extraction network is used to obtain the discriminative query feature and discriminative candidate feature respectively, and the latent space diffusion model is used to obtain the alignment query feature and alignment candidate feature respectively, and the corresponding query mask and candidate mask are generated. Based on the query mask, obtain the authentication mask query feature of the authentication query feature and the alignment mask query feature of the alignment query feature respectively, and obtain the authentication mask candidate feature of the authentication candidate feature and the alignment mask candidate feature of the alignment candidate feature respectively based on the candidate mask. The global semantic matching degree is obtained based on the identification query feature and the identification candidate feature, and the target semantic matching degree is obtained based on the identification mask query feature and the identification mask candidate feature; A matching pair is obtained based on the alignment mask query feature and the alignment mask candidate feature, and the alignment semantic matching degree of the discrimination mask query feature and the discrimination mask candidate feature is obtained based on the matching pair; The re-identification results of the query image and the candidate image are obtained based on the global semantic matching degree, the target semantic matching degree, and the alignment semantic matching degree.
[0006] In some embodiments, the step of using the latent space diffusion model to obtain alignment query features and alignment candidate features includes: Obtain the text encoding features corresponding to the text description; The query image and the text encoding features are input into the latent space diffusion model for diffusion generation to obtain the aligned query features corresponding to the sampling time. The candidate image and the text encoding features are input into the latent space diffusion model for diffusion generation to obtain the aligned candidate features corresponding to the sampling time.
[0007] In some embodiments, obtaining a matching pair based on the alignment mask query feature and the alignment mask candidate feature includes: Calculate the similarity matrix between the alignment mask query features and the alignment mask candidate features; A matching matrix is generated based on the similarity matrix, and the matching pairs are obtained based on the matrix values in the matching matrix.
[0008] In some embodiments, generating a matching matrix based on the similarity matrix and obtaining the matching pair based on the matrix values in the matching matrix includes: The similarity matrix is virtually filled using a filling matrix to obtain a similarity filling matrix; The similarity filling matrix is calculated based on the Hungarian matching algorithm to obtain the matching matrix; The positions in the matching matrix where the matrix value corresponds to one are selected as the matching pairs.
[0009] In some embodiments, obtaining the alignment semantic matching degree of the discrimination mask query feature and the discrimination mask candidate feature based on the matching pair includes: Based on the matching pair, a query position vector is selected from the candidate features of the discrimination mask, and a candidate position vector is selected from the candidate features of the discrimination mask; Calculate the semantic similarity value between the query position vector and the candidate position vector, and obtain the alignment semantic matching degree by normalizing the mean value of all the semantic similarity values.
[0010] In some embodiments, obtaining the target semantic matching degree based on the discrimination mask query feature and the discrimination mask candidate feature includes: Global average pooling is performed on the discrimination mask query features and the discrimination mask candidate features to obtain query pooling features and candidate pooling features; The similarity between the query pooling feature and the candidate pooling feature is calculated to obtain the target semantic matching degree.
[0011] In some embodiments, obtaining the re-identification results of the query image and the candidate image based on the global semantic matching degree, the target semantic matching degree, and the aligned semantic matching degree includes: Calculate the average matching value of the global semantic matching degree and the aligned semantic matching degree, and then perform a weighted summation of the average matching value and the global semantic matching degree to obtain the consistency confidence score; The re-identification results of the query image and the candidate image are determined based on the consistency confidence level.
[0012] To achieve the above objectives, a second aspect of this application provides an image semantic alignment re-identification apparatus, comprising: Feature acquisition module: For the acquired query image and candidate image, it uses a feature extraction network to obtain the discriminative query features and discriminative candidate features respectively, and uses a latent space diffusion model to obtain the alignment query features and alignment candidate features respectively, and generates the corresponding query mask and candidate mask. Mask calculation module: used to obtain the authentication mask query feature of the authentication query feature and the alignment mask query feature of the alignment query feature according to the query mask, and to obtain the authentication mask candidate feature of the authentication candidate feature and the alignment mask candidate feature of the alignment candidate feature according to the candidate mask. Coarse-grained matching module: used to obtain global semantic matching degree based on the discrimination query feature and the discrimination candidate feature, and to obtain target semantic matching degree based on the discrimination mask query feature and the discrimination mask candidate feature; Fine-grained semantic matching module: used to obtain matching pairs based on the alignment mask query features and the alignment mask candidate features, and to obtain the alignment semantic matching degree of the discrimination mask query features and the discrimination mask candidate features based on the matching pairs; Re-identification module: used to obtain the re-identification results of the query image and the candidate image based on the global semantic matching degree, the target semantic matching degree and the alignment semantic matching degree.
[0013] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0014] To achieve the above objectives, a fourth aspect of the present application provides a storage medium that stores a computer program, which, when executed by a processor, implements the method described in the first aspect.
[0015] The image semantic alignment re-identification method, apparatus, device, and storage medium proposed in this application involve obtaining discriminative query features and discriminative candidate features from the acquired query image and candidate image using a feature extraction network, obtaining alignment query features and alignment candidate features using a latent space diffusion model, and generating corresponding query masks and candidate masks. Based on the query masks, discriminative mask query features of discriminative query features and alignment mask query features of alignment query features are obtained, as are discriminative mask candidate features of discriminative candidate features and alignment mask candidate features of alignment candidate features. A global semantic matching degree is obtained based on the discriminative query features and discriminative candidate features. A target semantic matching degree is obtained based on the discriminative mask query features and discriminative mask candidate features. A matching pair is obtained based on the alignment mask query features and alignment mask candidate features. An alignment semantic matching degree of the discriminative mask query features and discriminative mask candidate features is obtained based on the matching pair. Finally, a re-identification result of the query image and candidate image is obtained based on the global semantic matching degree, the target semantic matching degree, and the alignment semantic matching degree. This application's embodiments automatically generate alignment query features and alignment candidate features through a latent space diffusion model. Without requiring manual annotation of semantic correspondences, it can learn the semantic alignment rules of images in the latent space, uncovering potential association features between query and candidate images, thus avoiding strong reliance on manually labeled data. Simultaneously, it utilizes masks to achieve precise localization of key semantic regions, eliminating the need for manual annotation of regions of interest, further reducing annotation workload and costs. Furthermore, it captures semantic associations at the overall image level through global semantic matching, uses target semantic matching to locate feature matching of key semantic regions, and uses alignment semantic matching to represent local semantic alignment relationships, significantly improving recognition accuracy. Therefore, this application's embodiments utilize the unsupervised alignment capability of the latent space diffusion model to reduce annotation costs, enhance the accuracy of feature associations through global, target, and alignment three-dimensional semantic matching, ultimately achieving dual optimization of annotation cost and recognition accuracy in semantic re-identification tasks. Attached Figure Description
[0016] Figure 1 This is a schematic diagram illustrating the recognition principle of semantic re-identification.
[0017] Figure 2 This is a diagram illustrating the difficulties in semantic re-identification.
[0018] Figure 3 This is a flowchart of the image semantic alignment and re-identification method provided in the embodiments of this application.
[0019] Figure 4 This is a flowchart of obtaining alignment query features and alignment candidate features using the latent space diffusion model, as provided in the embodiments of this application.
[0020] Figure 5 This is a flowchart of obtaining the target semantic matching degree based on the identification mask query features and the identification mask candidate features provided in the embodiments of this application.
[0021] Figure 6 This is a flowchart provided in an embodiment of the present application for obtaining matching pairs based on alignment mask query features and alignment mask candidate features.
[0022] Figure 7 This is a flowchart of the alignment semantic matching degree of the identification mask query features and identification mask candidate features obtained based on matching pairs, provided in an embodiment of this application.
[0023] Figure 8 This is an overall flowchart of image semantic alignment and re-identification provided in the embodiments of this application.
[0024] Figure 9 This is a flowchart illustrating the calculation of alignment semantic matching degree provided in an embodiment of this application.
[0025] Figure 10 This is a structural block diagram of an image semantic alignment and re-recognition device provided in another embodiment of this application.
[0026] Figure 11 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0028] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0030] First, let's analyze some of the terms used in this application: Artificial Intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. It aims to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.
[0031] Semantic re-identification (Re-ID) aims to determine whether targets in different images share the same semantic identity, such as a specific person or vehicle, by analyzing the semantic representation matching between images. This technology is widely used in fields such as intelligent surveillance, image retrieval, and autonomous driving. (See reference...) Figure 1 , Figure 1 This is a schematic diagram illustrating the recognition principle of semantic re-identification. First, the query image and candidate images are input into their respective representation extraction networks to obtain corresponding representation features. Then, semantic representation matching is performed across images using these two types of features. Based on the matching results, semantic re-identification is performed, selecting images related to the query image from the candidate images. Specific downstream tasks can include video tracking or image retrieval.
[0032] Semantic re-identification algorithms face two main challenges: first, "high inter-class similarity," meaning that different targets with similar appearances are prone to mismatches; second, "high intra-class dissimilarity," meaning that the same target can exhibit significant appearance differences in different images due to factors such as viewpoint, lighting, and occlusion. (Refer to...) Figure 2 , Figure 2 This diagram illustrates the challenges of semantic re-identification. The image on the left, while not identical to the target in the query image, has a similar appearance and can be considered "high inter-class similarity." The image on the right, while identical to the target in the query image, exhibits a significant difference in appearance due to a different viewpoint and can be considered "high intra-class dissimilarity." As seen in the recognition process, the right image shows a lower degree of match with the left image during semantic re-identification, resulting in mismatches between different targets and even between the same target.
[0033] Related technologies use fine-grained information, such as key points and component annotations, manually labeled to guide the semantic alignment process. However, these methods incur high costs when constructing large-scale fine-grained labeled datasets, limiting their practicality. Furthermore, the simultaneous learning of discriminative and alignment representations by a single network presents a conflict in optimization objectives, affecting the overall re-identification performance.
[0034] Based on this, embodiments of this application provide an image semantic alignment re-identification method, apparatus, device, and storage medium. By automatically generating alignment query features and alignment candidate features through a latent space diffusion model, alignment query features and candidate alignment features are automatically generated without manual annotation of semantic correspondences. This allows the semantic alignment rules of images to be learned in the latent space, uncovering potential association features between query images and candidate images, thus avoiding strong reliance on manually labeled data. Simultaneously, masks are used to accurately locate key semantic regions, eliminating the need for manual annotation of regions of interest, further reducing annotation workload and costs. Furthermore, global semantic matching degree is used to capture semantic associations at the overall image level, and target semantic matching degree is used to locate feature matching of key semantic regions in the image. Alignment semantic matching degree is used to represent the alignment relationship of local semantics, significantly improving recognition accuracy. Therefore, embodiments of this application utilize the unsupervised alignment capability of the latent space diffusion model to reduce annotation costs, and enhance the accuracy of feature associations through three-dimensional semantic matching of global, target, and alignment dimensions, ultimately achieving dual optimization of annotation cost and recognition accuracy in semantic re-identification tasks.
[0035] This application provides an image semantic alignment re-identification method, apparatus, device, and storage medium, which are specifically described through the following embodiments. First, the image semantic alignment re-identification method in this application is described.
[0036] This application's embodiments can acquire and process relevant data based on artificial intelligence (AI) technology. AI is the theory, methods, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can react in a way similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.
[0037] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0038] The image semantic alignment re-identification method provided in this application relates to the field of image processing technology. This method can be applied to a terminal, a server, or a computer program running on either the terminal or the server. For example, the computer program can be a native program or software module in an operating system; it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run, such as a client supporting image semantic alignment re-identification, i.e., a program that only needs to be downloaded to a browser environment to run; or it can be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module, or plugin. The terminal communicates with the server via a network. The image semantic alignment re-identification method can be executed by the terminal or the server, or by the terminal and the server working together.
[0039] In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, or smartwatch, etc. Additionally, the terminal can also be a smart in-vehicle device. This smart in-vehicle device uses the image semantic alignment and re-recognition method of this embodiment to provide related services, improving the driving experience. The server can be an independent server, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms; it can also be a service node in a blockchain system, where the service nodes in the blockchain system form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). The terminal and server can connect via Bluetooth, Universal Serial Bus (USB), or network communication methods; this embodiment does not impose any limitations.
[0040] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0041] The image semantic alignment and re-identification method in the embodiments of this application is described below.
[0042] Figure 3 This is an optional flowchart of the image semantic alignment re-identification method provided in the embodiments of this application. Figure 3 The method may include, but is not limited to, steps 110 to 150. It is also understood that this embodiment... Figure 3 The order of steps 110 to 150 is not specifically limited. The order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0043] Step 110: For the obtained query image and candidate image, use the feature extraction network to obtain the discriminative query features and discriminative candidate features respectively, use the latent space diffusion model to obtain the alignment query features and alignment candidate features respectively, and generate the corresponding query mask and candidate mask.
[0044] In one embodiment, a query image and candidate images are first obtained. The query image is the image to be matched, and the candidate image can be selected from a candidate database for matching with the query image. After obtaining the query image and candidate images, a feature extraction network is used to obtain the discriminative query features corresponding to the query image and the discriminative candidate features corresponding to the candidate images. The feature extraction network can be an FNet network, using a VGG pre-trained network for feature extraction, as shown below:
[0045] Where F represents the feature extraction network, and I represents the query image or candidate image. This indicates the corresponding identification query feature or identification candidate feature.
[0046] In one embodiment, for both the query image and candidate images, alignment features need to be extracted, which can be achieved using a latent space diffusion model (LDM). The LDM model leverages the consistent distribution of semantically identical features in the latent space of the LDM model to achieve unsupervised, fine-grained semantic alignment without relying on any manual annotation. Combined with multi-level semantic matching, this effectively improves the accuracy and robustness of re-identification while avoiding dependence on expensive fine-grained annotations. (Refer to...) Figure 4 , Figure 4 This is a flowchart illustrating the process of obtaining alignment query features and alignment candidate features using a latent space diffusion model, as provided in this application embodiment. The flowchart specifically includes the following steps: Step 410: Obtain the text encoding features corresponding to the text description.
[0047] In one embodiment, a text description related to the query image is first obtained. This text description needs to be strongly correlated with the core semantics of the query image. It can be a precisely annotated description, such as "side view of a red sedan" or "SUV with black wheels," or an automatically generated general description, such as "a family car parked on the roadside" generated by an image recognition model. Then, the text description is input into the CLIP text encoder for feature extraction, obtaining the text-encoded features corresponding to the text description.
[0048] Step 420: Input the query image and text encoding features into the latent space diffusion model for diffusion generation to obtain the aligned query features corresponding to the sampling time. Input the candidate image and text encoding features into the latent space diffusion model for diffusion generation to obtain the aligned candidate features corresponding to the sampling time.
[0049] In one embodiment, feature extraction is performed on both the query image and candidate images using the same processing logic. The query image and candidate images are then combined with text-encoded features and input into a latent space diffusion model. The diffusion process generates aligned features, essentially aligning image features with text semantics during the diffusion generation process, achieving cross-modal alignment between image and text features. The latent space diffusion model performs iterative noise removal in a low-dimensional latent space based on the diffusion process. Compared to pixel-space diffusion, it is more computationally efficient and produces more compact feature representations. It can use text-encoded features as semantic guidance signals to constrain the generation direction of image features, ensuring that the generated aligned features contain both visual information from the image and semantic information from the text.
[0050] Taking a query image as an example, the query image and text-encoded features are input into a latent space diffusion model for diffusion generation, resulting in aligned query features corresponding to the sampling time. Specifically, the query image is resized to the model's input size, normalized, and then converted into initial latent space features by an encoder, such as the image branch of CLIP or the encoder of VAE, avoiding direct pixel input and improving processing efficiency. Then, the diffusion generation process begins, where the initial latent space features and text-encoded features are input into the latent space diffusion model. At each sampling time step, such as the t-th step in a 1000-step diffusion, the model guides the noise removal direction through text features. For example, if the text description is "red car," the model will retain visual features related to "red" and "car outline" in the image, while weakening the feature weights of background and irrelevant details. Finally, at a specified sampling time, such as t=500 steps in the middle of diffusion or t=1000 steps at the end, the corresponding features are output as aligned query features with the text semantics.
[0051] Similarly, for candidate images, the candidate images and text encoding features are input into the latent space diffusion model in the same manner as the query images to generate aligned candidate features corresponding to the sampling time.
[0052] The above process can be represented as:
[0053] in, This represents the latent space diffusion model. Represents the noise sampling function. This represents the initial latent space features of the image. Indicates the sampling time. Represents text encoding features. This indicates the corresponding alignment feature.
[0054] The above process utilizes the text-guided mechanism of the diffusion model to ensure that alignment features simultaneously carry both visual and semantic information, thereby improving the accuracy of subsequent retrieval and matching. Furthermore, for blurry or low-quality query images, the noise removal process of the diffusion model can mitigate the impact of noise, while text features can supplement semantic information, reducing the interference of visual quality on matching results.
[0055] In one embodiment, it is also necessary to generate a mask for the target semantics. For example, the DiffuPrompter algorithm is used to process the query image and the candidate image to obtain the query mask corresponding to the query image and the candidate mask corresponding to the candidate image, respectively.
[0056] Step 120: Obtain the identification mask query feature of the identification query feature and the alignment mask query feature of the alignment query feature according to the query mask, and obtain the identification mask candidate feature of the identification candidate feature and the alignment mask candidate feature of the alignment candidate feature according to the candidate mask.
[0057] In one embodiment, after obtaining the relevant query mask or candidate mask, local features of the mask-covered area can be accurately extracted from relevant discriminative and alignment features through mask filtering combined with feature extraction. This allows for focusing on key semantic regions of the image, eliminating interference from irrelevant regions such as the background, and improving the accuracy of subsequent feature matching. Since a mask is essentially a binary matrix in pixel space, it needs to be mapped to feature space to match the dimensions of the discriminative and alignment features, ensuring that the mask can accurately filter feature regions. Therefore, for the query image, it is necessary to obtain the discriminative mask query features of the discriminative query features and the alignment mask query features of the alignment query features based on the query mask. For the candidate image, it is necessary to obtain the discriminative mask candidate features of the discriminative candidate features and the alignment mask candidate features of the alignment candidate features based on the candidate mask.
[0058] Step 130: Obtain the global semantic matching degree based on the identification query features and identification candidate features, and obtain the target semantic matching degree based on the identification mask query features and identification mask candidate features.
[0059] In one embodiment, for identifying query features and candidate features, the global semantic matching degree is obtained directly by calculating vector similarity, as follows:
[0060] in, Indicates the distinguishing query features, Indicates the identification of candidate features, This indicates the global semantic matching degree.
[0061] In one embodiment, reference is made to Figure 5 , Figure 5 This is a flowchart provided in this application embodiment for obtaining the target semantic matching degree based on the discrimination mask query features and the discrimination mask candidate features, specifically including the following steps: Step 510: Perform global average pooling on the discrimination mask query features and discrimination mask candidate features to obtain query pooling features and candidate pooling features.
[0062] In one embodiment, the core function of global average pooling is to transform local mask features with spatial dimensions into one-dimensional global vectors without spatial dimensions. This preserves the core information of local features while reducing feature dimensionality, improving computational efficiency, and avoiding overfitting. Specifically, global average pooling is performed on both the discrimination mask candidate features and the alignment mask candidate features. The spatial dimensions of the feature map are traversed, and the feature values at all spatial locations in each channel dimension are averaged to obtain the aggregated value for that channel. The corresponding pooled feature is then obtained based on the aggregated value.
[0063] Step 520: Calculate the similarity between the query pooling features and the candidate pooling features to obtain the target semantic matching degree.
[0064] In one embodiment, the similarity between the query pooling feature and the candidate pooling feature is calculated to obtain the target semantic matching degree, which is expressed as:
[0065] in, This indicates the identification mask query feature. This indicates query pooling characteristics. Indicates the candidate features of the identification mask. Represents candidate pooling features. Indicates the semantic matching degree of the target.
[0066] Step 140: Obtain matching pairs based on alignment mask query features and alignment mask candidate features, and obtain the alignment semantic matching degree of discrimination mask query features and discrimination mask candidate features based on the matching pairs.
[0067] In one embodiment, in addition to calculating the coarser-grained global semantic matching degree and the target semantic matching degree, fine-grained alignment matching is also required. (See also...) Figure 6 , Figure 6 This is a flowchart provided in an embodiment of the present application for obtaining matching pairs based on alignment mask query features and alignment mask candidate features, specifically including the following steps: Step 610: Calculate the similarity matrix between the alignment mask query features and the alignment mask candidate features.
[0068] In one embodiment, a similarity matrix is used to represent the pairwise similarity information between alignment mask query features and alignment mask candidate features, transforming the semantic association of high-dimensional features into a two-dimensional matrix, intuitively presenting the matching strength between features in different regions. Therefore, the value of the i-th row and j-th column of the similarity matrix S between alignment mask query features and alignment mask candidate features is expressed as:
[0069] in, This represents the value in the i-th row and j-th column of the similarity matrix S. Let represent the representation vector of the i-th row of the alignment mask query feature. This represents the representation vector of the j-th column of the candidate features for the alignment mask, where all values are... By combining them, we can obtain the similarity matrix. , where m represents the dimension of the alignment mask query feature and n represents the dimension of the alignment mask candidate feature.
[0070] Step 620: Generate a matching matrix based on the similarity matrix, and obtain matching pairs based on the matrix values in the matching matrix.
[0071] In one embodiment, the Hungarian algorithm is used to pair semantic representations in order to find the optimal semantic correspondence between images. However, the mask can lead to inconsistencies in the number of representations. Therefore, it is also necessary to use a filling matrix to virtually fill the similarity matrix to obtain a similarity filling matrix, so that... Similarity filling matrix Represented as:
[0072] in, This represents the filling matrix, and should be set according to the actual situation.
[0073] Next, the similarity filling matrix is calculated based on the Hungarian matching algorithm to obtain the matching matrix. The calculation process is expressed as follows:
[0074] Then, the positions in the matching matrix where the matrix value corresponds to one are selected as matching pairs, represented as:
[0075] in, Represents the set of all matching pairs. This indicates matching the element in the i-th row and j-th column of matrix M, when... When a pair is matched, .
[0076] Next, refer to Figure 7 , Figure 7 This is a flowchart of the alignment semantic matching degree of the discrimination mask query feature and the discrimination mask candidate feature obtained based on the matching pair, provided in an embodiment of this application. The flowchart specifically includes the following steps: Step 710: Select the query position vector from the candidate features of the discrimination mask based on the matching pair, and select the candidate position vector from the candidate features of the discrimination mask.
[0077] In one embodiment, according to the set With these prompts, fine-grained semantic alignment between images can be achieved. For example... Then, the i-th representation vector of the candidate features of the discrimination mask is selected as the query position vector, and the j-th representation vector of the candidate features of the discrimination mask is selected as the candidate position vector.
[0078] Step 720: Calculate the semantic similarity value between the query position vector and the candidate position vector, and obtain the alignment semantic matching degree by normalizing the mean value of all semantic similarity values.
[0079] In one embodiment, the semantic similarity value between the query location vector and the candidate location vector is calculated and expressed as:
[0080] in, express The corresponding semantic similarity value.
[0081] Next, after summing all semantic similarity values, divide by the total number of matching pairs K to obtain the normalized mean, which is used as the alignment semantic matching degree. , is represented as:
[0082] As can be seen, by utilizing the consistent latent space distribution characteristics of the LDM model through the above process, alignment representations are generated under the guidance of text prompts without any component annotation. Furthermore, the Hungarian algorithm is used to dynamically construct fine-grained semantic matching relationships, replacing traditional manual annotation. This enables high-precision alignment between contrasting semantics while reducing annotation costs to zero.
[0083] Step 150: Obtain the re-identification results of the query image and candidate image based on the global semantic matching degree, the target semantic matching degree, and the alignment semantic matching degree.
[0084] In one embodiment, considering the information complementarity between different semantic levels, a weighted sum of image-level, target-level, and fine-grained-level alignment semantic matching scores is used to characterize the semantic matching degree between images, thereby improving re-identification accuracy. Therefore, the average matching value of the global semantic matching degree and the alignment semantic matching degree is calculated, and the consistency confidence score is obtained by weighted summation of the average matching value and the global semantic matching degree, expressed as:
[0085] in, Indicates the consistency confidence level. This represents a preset adjustment coefficient used to adjust the proportion of influence of global semantic matching degree, fine-grained semantic matching degree, and target semantic matching degree in semantic consistency judgment.
[0086] Then, the re-identification results of the query image and candidate images are determined based on the consistency confidence score. For example, a preset threshold is set for a specific scene. If the consistency confidence score of a candidate image is greater than or equal to the preset threshold, it is determined to be a potential matching image; otherwise, it is directly excluded. Then, all potential matching images are sorted in descending order of consistency confidence score. The higher the confidence score, the higher the ranking, and the most reliable matching result is output first.
[0087] In one embodiment, reference is made to Figure 8 , Figure 8 This is an overall flowchart of image semantic alignment and re-identification provided in the embodiments of this application.
[0088] First, the query image and candidate images are acquired as comparison images. Then, the algorithm proceeds to two branches. The first branch uses a feature extraction network to obtain the query features and candidate features for identification, respectively, and enhances the inter-class discrimination ability through identity classification pre-training. The second branch uses a latent space diffusion model to obtain the alignment query features and candidate features for alignment, independently extracting alignment representations and using text descriptions, such as "Photo of a vehicle" in the figure, to guide the generation of cross-modal features. The parameters of these two branches are completely isolated to avoid conflicting optimization objectives.
[0089] Next, for the identification query features and identification candidate features, global pooling is first performed, followed by calculation of the global semantic matching score using vector similarity. Then, the DiffuPrompter algorithm is used to process the query image and candidate image, obtaining the query mask for the query image and the candidate mask for the candidate image, respectively. Global average pooling is then performed on the identification mask query features and identification mask candidate features to obtain query pooled features and candidate pooled features. The similarity between the query pooled features and candidate pooled features is calculated to obtain the target semantic matching score. Simultaneously, matching pairs are obtained based on the aligned query features and aligned candidate features, and the aligned semantic matching score of the identification mask query features and identification mask candidate features is obtained based on these matching pairs. Finally, the average matching value of the global semantic matching score and the aligned semantic matching score is calculated. A weighted sum of the average matching value and the global semantic matching score is then performed to obtain the consistency confidence score. The re-identification result of the query image and candidate image is determined based on the consistency confidence score.
[0090] In one embodiment, reference is made to Figure 9 , Figure 9This is a schematic flowchart illustrating the calculation of alignment semantic matching degree provided in an embodiment of this application. For the query image and candidate images, a feature extraction network is used to obtain discriminative query features and discriminative candidate features, respectively. A latent space diffusion model is used to obtain alignment query features and alignment candidate features, respectively. The DiffuPrompter algorithm is then used to generate corresponding query masks and candidate masks. Based on the query masks, discriminative mask query features of discriminative query features and alignment mask query features of alignment query features are obtained, as are discriminative mask candidate features of discriminative candidate features and alignment mask candidate features of alignment candidate features, respectively. Matching pairs are obtained based on the alignment mask query features and alignment mask candidate features, and the alignment semantic matching degree of the discriminative mask query features and discriminative mask candidate features is obtained based on the matching pairs.
[0091] Understandably, during training, the model parameters of the latent space diffusion model and the DiffuPrompter algorithm can be frozen, and parameter optimization can be performed only on the feature extraction network.
[0092] As can be seen from the above, this application's embodiments aim to improve the re-identification algorithm's ability to identify difficult cases by constructing collaborative perception capabilities in three complementary dimensions: First, based on the semantic component correspondence generated by unsupervised alignment, the visual feature similarity of local detail elements of the target (such as a vehicle) in the image is accurately calculated, and component-level matching scores are obtained through normalization processing to achieve accurate capture of subtle differences; second, the features of the target's main body region are aggregated and analyzed as a whole, and the similarity score of the target's overall structure is calculated to enhance the perception capability of the target's macroscopic form; finally, the features of the entire image scene are comprehensively analyzed, and environmental context information is retained to assist in the judgment of the recognition results. The recognition results of these three dimensions are dynamically fused through an adaptive balancing strategy. When the optimal weight configuration verified by experiments is adopted, the recognition accuracy is significantly improved on cross-view target datasets, effectively overcoming the recognition bias problem caused by viewpoint changes and component occlusion. The core advantage lies in its multi-level collaborative perception capability: component-level matching ensures accurate identification of detail features, overall target matching maintains complete perception of the main body structure, and global scene matching retains the auxiliary judgment of environmental semantics. For example, in multi-scenario verification cases of vehicles, the embodiments of this application can still stably establish the correct component correspondence under complex conditions such as changes in vehicle color, changes in vehicle model, and changes in viewing angle.
[0093] The technical solution provided in this application involves obtaining identification query features and identification candidate features from the acquired query image and candidate image using a feature extraction network, obtaining alignment query features and alignment candidate features using a latent space diffusion model, and generating corresponding query masks and candidate masks. Based on the query masks, identification mask query features of the identification query features and alignment mask query features of the alignment query features are obtained, as are identification mask candidate features of the identification candidate features and alignment mask candidate features of the alignment candidate features. A global semantic matching degree is obtained based on the identification query features and identification candidate features. A target semantic matching degree is obtained based on the identification mask query features and identification mask candidate features. A matching pair is obtained based on the alignment mask query features and alignment mask candidate features. An alignment semantic matching degree of the identification mask query features and identification mask candidate features is obtained based on the matching pair. Finally, a re-identification result of the query image and candidate image is obtained based on the global semantic matching degree, the target semantic matching degree, and the alignment semantic matching degree. This application's embodiments automatically generate alignment query features and alignment candidate features through a latent space diffusion model. Without requiring manual annotation of semantic correspondences, it can learn the semantic alignment rules of images in the latent space, uncovering potential association features between query and candidate images, thus avoiding strong reliance on manually labeled data. Simultaneously, it utilizes masks to achieve precise localization of key semantic regions, eliminating the need for manual annotation of regions of interest, further reducing annotation workload and costs. Furthermore, it captures semantic associations at the overall image level through global semantic matching, uses target semantic matching to locate feature matching of key semantic regions, and uses alignment semantic matching to represent local semantic alignment relationships, significantly improving recognition accuracy. Therefore, this application's embodiments utilize the unsupervised alignment capability of the latent space diffusion model to reduce annotation costs, enhance the accuracy of feature associations through global, target, and alignment three-dimensional semantic matching, ultimately achieving dual optimization of annotation cost and recognition accuracy in semantic re-identification tasks.
[0094] This application also provides an image semantic alignment re-identification device, which can implement the above-described image semantic alignment re-identification method, see reference. Figure 10 The device includes: Feature acquisition module 1010: For the acquired query image and candidate image, it uses a feature extraction network to obtain the identification query feature and identification candidate feature respectively, uses a latent space diffusion model to obtain the alignment query feature and alignment candidate feature respectively, and generates the corresponding query mask and candidate mask.
[0095] Mask calculation module 1020: used to obtain the identification mask query feature and the alignment mask query feature of the identification query feature according to the query mask, and to obtain the identification mask candidate feature and the alignment mask candidate feature of the alignment candidate feature according to the candidate mask.
[0096] Coarse-grained matching module 1030: used to obtain the global semantic matching degree based on the discrimination query features and discrimination candidate features, and to obtain the target semantic matching degree based on the discrimination mask query features and discrimination mask candidate features.
[0097] Fine-grained semantic matching module 1040: used to obtain matching pairs based on alignment mask query features and alignment mask candidate features, and to obtain the alignment semantic matching degree of discrimination mask query features and discrimination mask candidate features based on the matching pairs.
[0098] Re-identification module 1050: used to obtain the re-identification results of the query image and candidate images based on the global semantic matching degree, the target semantic matching degree and the alignment semantic matching degree.
[0099] The specific implementation of the image semantic alignment re-identification device in this embodiment is basically the same as the specific implementation of the image semantic alignment re-identification method described above, and will not be repeated here.
[0100] This application also provides an electronic device, including: At least one memory; At least one processor; At least one program; The program is stored in a memory, and the processor executes the at least one program to implement the image semantic alignment re-recognition method described above in this application. The electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.
[0101] Please see Figure 11 , Figure 11 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1101 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 1102 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1102 and is called and executed by the processor 1101 to execute the image semantic alignment re-identification method of the embodiments of this application. Input / output interface 1103 is used to implement information input and output; The communication interface 1104 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1105 transmits information between various components of the device (e.g., processor 1101, memory 1102, input / output interface 1103, and communication interface 1104); The processor 1101, memory 1102, input / output interface 1103 and communication interface 1104 are connected to each other within the device via bus 1105.
[0102] This application embodiment also provides a storage medium that stores a computer program. When the computer program is executed by a processor, it implements the above-described image semantic alignment re-recognition method.
[0103] Memory, as a non-transitory storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0104] The image semantic alignment re-identification method, apparatus, device, and storage medium proposed in this application involve obtaining discriminative query features and discriminative candidate features from the acquired query image and candidate image using a feature extraction network, obtaining alignment query features and alignment candidate features using a latent space diffusion model, and generating corresponding query masks and candidate masks. Based on the query masks, discriminative mask query features of discriminative query features and alignment mask query features of alignment query features are obtained, as are discriminative mask candidate features of discriminative candidate features and alignment mask candidate features of alignment candidate features. A global semantic matching degree is obtained based on the discriminative query features and discriminative candidate features. A target semantic matching degree is obtained based on the discriminative mask query features and discriminative mask candidate features. A matching pair is obtained based on the alignment mask query features and alignment mask candidate features. An alignment semantic matching degree of the discriminative mask query features and discriminative mask candidate features is obtained based on the matching pair. Finally, a re-identification result of the query image and candidate image is obtained based on the global semantic matching degree, the target semantic matching degree, and the alignment semantic matching degree. This application's embodiments automatically generate alignment query features and alignment candidate features through a latent space diffusion model. Without requiring manual annotation of semantic correspondences, it can learn the semantic alignment rules of images in the latent space, uncovering potential association features between query and candidate images, thus avoiding strong reliance on manually labeled data. Simultaneously, it utilizes masks to achieve precise localization of key semantic regions, eliminating the need for manual annotation of regions of interest, further reducing annotation workload and costs. Furthermore, it captures semantic associations at the overall image level through global semantic matching, uses target semantic matching to locate feature matching of key semantic regions, and uses alignment semantic matching to represent local semantic alignment relationships, significantly improving recognition accuracy. Therefore, this application's embodiments utilize the unsupervised alignment capability of the latent space diffusion model to reduce annotation costs, enhance the accuracy of feature associations through global, target, and alignment three-dimensional semantic matching, ultimately achieving dual optimization of annotation cost and recognition accuracy in semantic re-identification tasks.
[0105] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0106] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0107] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0108] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0109] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0110] 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.
[0111] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above 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; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0112] The units described above 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 this embodiment according to actual needs.
[0113] 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.
[0114] 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 multiple 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 programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0115] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. An image semantic alignment re-recognition method, characterized in that, include: For the obtained query image and candidate image, the feature extraction network is used to obtain the discriminative query feature and discriminative candidate feature respectively, and the latent space diffusion model is used to obtain the alignment query feature and alignment candidate feature respectively, and the corresponding query mask and candidate mask are generated. Based on the query mask, obtain the authentication mask query feature of the authentication query feature and the alignment mask query feature of the alignment query feature respectively, and obtain the authentication mask candidate feature of the authentication candidate feature and the alignment mask candidate feature of the alignment candidate feature respectively based on the candidate mask. The global semantic matching degree is obtained based on the identification query feature and the identification candidate feature, and the target semantic matching degree is obtained based on the identification mask query feature and the identification mask candidate feature; A matching pair is obtained based on the alignment mask query feature and the alignment mask candidate feature, and the alignment semantic matching degree of the discrimination mask query feature and the discrimination mask candidate feature is obtained based on the matching pair; The re-identification results of the query image and the candidate image are obtained based on the global semantic matching degree, the target semantic matching degree, and the alignment semantic matching degree.
2. The image semantic alignment re-identification method according to claim 1, characterized in that, The method of obtaining alignment query features and alignment candidate features using the latent space diffusion model includes: Obtain the text encoding features corresponding to the text description; The query image and the text encoding features are input into the latent space diffusion model for diffusion generation to obtain the aligned query features corresponding to the sampling time. The candidate image and the text encoding features are input into the latent space diffusion model for diffusion generation to obtain the aligned candidate features corresponding to the sampling time.
3. The image semantic alignment and re-identification method according to claim 1, characterized in that, The step of obtaining matching pairs based on the alignment mask query features and the alignment mask candidate features includes: Calculate the similarity matrix between the alignment mask query features and the alignment mask candidate features; A matching matrix is generated based on the similarity matrix, and the matching pairs are obtained based on the matrix values in the matching matrix.
4. The image semantic alignment and re-identification method according to claim 3, characterized in that, The step of generating a matching matrix based on the similarity matrix and obtaining the matching pairs based on the matrix values in the matching matrix includes: The similarity matrix is virtually filled using a filling matrix to obtain a similarity filling matrix; The similarity filling matrix is calculated based on the Hungarian matching algorithm to obtain the matching matrix; The positions in the matching matrix where the matrix value corresponds to one are selected as the matching pairs.
5. The image semantic alignment re-identification method according to claim 1, characterized in that, The step of obtaining the alignment semantic matching degree of the discrimination mask query feature and the discrimination mask candidate feature based on the matching pair includes: Based on the matching pair, a query position vector is selected from the candidate features of the discrimination mask, and a candidate position vector is selected from the candidate features of the discrimination mask; Calculate the semantic similarity value between the query position vector and the candidate position vector, and obtain the alignment semantic matching degree by normalizing the mean value of all the semantic similarity values.
6. The image semantic alignment re-identification method according to claim 1, characterized in that, The step of obtaining the target semantic matching degree based on the discrimination mask query feature and the discrimination mask candidate feature includes: Global average pooling is performed on the discrimination mask query features and the discrimination mask candidate features to obtain query pooling features and candidate pooling features; The similarity between the query pooling feature and the candidate pooling feature is calculated to obtain the target semantic matching degree.
7. The image semantic alignment re-identification method according to any one of claims 1 to 6, characterized in that, The step of obtaining the re-identification results of the query image and the candidate image based on the global semantic matching degree, the target semantic matching degree, and the aligned semantic matching degree includes: Calculate the average matching value of the global semantic matching degree and the aligned semantic matching degree, and then perform a weighted summation of the average matching value and the global semantic matching degree to obtain the consistency confidence score; The re-identification results of the query image and the candidate image are determined based on the consistency confidence level.
8. An image semantic alignment and re-recognition device, characterized in that, include: Feature acquisition module: For the acquired query image and candidate image, it uses a feature extraction network to obtain the discriminative query features and discriminative candidate features respectively, and uses a latent space diffusion model to obtain the alignment query features and alignment candidate features respectively, and generates the corresponding query mask and candidate mask. Mask calculation module: used to obtain the authentication mask query feature of the authentication query feature and the alignment mask query feature of the alignment query feature according to the query mask, and to obtain the authentication mask candidate feature of the authentication candidate feature and the alignment mask candidate feature of the alignment candidate feature according to the candidate mask. Coarse-grained matching module: used to obtain global semantic matching degree based on the discrimination query feature and the discrimination candidate feature, and to obtain target semantic matching degree based on the discrimination mask query feature and the discrimination mask candidate feature; Fine-grained semantic matching module: used to obtain matching pairs based on the alignment mask query features and the alignment mask candidate features, and to obtain the alignment semantic matching degree of the discrimination mask query features and the discrimination mask candidate features based on the matching pairs; Re-identification module: used to obtain the re-identification results of the query image and the candidate image based on the global semantic matching degree, the target semantic matching degree and the alignment semantic matching degree.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the image semantic alignment re-recognition method according to any one of claims 1 to 7.
10. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the image semantic alignment re-recognition method according to any one of claims 1 to 7.