A single-camera-based pedestrian re-identification non-conscious check-in method and system
By employing a two-stage training strategy that combines self-supervised pre-training and supervised fine-tuning, a pedestrian re-identification model based on the ViT architecture is constructed. This addresses the issues of high cost, low recognition accuracy, and insufficient cross-view robustness in existing systems, achieving low-cost, high-accuracy single-camera pedestrian re-identification, which is suitable for contactless check-in systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN POLYTECHNIC UNIV
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-05
AI Technical Summary
Existing pedestrian re-identification systems are costly and complex to deploy. They have low recognition accuracy under single cameras and insufficient robustness across viewpoints. Traditional model training strategies result in poor fusion of global and local features.
A single-camera pedestrian re-identification method is adopted. A two-stage training strategy combining self-supervised pre-training and supervised fine-tuning is used to construct a pedestrian re-identification model with a ViT architecture. A dual-branch feature fusion module is introduced, and the interaction and fusion of global and local features are optimized by combining Siamese networks and block-level mask reconstruction loss. Spatial information is injected to enhance embedding and improve the robustness of cross-view recognition.
It achieves low-cost, high-accuracy pedestrian re-identification, significantly improves cross-view recognition capabilities, reduces hardware costs by 60%, shortens deployment time by 80%, and achieves a recognition accuracy of 95%, making it suitable for contactless check-in systems.
Smart Images

Figure CN122157305A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and biometric recognition technology, and in particular to a non-contact check-in method and system based on single-camera pedestrian re-identification. Background Technology
[0002] With the development of artificial intelligence technology, pedestrian re-identification technology has become an important research direction in the field of computer vision. Traditional methods and systems have many limitations: existing pedestrian re-identification systems usually require the deployment of multiple cameras, and the tracking of people is achieved through the collaborative work between the cameras. This approach is costly, complex to deploy, and requires precise camera calibration and time synchronization; existing systems are sensitive to environmental factors such as changes in lighting, viewpoint, and occlusion, and the recognition accuracy drops significantly in complex environments; existing pedestrian re-identification model training strategies have defects. Traditional models mostly use single-supervised training or simple self-supervised pre-training. Bi-branch feature learning is prone to semantic disconnect, the fusion effect of global and local features is poor, the robustness of cross-viewpoint (front / back) recognition is insufficient, and the problem of bi-directional viewpoint feature differences under a single camera has not been effectively solved, making it difficult to adapt to the high precision and high robustness requirements of contactless check-in.
[0003] Therefore, how to develop a low-cost, easy-to-deploy, and highly accurate single-camera two-way pedestrian re-identification system has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0004] This invention aims to solve the following problems in the prior art: the high cost and complex deployment of traditional multi-camera-based systems; the low accuracy of pedestrian re-identification and insufficient cross-view robustness in single-camera environments; and the problems of fragmented bi-branch features and poor fusion of global and local features in traditional model training.
[0005] To achieve the above objectives, this invention provides a contactless check-in method based on single-camera pedestrian re-identification, comprising the following steps:
[0006] S1. A sequence of images of people is acquired by a single camera. The sequence of images includes a frontal image of a person entering and a back image of a person leaving. An labeled dataset containing identity labels, viewpoint labels, and camera labels is constructed to provide data support for subsequent self-supervised pre-training and supervised fine-tuning.
[0007] S2, a pedestrian re-identification model is built based on the ViT (Vision Transformer) architecture. The model includes a Patch embedding module, a spatial information enhancement embedding module, a Transformer encoder module, and a feature pooling module. A two-stage training strategy of "self-supervised pre-training + supervised fine-tuning" is adopted. In the self-supervised pre-training stage, a dual-branch feature fusion module (DBFF) is added to realize feature interaction and collaborative optimization between the global feature comparison branch and the block-level mask reconstruction branch. It simultaneously learns personnel identity features and viewpoint-invariant features to improve the robustness of cross-viewpoint recognition.
[0008] The two-stage training strategy of "self-supervised pre-training + supervised fine-tuning" specifically includes:
[0009] S21, Construct a twin network structure, including a Student network and a Teacher network. The parameters of the Teacher network are updated from the Student network using an exponential moving average strategy, as shown in formula (1):
[0010] θ teacher ←τ·θ teacher +(1-τ)·θ student (1)
[0011] Where τ is the momentum coefficient, which ensures the stability of the feature distribution of the Teacher network;
[0012] S22 adopts a block-level mask reconstruction paradigm and introduces learnable mask markers x. [mask] (Analog category marker x) [cls] The input image is subjected to random block-level masking to construct a mask image. Input the full version and the masked version of the same image into the model respectively; where the masked image is defined as shown in formula (2):
[0013]
[0014] In the formula, m i ∈{0,1} represents a random image patch mask label, m i =1 indicates that the corresponding image patch is masked, m i =0 indicates no masking; for masked image block features output by the ViT encoder. Perform MLP network transformation and project onto d output The dimensional vector space is obtained Constructing the Patch-wise Masked Reconstruction Loss (L PMRL The calculation method is shown in formula (3):
[0015]
[0016] in, Let be the baseline feature probability distribution of the i-th image patch output by the Teacher network. P(x) is the probability distribution of the reconstructed features of the i-th image patch output by the Student network. P(x) is the Softmax normalization function. This loss is used to achieve accurate reconstruction of mask region features and alignment of local features, forming a self-supervised pre-trained local mask reconstruction branch.
[0017] S23, Introduce Global Feature Contrastive Loss (L... GFCL To optimize the consistency of global feature distribution between the Student and Teacher networks, the model is guided to learn global features with strong discriminative power by measuring the difference in global feature probability distribution output by the two networks. The loss function is shown in formula (4).
[0018] L GFCL =-∑ i P teacher (i)·log P student (i) (4)
[0019] Among them, P teacher and P student These are the global feature probability distributions output by the Teacher network and the Student network, respectively. This loss constitutes the global feature contrast branch of the self-supervised pre-training, which exists in parallel with the block-level mask reconstruction branch.
[0020] S24 introduces a dual-branch feature fusion module (DBFF) to target the global feature comparison branch (L... GFCL ) and block-level mask reconstruction branch (L PMRL To address the issues of independent optimization and feature semantic disconnect, a bidirectional attention interaction for dual-branch features is implemented at the output of the Transformer encoder in the Student network. This is achieved using the z-axis output of the Transformer. [cls] and z [patchs] For input:
[0021] Global→Local: using z [cls] For Q, z [patchs] For key-value pairs, output local features that incorporate global constraints.
[0022] Local→Global: using z [patchs] For Q, z [cls] For key-value pairs, output global features that fuse local details.
[0023] The loss is recalculated based on the fused features to obtain the weighted total loss:
[0024]
[0025] Wherein, λ1 and λ2 are the weight coefficients of the global feature contrast loss and the block-level mask reconstruction loss, respectively;
[0026] S25, the supervised fine-tuning stage, uses identity labels and viewpoint labels as supervision signals, and introduces a triple loss: identity classification loss, metric learning loss, and pose confusion loss, with a total loss of:
[0027] L totalfinetune =L id +α·L metric +β·L confuse (6)
[0028] Fine-tuning was performed using the Teacher network parameters as an initial baseline to optimize the ViT backbone network and improve pedestrian re-identification accuracy.
[0029] S3 performs sequential processing on the acquired images, including size normalization to a specific pixel size, random horizontal flipping, random cropping, random erasure, data augmentation, and standardization, to enhance the model's generalization ability.
[0030] S4. Input the preprocessed image into the pedestrian re-identification model. The image is divided into several non-overlapping image blocks by the Patch embedding module. Each image block is mapped to a feature vector of dimension d. At the same time, learnable category labels and two-dimensional learnable position codes are added. The position codes and category labels are concatenated and superimposed on the image block embedding vector.
[0031] S5, through the spatial information enhancement embedding module, combined with the camera labels and view labels of the dataset, injects lens-aware embedding and view-aware embedding into the feature vector to achieve accurate alignment of cross-lens and cross-view features. Its calculation method is shown in formula (7):
[0032] E sIE =E pos +λ·SIE (cam,view) (7)
[0033] Among them, E pos The location code obtained in step S4, λ is the spatial information enhancement coefficient, SIE (cam,view) The SIE embedding matrix is obtained by combining the camera ID (cam) and view ID (view) based on the camera index (cam) and view index (view). When there are multiple cameras and multiple view scenes, the SIE embedding matrix is expressed as formula (8):
[0034]
[0035] Where C is the number of cameras, V is the number of viewpoints, and d is the embedding dimension. This embedding mechanism solves the problem of feature differences between two-way viewpoints under a single camera.
[0036] S6, the feature vector with enhanced spatial information is injected into the Transformer encoder module. The module contains L layers of encoding blocks. Each encoding block consists of a multi-head self-attention sub-layer and a feedforward neural network sub-layer. The residual connection and random depth regularization strategy are adopted. The feature update process is shown in formulas (9) and (10):
[0037] Z′ l =MSA(LN(Z) l-1 ))+Z l-1 (9)
[0038] Z l =MLP(LN(Z′) l ))+Z′ l (10)
[0039] Among them, Z l-1 Z1 and Z2 are the output features of the (l-1)th and 1st layers, respectively. MSA is the multi-head self-attention function, LN is the layer normalization operation, and MLP is the feedforward neural network. The encoder finally outputs two types of core features: global category label feature Z[cls] (used for the global feature contrast branch) and local image patch feature Z2. [patchs] (used for block-level mask reconstruction branch), together they constitute a deep feature representation containing identity information and viewpoint information;
[0040] S7, input the deep feature representation into the feature pooling module, and use generalized mean pooling to aggregate all image patch features except for the class label. After aggregation, add the aggregated features to the class label features to obtain the final fused feature vector. The generalized mean pooling calculation is shown in formula (11):
[0041]
[0042] Where N is the number of image patches, x i Let be the feature vector of the i-th image patch, and p be the power exponent parameter (default value is 3). The fused feature vector is expressed by the formula:
[0043] f final =f CLS +f GEM (12)
[0044] Among them, f CLS The feature vectors labeled with categories are used to strengthen the association between global and local features through this fusion method;
[0045] S8, based on the fusion of feature vectors for personnel identity matching and perspective discrimination, uses cosine distance to measure the similarity between the query image and the database image, and the calculation method is shown in formula (13):
[0046]
[0047] Among them, f q and f g These are the fused feature vectors of the query image and the library image, respectively, where ||·|| represents the L2 norm operation; when the cosine distance is less than a preset threshold and the view is determined to be a frontal view, a record of a person entering the check-in is generated; when the view is determined to be a rear view, a record of a person leaving the check-in is generated.
[0048] S9 links attendance records with the personnel information database to generate a complete access log containing personnel identity, entry and exit time, and entry and exit direction, enabling automated tracking of two-way personnel flow;
[0049] To achieve the above method, this invention also provides a contactless check-in system based on single-camera pedestrian re-identification. Employing the aforementioned contactless check-in method, this system is an end-to-end automated system comprising multiple modules:
[0050] Image acquisition module: Used to acquire image sequences of people through a single camera, accurately capture the frontal image of people entering and the back image of people leaving, and synchronously record the acquisition time sequence information corresponding to the images to provide raw data for dataset construction;
[0051] Preprocessing module: Used to perform preprocessing operations on the raw images acquired by the image acquisition module, including size normalization, random horizontal flipping, random cropping, random erasure, data augmentation and standardization, controlling the data augmentation intensity according to preset parameters, and outputting standardized image data that meets the model input requirements;
[0052] Feature extraction module: Built on the ViT (Vision Transformer) architecture, integrating a Patch embedding submodule, a spatial information enhancement embedding submodule, a Transformer encoder submodule, and a feature pooling submodule. The Patch embedding submodule performs image patch segmentation and feature mapping; the spatial information enhancement embedding submodule injects lens-viewpoint perception information; the Transformer encoder submodule extracts deep features through a multi-layer attention mechanism; and the feature pooling submodule uses generalized mean pooling to aggregate features, ultimately outputting a feature vector that fuses identity and viewpoint information. It implements a two-stage training process of "self-supervised pre-training + supervised fine-tuning," including a Siamese network construction unit, a block-level masking unit, a dual-branch feature fusion (DBFF) unit, a dual-loss calculation unit, a triple-loss calculation unit, and a parameter optimization unit. The Siamese network construction unit builds a Student-Teacher network structure, with Teacher network parameters updated through exponential moving averages to ensure baseline stability. The block-level masking unit generates mask images and introduces learnable mask labels, completing image patch masking and feature projection. The dual-loss calculation unit simultaneously calculates the global feature contrast loss (L). GFCL ) and block-level mask reconstruction loss (L PMRL The three loss calculation units calculate the identity classification loss, metric learning loss, and pose confusion loss respectively, and fuse them into the total supervised fine-tuning loss according to the weights α and β. The parameter optimization unit updates the model parameters (including the DBFF module and the MLP dual branch) through backpropagation. The supervised fine-tuning stage integrates the three supervised losses to ensure that the model has efficient discrimination ability.
[0053] Identity matching and viewpoint discrimination module: It receives the fused feature vector output by the feature extraction module, calculates image similarity through the cosine distance algorithm to achieve identity matching, and performs front / back viewpoint discrimination based on the viewpoint information in the features, and outputs the matching result and viewpoint discrimination result;
[0054] Access record module: Based on the results of the identity matching and perspective discrimination module, when the similarity threshold is met and it is a frontal perspective, an entry check-in record is generated; when it is a rear perspective, a departure check-in record is generated. The record content includes the matched identity, the discriminated perspective, and the collection time.
[0055] Database module: It is used to associate the check-in information output by the access record module with the preset personnel information database, and integrate them to form a complete access log containing personnel identity, entry and exit time, and entry and exit direction. It supports the storage, query and traceability of logs, and realizes the automated management of personnel flow. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is a diagram of the overall architecture of the present invention;
[0058] Figure 2 This is a detailed structural diagram of the pedestrian re-identification model in this invention; Detailed Implementation
[0059] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0060] This invention provides a contactless check-in method based on single-camera pedestrian re-identification. This method uses a single camera to collect image sequences of people entering and exiting, and combines an innovative ViT architecture and a two-stage training strategy to achieve high-precision identity matching and viewpoint discrimination, thereby automatically generating personnel entry and exit records. The method includes the following steps:
[0061] S1, Image Acquisition and Dataset Construction: In a real-world deployment scenario, a fixed, high-definition camera continuously captures video streams of people passing by. The system extracts image frames containing the complete torso of each person from the video stream and automatically labels the viewpoint based on the person's direction of movement: when a person is walking towards the camera, it is labeled "front" (in), and when they are walking away from the camera, it is labeled "back" (out). A labeled dataset containing identity labels, viewpoint labels, and camera labels is constructed to provide data support for subsequent self-supervised pre-training and supervised fine-tuning. The dataset is divided into training, testing, and query sets, and comes with accompanying labeling files and explanatory documents.
[0062] S2, Model Construction and Two-Stage Training Strategy Design: This invention employs a backbone network based on Vision Transformer (ViT), such as... Figure 2 As shown, the model includes a Patch embedding module, a spatial information enhancement embedding module, a Transformer encoder module, and a feature pooling module, and introduces a dual-branch feature fusion module (DBFF). The overall training is divided into two stages: self-supervised pre-training and supervised fine-tuning.
[0063] In the self-supervised pre-training phase, a Student-Teacher Siamese network structure is first constructed. The parameters of the Teacher network are not updated through backpropagation, but rather slowly inherited from the Student network using an exponential moving average (EMA) strategy to maintain the stability of the feature distribution. Subsequently, a block-level random masking operation is performed on the input image: the image is divided into non-overlapping blocks, and some blocks are randomly replaced with learnable mask labels to form a mask image. The Student network receives the mask image, while the Teacher network receives the original complete image as the reconstruction target. By calculating the block-level mask reconstruction loss and the global feature contrast loss, the local detail reconstruction capability and global semantic consistency are constrained, respectively. Crucially, a DBFF module is introduced to perform bidirectional attention interaction between global category label features and local image block features at the Transformer encoder output: on the one hand, it guides local features to focus on identity-related regions; on the other hand, it enriches the fine-grained information of the global features. The fused features are used to recalculate the weighted total loss.
[0064] During the supervised fine-tuning phase, the pre-trained Teacher network parameters are used as the initialization baseline, and the labeled dataset is loaded for end-to-end fine-tuning. The loss function consists of three parts: identity classification cross-entropy loss, metric learning triplet loss, and pose confusion loss. The pose confusion loss is implemented through a gradient inversion layer, forcing the model to extract identity features independent of viewpoint.
[0065] S3, Image Preprocessing: The original image is first cropped and scaled to a standard size of 256×128 pixels. Then, the following data augmentation operations are applied in sequence: horizontal flipping with a 50% probability, random cropping (cropping ratio 0.8-1.0), random erasure (erasure area ratio 0-10%), and finally channel normalization according to ImageNet statistics.
[0066] S4. The preprocessed image is divided into 128 16×16 image blocks by the Patch embedding layer. Each block is mapped to a 768-dimensional feature vector and concatenated with a learnable class label. Then, a two-dimensional learnable positional encoding is superimposed. Next, spatial information is injected to enhance the embedding. Based on the camera ID and viewpoint label (in / out), the joint sensing vector is obtained by looking up a table from the predefined SIE embedding matrix (dimension 2×1×768) and fused into the positional encoding with a weighted coefficient λ = 0.1.
[0067] S5 performs layer normalization preprocessing on the feature vector after spatial information injection and embedding to ensure stable feature distribution, providing adapted input for the subsequent deep feature extraction of the Transformer encoder and improving the stability and accuracy of feature extraction.
[0068] S6: Deep feature extraction using the Transformer encoder. The preprocessed feature vectors are input into a 12-layer Transformer encoder. Each encoding block consists of 12 self-attention sub-layers and feedforward neural network sub-layers. Residual connections and stochastic depth regularization strategies are employed to avoid model overfitting and accelerate training convergence. The encoder ultimately outputs two types of core features: global category label features (used for global feature comparison) and local image patch features (used for block-level mask reconstruction), which together constitute a deep feature representation containing identity and viewpoint information.
[0069] S7, Generalized Mean Pooling Feature Fusion, uses the feature pooling module to aggregate all image patch features except for the category label using generalized mean pooling. The aggregated local features are added to the category label features to obtain a final 1536-dimensional fused feature vector, which strengthens the correlation between global and local features and improves the discriminative ability of features.
[0070] S8, Identity Matching and Perspective Discrimination: During the inference phase, the system extracts the fusion features of the query image in real time and compares them with the cosine similarity of features from all registered users in the database. If the maximum similarity exceeds a preset threshold (e.g., 0.65), a successful match is determined. Simultaneously, utilizing the perspective discrimination capability learned during the fine-tuning phase (implicit in the feature space distribution), the system determines whether the current image is a frontal or rear view. If it is a frontal view and a successful match, an "entry" check-in record is generated; if it is a rear view and a successful match, a "departure" check-in record is generated, preventing invalid records from being generated for unfamiliar individuals.
[0071] S9, access log generation and management, automatically associates all attendance records with personnel name, employee number, timestamp, and entry / exit direction information, stores them in the access log database, and integrates them with the preset personnel information database to form a complete access log. It supports the storage, query, and traceability of logs, realizes the automated management of two-way personnel flow, and adapts to the access control needs of scenarios such as laboratories and office buildings.
[0072] This invention also provides a contactless check-in system based on single-camera pedestrian re-identification, such as... Figure 1 As shown, the above-mentioned contactless check-in method based on single-camera pedestrian re-identification includes:
[0073] Image acquisition module: Used to acquire image sequences of people through a single camera, accurately capture the frontal image of people entering and the back image of people leaving, and synchronously record the acquisition time sequence information corresponding to the images to provide raw data for dataset construction;
[0074] Preprocessing module: Used to perform preprocessing operations on the raw images acquired by the image acquisition module, including size normalization, random horizontal flipping, random cropping, random erasure, data augmentation and standardization, controlling the data augmentation intensity according to preset parameters, and outputting standardized image data that meets the model input requirements;
[0075] Feature extraction module: Built on the Vision Transformer architecture, integrating a Patch embedding submodule, a spatial information enhancement embedding submodule, a Transformer encoder submodule, and a feature pooling submodule. The Patch embedding submodule performs image block segmentation and feature mapping; the spatial information enhancement embedding submodule injects lens-viewpoint perception information; the Transformer encoder submodule extracts deep features through a multi-layer attention mechanism; and the feature pooling submodule uses generalized mean pooling to aggregate features, ultimately outputting a feature vector that fuses identity and viewpoint information. It implements a two-stage training process of "self-supervised pre-training + supervised fine-tuning," including a Siamese network construction unit, a block-level masking unit, a dual-branch feature fusion (DBFF) unit, a dual-loss calculation unit, a triple-loss calculation unit, and a parameter optimization unit.
[0076] Identity matching and viewpoint discrimination module: It receives the fused feature vector output by the feature extraction module, calculates image similarity through the cosine distance algorithm to achieve identity matching, and performs front / back viewpoint discrimination based on the viewpoint information in the features, and outputs the matching result and viewpoint discrimination result;
[0077] Access record module: Based on the results of the identity matching and perspective discrimination module, when the similarity threshold is met and it is a frontal perspective, an entry check-in record is generated; when it is a rear perspective, a departure check-in record is generated. The record content includes the matched identity, the discriminated perspective, and the collection time.
[0078] Database module: It is used to associate the check-in information output by the access record module with the preset personnel information database, and integrate them to form a complete log containing personnel identity, entry and exit time, and entry and exit direction. It supports the storage, query and traceability of logs, and realizes the automated management of personnel flow.
[0079] This invention has been tested in real-world scenarios such as office buildings and laboratories. Compared to existing pedestrian re-identification systems based on multiple cameras, this invention requires only a single camera, reducing hardware costs by over 60% and deployment time by 80%. It achieves an identity recognition accuracy of 95%, demonstrating advantages such as low cost, high precision, and high robustness. This invention is used for seamless personnel check-in and access control. Using a sequence of personnel images captured by a single camera as input, it requires no additional hardware support to achieve automated identification and recording of personnel entering and exiting. It can be widely applied in scenarios requiring personnel access management, such as office buildings, parks, laboratories, and hospitals, and has significant potential for widespread adoption.
[0080] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A non-contact check-in method and system based on single-camera pedestrian re-identification, characterized in that, Includes the following steps: S1 uses a single camera to collect images of people, providing data support for subsequent self-supervised pre-training and supervised fine-tuning; S2 is a pedestrian re-identification model built on the ViT architecture. It adopts a two-stage training strategy of "self-supervised pre-training + supervised fine-tuning". In the self-supervised pre-training stage, a dual-branch feature fusion module is added to realize the feature interaction and collaborative optimization between the global feature comparison branch and the block-level mask reconstruction branch. S3 performs preprocessing, data augmentation, and standardization on the acquired images to enhance the model's generalization ability. S4. Input the preprocessed image into the pedestrian re-identification model, and add learnable category labels and two-dimensional learnable location codes. S5 uses a spatial information-enhanced embedding module to inject lens-aware embedding and viewpoint-aware embedding into the feature vector by combining the camera labels and viewpoint labels of the dataset, thereby achieving accurate alignment of cross-lens and cross-viewpoint features and solving the problem of bidirectional viewpoint feature differences under a single camera. S6, the feature vector with enhanced spatial information is input into the Transformer encoder module. The module contains multiple coding blocks. The encoder finally outputs global category label features and local image patch features, which together constitute a deep feature representation containing identity information and viewpoint information. S7: Input the deep feature representation into the feature pooling module, and use generalized mean pooling to aggregate all image patch features except for the category label. After aggregation, add the aggregated features to the category label features to obtain the final fused feature vector. S8, based on the fusion of feature vectors to perform personnel identity matching and perspective discrimination, uses cosine distance to measure the similarity between query images and database images; S9 links attendance records with the personnel information database to generate a complete access log containing personnel identity, entry and exit time, and entry and exit direction, enabling automated tracking of two-way personnel flow; The two-stage training strategy of "self-supervised pre-training + supervised fine-tuning" in step S2 specifically includes a self-supervised pre-training stage (S21-S24) and a supervised fine-tuning stage (S25): S21, construct the Student-Teacher twin network structure, where the Teacher network parameters are updated from the Student network using an exponential moving average strategy, and the update formula is shown in (1): i teacher ←t·i teacher +(1-τ)·θ student (1) Where τ is the momentum coefficient, which ensures the stability of the feature distribution of the Teacher network; S22 adopts a block-level mask reconstruction paradigm and introduces learnable mask markers x. [mask] Perform random block-level masking on the input image; S23, introduce global feature contrast loss to optimize the consistency of global category label features between the Student and Teacher networks; S24, introduces a dual-branch feature fusion module (DBFF), targeting the global feature comparison branch (L... GFCL ) and block-level mask reconstruction branch (L PMRL To address the issues of independent optimization and feature semantic disconnect, a bidirectional attention interaction for dual-branch features is implemented at the output of the Transformer encoder in the Student network. This is achieved using the z-axis output of the Transformer. [cls ] and Z [patchs] For input: Global→Local: using z [cls] For Q, Z [patchs] For key-value pairs, output local features that incorporate global constraints. Local→Global: using z [patchs] For Q, z [cls] For key-value pairs, output global features that fuse local details. The loss is recalculated based on the fused features to obtain the weighted total loss: Wherein, λ1 and λ2 are the weight coefficients of the global feature contrast loss and the block-level mask reconstruction loss, respectively; S25, supervised fine-tuning is performed based on the labeled dataset, using personnel identity labels and viewpoint labels as supervision signals. Finally, the three losses are weighted and fused to obtain the total supervised fine-tuning loss:
2. A non-contact check-in method and system based on single-camera pedestrian re-identification, characterized in that, The method of claim 1 includes: Image acquisition module: Used to acquire image sequences of people through a single camera, accurately capture the frontal image of people entering and the back image of people leaving, and synchronously record the acquisition time sequence information corresponding to the images to provide raw data for dataset construction; Preprocessing module: Used to perform size normalization, random horizontal flipping, random cropping, random erasure data augmentation and standardization on the original image, and output standardized image data that meets the model input requirements; Feature extraction module: Based on the ViT architecture, it integrates Patch embedding, spatial information enhanced embedding, Transformer encoder, and feature pooling module, and finally outputs feature vectors that fuse identity and viewpoint information; it realizes two-stage training of "self-supervised pre-training + supervised fine-tuning", including Siamese network construction, block-level masking, DBFF, double loss calculation, triple loss calculation, and parameter optimization unit to complete the iterative training and optimization of the model; Identity matching and viewpoint discrimination module: It receives the fused feature vector output by the feature extraction module, calculates image similarity through the cosine distance algorithm to achieve identity matching, and performs front / back viewpoint discrimination based on the viewpoint information in the features, and outputs the matching result and viewpoint discrimination result; Access record module: Based on the results of the identity matching and perspective discrimination module, when the similarity threshold is met and it is a frontal perspective, an entry check-in record is generated; when it is a rear perspective, a departure check-in record is generated. The record content includes the matched identity, the discriminated perspective, and the collection time. Database module: It is used to associate the check-in information output by the access record module with the preset personnel information database, and integrate them to form a complete access log containing personnel identity, entry and exit time, and entry and exit direction. It supports the storage, query and traceability of logs, and realizes the automated management of personnel flow.