Development Report:
Feasibility Study of a Generative-AI-Based Privacy-Preserving Video Archiving Framework for Pedestrian Traffic Monitoring
Masaya Nakahara*,
, Shosuke Okamura*, and Yuya Matsui**
*Faculty of Information Science and Arts, Osaka Electro-Communication University
1130-70 Kiyotaki, Shijonawate, Osaka 575-0063, Japan
Corresponding author
**Graduate School of Information Science and Arts, Osaka Electro-Communication University
1130-70 Kiyotaki, Shijonawate, Osaka 575-0063, Japan
In Japan, continuous monitoring of pedestrian traffic volume is considered crucial for measuring the effectiveness of sustainable urban development and revitalization efforts. However, storage periods of camera footage are limited due to privacy protection concerns, making long-term time-series analysis and detailed post-event analysis (such as movement path analysis) difficult. Existing masking techniques, such as mosaic blurring, protect privacy but result in the loss of human features, leading to reduced accuracy in artificial intelligence (AI)-based tracking and counting. This study proposes a privacy-preserving video archiving framework that enables long-term storage and post-hoc analysis by regenerating pedestrian images using generative AI. We developed a prototype system and conducted a pilot study to verify its feasibility. In a pilot experiment using a 15-minute pedestrian video, the proposed method achieved a counting accuracy of 99.07% relative to the manual reference count, suggesting that generative masking can preserve counting utility in the tested setting. However, the attribute-estimation results were affected by seasonal domain shifts, and the IoU-based evaluation revealed other issues in spatial consistency and masking omissions. These findings indicate the feasibility of the proposed framework and provide technical requirements for future privacy-preserving video archiving systems.
Generative masking with IoU evaluation
1. Introduction
The continuous monitoring of pedestrian traffic is essential for data-driven development of smart cities 1,2. Automated pedestrian flow analysis using surveillance cameras is in high demand to overcome the cost constraints of manual surveys 1. However, strict privacy regulations, such as General Data Protection Regulation, prohibit the long-term storage of raw footage containing identifiable personal information 3. Because sensitive information includes not only faces, but also physical characteristics 3,4, full-body masking is required to archive videos for detailed retrospective analysis 5. To address this issue, our earlier research proposed a method that generates privacy-preserving videos by applying pose-conditioned attribute-specific masking to pedestrians 6. However, this method yields unrealistic masking, thereby significantly reducing the likelihood of achieving premasking accuracy levels with standard machine-based analysis methods. Therefore, there is a need to develop a highly realistic masking technology that enables machine-based analysis even after masking. Thus, the primary objective of this research is to propose and validate a video archiving framework capable of generating anonymized pedestrian videos that preserve machine-detectable human shapes and coarse traffic analysis attributes, while replacing identity-related facial and bodily appearances. This study serves as a feasibility study and explores the technical requirements of next-generation traffic survey archiving technologies. By protecting facial and bodily appearances using this method and extending it in future work to obscure gait patterns, we aim to generate privacy-preserving videos. In this study, we evaluate only cross-sectional pedestrian counting; broader applications, such as movement-path analysis, density estimation, and long-term archiving, are stated as motivation and suggested for future validation. The main contributions of this study are as follows. First, we propose a generative artificial intelligence (AI)-based full-body masking framework that combines pedestrian detection, tracking, coarse attribute estimation, foreground matting, pose-conditioned generation, and IoU-based evaluation for privacy-preserving pedestrian video archiving. Second, unlike our previous DensePose-based masking method 6, the proposed method uses pose-conditioned image generation with attribute-specific reference images to produce human-like anonymized pedestrian regions. Third, we evaluate post-anonymization analyzability using pedestrian counting, coarse attribute estimation, and IoU-based spatial consistency, comparing the proposed method with DensePose-based and mosaic-based baselines. Fourth, through a pilot experiment, we identify practical limitations including seasonal domain shifts in attribute estimation, masking omissions, and the need for gait anonymization.
This paper first outlines the technologies necessary for implementing the proposed framework. Section 2 reviews related existing methods and then identifies the challenges and countermeasures when applying them to methods for generating videos that protect facial and bodily privacy. Section 3 proposes a method for generating videos using generative artificial intelligence (AI). Section 4 examines the effectiveness of the masked videos generated using the proposed method through empirical experiments. Finally, Section 5 provides a summary of the study and discusses future prospects. In this study, “privacy-preserving” means that the facial and bodily appearances visible in the original video are replaced by a synthetic appearance to reduce visual identifiability. This does not imply formal anonymization under legal standards or resistance to all re-identification attacks.
2. Overview of Required Technologies and Investigation of Existing Methods
2.1. Overview of Required Technologies
This study aims to generate videos suitable for future automated analysis in crowd measurement tasks, such as pedestrian traffic surveys and flow path analysis. Building on existing attribute-based masking methods 6, we investigated techniques for detecting and tracking individuals, estimating their personal attributes, and applying different masking methods based on the estimated attribute results.
2.2. Survey of Related Existing Methods
Based on the development techniques clarified in Section 2.1, we identified the challenges when applying these existing methods to our target technology and explained the requirements necessary for realizing the target technology. Related studies were reviewed to determine whether they could support privacy-preserving pedestrian video archiving after anonymization. Specifically, we focused on four requirements: detecting and tracking pedestrians after masking, preserving coarse traffic analysis attributes, replacing identity-related full-body appearances, and quantitatively evaluating post-anonymization analyzability. Table 1 summarizes representative methods and their limitations for the target task.
| Category | Representative methods | Relevance to this study | Limitation for the target task |
| Object detection and tracking | YOLO 11, R-FCN 9, Deep SORT 14, OC-SORT 15, Deep OC-SORT 16 | Detecting and tracking pedestrians before and after masking | These methods do not address privacy protection by themselves. |
| Attribute estimation | FieldAnalyst 5, GaitSet 17, VGG16-based full-body estimation 6,18 | Estimating coarse traffic-analysis attributes such as apparent gender and age group | Face-based or gait-based methods are sensitive to occlusion, viewpoint, clothing, and seasonal changes. |
| Conventional anonymization | Mosaic, blurring, background subtraction 4 | Removing visually identifiable details | Human shape and attribute cues may be lost, reducing post-anonymization analyzability. |
| Full-body generative anonymization | DeepPrivacy2 22, InsetGAN 20, pose-guided person generation | Replacing full-body appearance with synthetic appearance | Coarse attributes required for traffic analysis are not always preserved or directly embedded in the video. |
| Attribute-specific masking | Earlier DensePose-based method 6 | Preserving readable attribute labels in anonymized videos | Unrealistic body shapes may cause detection, tracking, and attribute-reading errors. |
2.2.1. Pedestrian Detection and Tracking for Post-Anonymization Analysis
Existing methods related to person detection include object detection techniques such as end-to-end object detection with transformers 7, Faster R-CNN 8, R-FCN 9, SSD 10, YOLO 11, ComfyUI Video Matting 12, and DW Pose 13. While methods utilizing handcrafted features or machine learning have been predominantly proposed in the past, deep-learning-based approaches that offer high accuracy have emerged in various scenarios in recent years. Existing research targeting crowd density measurements includes an individual counting method using R-FCN 9 and a technique that applies masking to persons detected by YOLO 6. Both methods are promising for practical implementation in the development of new technologies.
Existing methods related to object tracking include: Deep SORT 14, which focuses on appearance features; OC-SORT 15, a tracking method that utilizes a Kalman filter; and Deep OC-SORT 16, which combines the two aforementioned methods. Deep OC-SORT demonstrates stronger occlusion resistance than Deep SORT or OC-SORT. This technology is applied to track pedestrians detected on sidewalks and for applying masking. Consequently, Deep OC-SORT is found promising for the development of new technologies.
2.2.2. Coarse Attribute Estimation for Pedestrian Traffic Analysis
Existing methods related to personal attribute estimation include: FieldAnalyst 5, an image-based person analysis system; Gaitset 17, a gait-based age estimation method; and a full-body image apparent gender estimation method using VGG16 6,18. FieldAnalyst 5 is an image-based person analysis system that automatically detects individuals and estimates their personal attributes from facial image regions. However, scenes of chaotic crowds walking are expected when capturing footage from urban areas. This means that individuals walking with their backs toward the camera or wearing deeply pulled-down hats are likely to be present. Consequently, the application of this technology for development is challenging. The gait-based age estimation method 17 constructs a model using Gaitset 19, employing fluctuations in walking cycles as training data. This model then estimates age from gait. However, it faces limitations when the feet are obscured by clothing (e.g., long skirts), surrounding objects, or occlusions between pedestrians, making its application to the target technology difficult.
Therefore, methods such as our earlier approach 6 that use full-body images as training data are suitable for applications in development of technologies. Specifically, because we already constructed a VGG16 18 learning model using full-body human images and achieved apparent gender estimation from human images, the use of VGG16 can enable the estimation of personal attributes required for developing new technologies.
2.2.3. Conventional Privacy Protection and Its Effect on Analyzability
Existing methods for masking human regions in videos include classic techniques that utilize background subtraction or simple blurring (e.g., mosaic processing) 4. These methods identify human regions through foreground extraction or temperature detection, and apply masking via mosaic processing. However, this approach may eliminate essential human characteristics, potentially complicating the subsequent machine-based analyses. Furthermore, mosaic processing applied only to facial regions may exclude clothing and other features that constitute personal information. Therefore, the resulting video becomes unsuitable for long-term preservation, making its application in development technologies challenging.
2.2.4. Generative Full-Body Anonymization and Attribute Preservation
Technologies and services that use generative AI for masking have now emerged. These include InsetGAN 20, an image generation method combining multiple generative adversarial networks 21, and masking techniques such as Deep Privacy2 22 and Pose-Guided Person Generation Network 23 using conditional GAN 24. These methods can anonymize an individual’s face and also their entire body by replacing it with textures from a similar person or an AI-generated image of an individual. However, this involves a risk that the masking could replace the person with someone similar to those used as training data for generative AI, or with someone of a different apparent gender, age group, or other attributes. Techniques such as Viggle AI 25, deployed as a video generation service that performs masking using avatar textures detectable as human by existing detection technologies while reducing realism, are more suitable for development. However, this approach replaces with predefined avatar textures 26, rendering them incapable of attribute-preserving masking 6, as shown in Fig. 1. Another approach involves the storage of personal attribute data in CSV files. However, Deep Privacy2 22 cannot perform attribute-specific masking. Furthermore, if the data that stores these personal attributes are lost, neither humans nor machines can accurately determine the correct personal attributes, as the masking might be mistaken for a real person. Thus, to generate the targeted videos, personal attributes must be directly embedded into the footage while ensuring that the embedded personal attributes are readable by both humans and machines. To achieve this, it is necessary to combine the technologies for estimating personal attributes with that for masking attributes.

Fig. 1. Masking results with DensePose 6.
2.3. Challenges of Existing Technologies and Services
Based on the findings in Section 2.2, it was determined that when using techniques for human object detection, object tracking, and personal attribute estimation to the target technology, combining some existing techniques makes the required technology more realizable. However, no research or services other than our existing work 6 have specifically addressed the feasibility of generating videos usable for measuring urban bustles. Therefore, there are two challenges in realizing the target technology.
The first is “the difficulty of detecting and tracking individuals while masking them with discernible attributes.” We propose a method using DensePose 6 to apply masking to each attribute. This method performs masking by applying texture images to the estimated human skeleton. Consequently, if errors occur while detecting body parts, masking with structurally implausible shapes may occur, increasing the likelihood of missed detections, false detections, false tracking, and misread attributes. Therefore, the technology developed in this study must employ masking with images that match personal attributes and poses that appear natural.
The second challenge is the “lack of clarity regarding the degree of masking accuracy.” Existing masking techniques propose methods for generating videos that protect privacy while preserving poses and personal attributes. However, automated analysis using generated videos has not yet been performed, and verification remains limited to visual comparisons. Furthermore, evaluation metrics such as Intersection over Union (IoU) values do not allow the assessment of the masking accuracy relative to the original video, making it impossible to determine if the generated video is usable. Therefore, it is necessary to determine the accuracy of the masked video by calculating the IoU values for each person before and after processing, and comparing them to the original video.
3. Proposed Method
This section proposes a method for generating anonymized pedestrian videos that remain detectable and trackable after attribute-specific generative masking, based on the challenges discussed in Section 2, including, “the inability to detect, track, and mask individuals in a way that preserves their attributes in a readable form” and “the lack of clarity regarding the degree of masking accuracy achieved.”
3.1. Overview of the Proposed Method

Fig. 2. Process flow of the proposed method.
This section proposes a privacy-preserving video-archiving framework to address the limitations identified in Section 2. The processing flow of the proposed method is illustrated in Fig. 2. The framework comprises four main modules: pedestrian tracking, personal attribute estimation, masking, and IoU evaluation. The input data are original surveillance videos, and the output is an anonymized video generated by the masking module.
To address the limitation of conventional masking (e.g., DensePose) in maintaining machine-readable human shapes, our approach utilizes generative AI conditioned on pre-prepared attribute-specific reference images and extracted pose information. The rationale behind this choice is to ensure that the generated pedestrian regions retain a natural, anatomically consistent silhouette, thereby preventing the fragmentation of object-tracking algorithms caused by unnatural masking artifacts.
To address the lack of quantitative metrics for masking accuracy and utility, we introduce an IoU evaluation function. By calculating the IoU values of the detected bounding boxes before and after masking, we can objectively quantify the spatial consistency and analyzability of the generated video rather than relying solely on visual inspection.
3.2. Pedestrian Tracking
This function detects and tracks individuals appearing in the input video footage. First, the videos are divided into individual frames. Next, an object detection model is used to detect individuals. Subsequently, an object tracking model is applied to the detected individual’s bounding box (hereafter referred to as BBox) to continuously track the individual’s position within the video. Finally, the image is cropped around each individual’s BBox shape.
3.3. Personal Attribute Estimation
In this study, the term “traffic-analysis attributes” refers only to coarse demographic labels used for pedestrian traffic analysis, namely apparent gender and age group. The pose, clothing texture, body silhouette, and other visual cues are not treated as attributes to be preserved. Instead, pose information is used only as a generation condition to maintain a detectable human-like shape, whereas identity-related facial and bodily appearances are intended to be replaced by synthetic appearances. Furthermore, the term “reference-image features” refers to the visual features encoded from the prepared attribute-specific reference image by IP-Adapter, which guide the generated pedestrian appearance toward the selected coarse attribute class rather than preserving the original identity-specific appearance.
Building on existing methods, this function estimates the traffic analysis attributes of individuals from images extracted by the tracking module 6. First, based on a pre-trained deep learning model, we fine-tuned the model using labeled data prepared for each apparent gender and age group. This builds separate models to estimate the apparent gender and age groups for males and females. Age was classified into three groups: young, middle-aged, and elderly. Next, using the constructed learning models, we input a group of images of the tracked person and collectively estimate their traffic analysis attributes. Finally, a temporal majority vote is applied to the estimation results across the tracked frames, and the most frequent classes are recorded as traffic analysis attributes. This enables consistent masking with unified attributes across all frames, as shown in Fig. 3, while suppressing the misestimation of traffic analysis attributes. Furthermore, as shown in Fig. 4, the age group estimation model is selected based on the estimated apparent gender results. This functionality enables the estimation of each person’s attributes and the masking of each attribute.

Fig. 3. Estimation of traffic analysis attributes by majority voting.

Fig. 4. Personal attribute estimation.

Fig. 5. Masking.
3.4. Masking
This function uses image generation technology powered by generative AI to mask BBox-shaped human images extracted by the person-tracking function. Fig. 5 illustrates the masking process performed using this function. First, the height and width of the human images are rescaled to twice their original dimensions. This upscaling ensures that the quality of the generated image is maintained during masking even when the human image is small. Next, the foreground is extracted from the image, and only the region occupied by the person is masked. This removes any personal information contained within the image during the image generation process. Additionally, if the person’s region is not correctly identified, image generation may be applied to the background, potentially causing a loss of background information. Furthermore, to incorporate pose information into the generation prompt, a pose estimation model is used to estimate the pose of the person. Furthermore, the reference-image features required for image generation are extracted by IP-Adapter from the prepared attribute-specific reference image (not from the original pedestrian image), and are set as part of the generation condition. Finally, using a prompt that incorporates pose information, an image is generated for the masked area and resized based on the dimensions of the original image. Beyond pose information, the prompt also includes attribute-specific information classified by the personal attribute estimation function, aimed at improving generation quality. This functionality enables the generation of images that more closely resemble reality by aligning with the subject’s pose, addressing the challenge of “detecting and tracking subjects while masking their attributes in a discernible shape.”
| Item | Setting |
| Interface | ComfyUI |
| Base generation model | Realistic Vision V5.1 |
| Foreground extraction | ComfyUI-Video-Matting |
| Pose estimator | DWPose |
| Conditioning model | ControlNet openpose |
| Reference-image encoder | IP-Adapter |
| Input format | Cropped pedestrian image, foreground mask, DWPose keypoints, attribute-specific reference image |
| Output format | Generated pedestrian foreground composited into the original frame |
| Upscaling | 2 times before generation |
| Sampling method | DPM\(\texttt{++}\) 2M Karras |
| Number of steps | 20 |
| CFG scale | 7 |
| Denoising strength | 0.6 |
| Seed policy | Fixed |
| GPU | NVIDIA GeForce RTX 3090 |
| CPU | Intel Corei9-12900 2.4 GHz |
| RAM | 96 GB |
| OS | Ubuntu-20.04 (Windows WSL) |
| ComfyUI version | V0.3.11 |
|
Workflow Nodes (ComfyUI) |
IPAdapter plus, ControlnetAux, GGUF, Advanced-ControlNet, Video-Matting, Image Resize |
| Processing time | 30 s/frame |
To ensure the reproducibility of the generative masking module, the hardware configuration, software components, inference hyperparameters, ComfyUI workflow nodes, and processing times are summarized in Table 2. The positive prompt used for image generation is defined as “a non-identifiable synthetic pedestrian, full-body, {attribute_class}, natural walking pose, surveillance-camera view, human-like silhouette, simple clothing, consistent with the reference image.” The negative prompt was defined as follows. “identifiable face, logo, text, distorted limbs, extra arms, extra legs, missing body parts, unrealistic skeleton, low quality, background artifacts.”
3.5. IoU Evaluation
This function evaluates the IoU values of pedestrians detected using object detection in the generated video and visualizes them within the video. First, pedestrians are detected using an object detection model for both the original and generated videos. Next, the coordinates of the top left and bottom right vertices of the detected bounding boxes are obtained. Let \(B_{t,i}^O\) denote the \(i\)-th bounding box detected in the original video at frame \(t\) and let \(B_{t,j}^G\) denote the \(j\)-th bounding box detected in the generated video at the same frame. The IoU is formally defined in the following equation.
Here, the vertical bars represent the area of the bounding box. If the two bounding boxes do not overlap, the IoU value is zero. For each frame, we compute an IoU matrix between all bounding boxes detected in the original video and those detected in the generated video. We then perform a one-to-one bipartite matching to maximize the total IoU score. Matched pairs are used to calculate the IoU statistics, whereas unmatched original-video boxes are treated as missed detections and unmatched generated-video boxes are treated as false detections. In this pilot study, ID level matching was not used because tracker IDs are independently assigned to the original and generated videos. Instead, a one-to-one frame-level matching protocol was used to avoid assigning multiple generated boxes to the same original pedestrian. Finally, color coding is applied to the generated video based on the determined IoU values for each bounding box. Furthermore, color coding by IoU value assigns blue to values greater than 0.9, green to values between 0.9 and 0.5, and red to values less than or equal to 0.5. The bounding box frame is then saved as an image. This function enables the verification of whether the video is actually automatically analyzable, addressing the challenge of “unclear degree of accuracy in masking.”
4. Demonstration Experiment
4.1. Experimental Details
|
Apparent gender (model) |
Age group |
Evaluated samples (denominator) |
Correctly classified (numerator) |
Accuracy |
| Male | Young | 10 | 10 | 100.00% |
| Middle | 10 | 2 | 20.00% | |
| Elderly | 7 | 3 | 42.86% | |
| All | 27 | 15 | 55.55% | |
| Female | Young | 10 | 2 | 20.00% |
| Middle | 10 | 3 | 30.00% | |
| Elderly | 10 | 6 | 60.00% | |
| All | 30 | 11 | 36.66% |
Note: Each cell counts individual tracked pedestrians. ‘Evaluated samples’ is the number of manually verified individuals in each age group (denominator); ‘Correctly classified’ is the number of individuals whose age group was correctly predicted by the model (numerator). \(\textrm{Accuracy}=\textrm{numerator}\,/\,\textrm{denominator}\). To isolate the age-group module from apparent-gender errors, the age-group model was selected using the manually verified apparent-gender label; therefore these values are module-level, not end-to-end, accuracies.
As a pilot experiment to validate the proposed framework, we conducted pedestrian counting using YOLOv8 27 and Deep OCSORT 16 on masked and unmasked video sequences using the proposed method, an existing method using DensePose 6 (hereafter DensePose), and an existing method using a mosaic 4 (hereafter Mosaic). The accuracy of the counts, relative to the original video, was calculated to evaluate the count results of each method. In the experiment, the apparent gender and age groups were estimated for males and females by comparing the results with the visually verified ground truth data. Accuracy was confirmed based on the number of correctly identified individuals. The apparent age groups were defined as mutually exclusive classes, namely, young (under 30 years), middle-aged (30–59 years), and elderly (60 years or older). The age-group model was selected using a manually verified apparent gender label to evaluate the age-group estimation module independent of apparent gender estimation errors. Table 3 reports the module-level age group accuracy for all samples in each apparent gender group. This does not represent the end-to-end accuracy of the complete attribute estimation pipeline. Based on the results of Experiments 1 and 2, we verify whether the proposed method improves the “challenge of detecting and tracking pedestrians while maintaining their attributes in a readable format without masking.”
In Experiment 3, for videos generated using DensePose, Mosaic, and the proposed method, we evaluated the accuracy of the proposed method by comparing the IoU values corresponding to the proposed method and the original video detection results for each pedestrian detection result obtained using YOLO. Based on these results, we verify whether the proposed method addresses the challenge where “the degree of accurate masking is unclear.”
4.2. Experimental Conditions

Fig. 6. Verification site, counting line and detection result (ID, class, accuracy).

Fig. 7. Images for each attribute used for masking.
The video footage used in this experiment was captured from an oblique overhead viewpoint at a height of approximately 4 m. Fig. 6 illustrates the verification site and counting line. The footage was recorded at 4K resolution (3,840 \(\times\) 2,160 pixels) and a frame rate of 30 fps for 15 min. Additionally, as shown in Fig. 7, masking images were prepared for each attribute, comprising six types: male and female individuals corresponding to each age group, namely, the young, middle-aged, and elderly.
For the object detection model used in the person tracking and IoU evaluation functions, we selected YOLOv8 27, an implementation of YOLO 11. Among the methods investigated in Section 2.2.1, YOLO was validated for its practical applicability to sidewalks. For the object tracking technology, based on the findings in Section 2.2.2, we selected Deep OC-SORT 16, which is likely to exhibit a strong resistance to occlusions between pedestrians.
For the masking function, ComfyUI Video Matting 12 was used for foreground extraction and masking. For pose estimation, DW Pose 13 was used to estimate posture. This technology enables the extraction of pose information such as facial orientation from person images. Based on this information, Control Net 28 and IP Adapter 29 are employed to generate person images within the foreground region. This is achieved by setting detailed prompts during the generation and using the extracted pose information and image features for masking.
In the first experiment, as shown in Fig. 6, individuals were counted automatically when the box crossed the green count line. The manually annotated pedestrian count obtained from the original video was used as the reference ground truth to ensure the evaluation accuracy. The counting accuracy of each method was calculated using the following formula.
| Pre-trained Model | VGG16 |
| Epoch | 40 |
| Batch size | 32 |
| Train-test ratio | \(8:2\) |
| Male (train/test) | 1200/300 |
| Female (train/test) | 1200/300 |
| Pre-trained model | VGG16 |
| Epoch | 40 |
| Batch size | 32 |
| Train-test ratio | \(8:2\) |
| Young (train/test) | 400/100 |
| Middle (train/test) | 400/100 |
| Elderly (train/test) | 400/100 |
Here, \(C_{\textit{GT}}\) represents the manual reference count and \(C_m\) represents the count obtained from method \(m\). The learning model used in the second experiment consisted of three models: an apparent gender estimation model, a male-specific age group estimation model, and a female-specific age group estimation model. Table 4 shows the configuration conditions for the apparent gender-specific estimation model, and Table 5 shows the configuration conditions for the male-specific and female-specific age group estimation models. For each model, images of pedestrians captured in autumn were used as training data. In the third experiment, regardless of whether an individual passed through the frame, the IoU value of the BBoxes detected using YOLOv8 for the same person in both the generated and original videos was calculated. The average, minimum, maximum, and standard deviations of these values were then computed.
| Method | Manual reference | Proposed method | DensePose | Mosaic |
| Counting result | 107 | 108 | 110 | 114 |
| Counting accuracy | – | 99.07% | 97.27% | 93.86% |
4.3. Results and Discussion
Table 6 shows the results of counting pedestrians using the generated videos and existing methods compared to the original videos. The generated videos achieved 99.07% counting accuracy relative to the original footage, outperforming DensePose (97.27%) and Mosaic (93.86%). The proposed method produced the smallest counting error among the methods compared in pilot experiments. This demonstrates that individuals masked by the proposed method can also be detected using an object detection model 27, enabling more accurate counting than the existing methods. Because this preliminary study did not include repeated trials or statistical significance testing, the results should be interpreted as localized evidence of feasibility rather than generalized statistical superiority. This is because generative AI supplements the human shape features, maintaining the robustness of the tracking algorithm (Deep OC-SORT). The accuracy of attribute estimation was affected by domain shift effects caused by seasonal differences (e.g., clothing changes between autumn training data and winter test data). This result highlights a significant finding for intelligent infrastructure systems: relying solely on pretrained models is insufficient for year-round operations. This suggests that an adaptive learning mechanism or season-specific dataset is essential for practical social implementation. However, the count of persons in the generated video was higher by one than that in the original video. This discrepancy occurred because the generative process slightly altered the object dimensions, causing the bounding box detected by YOLOv8 to fluctuate and leading to tracking fragmentation. Therefore, the methods to process masking must be improved to yield detection results that are more similar to those of the original video.
| Apparent gender | Male | Female |
| Evaluated | 27 | 30 |
| Correct | 22 | 21 |
| Accuracy | 81.48% | 70.00% |
The results of the apparent gender and age group estimations using the proposed method are presented in Tables 3 and 7. Considering that manual traffic surveys generally contain a certain margin of error (often cited as 5%–10% depending on the conditions 1), the achieved accuracy did not reach the level required to replace manual visual counting/attribute surveys. The low age group estimation accuracy indicates that the current attribute estimation module is not sufficiently robust for year-round operations. The training images were collected primarily in autumn, whereas the evaluation videos were captured during winter. In winter, coats, scarves, hats, and heavier clothing reduce the visibility of the body shape and clothing cues on which the full-body VGG16-based classifier may rely. This effect was particularly evident in the female age group model with an accuracy of 36.66%. Therefore, the observed error should not be interpreted as a limitation of generative masking alone but as a domain-shift problem in the upstream attribute-estimation module. For practical deployment, it is necessary to construct seasonally balanced datasets, introduce clothing and illumination augmentations, and evaluate class-wise confusion matrices and confidence scores.
Figure 8 shows the results of visualizing the IoU values and attributes estimated using the proposed method on the generated video. Table 8 presents the results calculated by the proposed method’s IoU evaluation function, showing the average, maximum, minimum, and standard deviation of the IoU values for all detected bounding boxes in the videos generated by each method. Table 8 shows that the average IoU value was 0.881, maximum was 1.000, and standard deviation was 0.124. This confirms the validity of the generated video because the automated analysis results obtained from the video generated by the proposed method are close to those of the unmasked video. However, compared to the other methods, the videos generated by DensePose showed superior results in terms of both mean and standard deviation. This is because, unlike DensePose, which estimates body surfaces and applies textures, ComfyUI Video Matting generates person images based on pose information for the masked regions. Consequently, as shown in Fig. 9, the body proportions cannot be maintained, leading to a decrease in the IoU value. Furthermore, both the proposed and existing methods yielded maximum and minimum IoU values of 1.000 and 0.000, respectively. When the IoU was 0.000, masking caused the BBox frames to appear in positions not present in the original video, leading to false detections or detection failures owing to masking errors (Fig. 10). This is likely because, regardless of the method, YOLO falsely detected pedestrians in unrecognizable human positions owing to the masking effect, or because the surrounding objects led to the estimation of impossible human skeletal structures. Consequently, masking was applied to these unrealistic skeletal structures, and the masked images could not be detected as pedestrians. Table 9 presents the number and percentage of BBoxes missed after masking. Compared with existing methods, the proposed method exhibited the highest occurrence of masking omissions. However, these omissions tended to be more transient than those observed using the existing methods. Therefore, the impact on the tracking accuracy was minimal. As shown in Table 6, the proposed method achieved more accurate tracking of persons than existing methods.

Fig. 8. Results of visualizing IoU values and attributes on the generated video.
| Method | Detection frame | Average | Max | Min | Standard deviation |
| Proposed method | 41,396 | 0.881 | 1.000 | 0.000 | 0.124 |
| DensePose | 43,524 | 0.952 | 1.000 | 0.000 | 0.106 |
| Mosaic | 42,238 | 0.951 | 1.000 | 0.000 | 0.085 |

Fig. 9. Examples of images with IoU values of 0.891 and 0.879.
These results indicate that the proposed method was advantageous for the specific line counting tasks evaluated in this pilot experiment. However, the proposed method did not outperform the baselines in all metrics; its mean IoU was lower than those of DensePose and Mosaic masking, and its masking omission incidence was higher. Therefore, the current framework can be regarded as a feasible approach for count-preserving generative anonymization, although further improvements are required for spatial consistency and masking reliability. Furthermore, by utilizing the tracking results, improvements can be made to lower IoU values. Specifically, if the time tracked is just a few seconds, it can be treated as temporary false detection. If sufficient tracking time is achieved and a sudden change occurs in the skeleton’s behavior during tracking, corrections can be made based on the skeleton’s movements before and after the change.

Fig. 10. Example of images with IoU value of 0.000.
| Method | Manual | Proposed method | DensePose | Mosaic |
| BBox | 43,923 | 2,552 | 778 | 1,999 |
| Masking failure rate | – | 5.81% | 1.76% | 4.55% |

Fig. 11. Example of images with IoU value of 1.00.
| No. | Frame | Average | Max | Min | Standard deviation |
| 1 | 1405 | 0.939 | 0.993 | 0.451 | 0.049 |
| 2 | 494 | 0.938 | 1.000 | 0.598 | 0.066 |
| 3 | 1505 | 0.938 | 0.996 | 0.523 | 0.049 |
| 4 | 895 | 0.933 | 0.998 | 0.000 | 0.058 |
| 5 | 544 | 0.929 | 1.000 | 0.566 | 0.055 |
| 6 | 709 | 0.928 | 1.000 | 0.000 | 0.165 |
| 7 | 1200 | 0.923 | 1.000 | 0.000 | 0.048 |
| 8 | 628 | 0.918 | 0.996 | 0.473 | 0.067 |
| 9 | 1259 | 0.914 | 0.990 | 0.506 | 0.054 |
| 10 | 796 | 0.913 | 0.994 | 0.524 | 0.054 |
| 11 | 956 | 0.909 | 0.991 | 0.405 | 0.059 |
| 12 | 937 | 0.908 | 1.000 | 0.000 | 0.120 |
| 13 | 585 | 0.905 | 0.988 | 0.667 | 0.060 |
| 14 | 1177 | 0.850 | 0.995 | 0.531 | 0.099 |
| 15 | 493 | 0.844 | 1.000 | 0.534 | 0.097 |
| 16 | 1530 | 0.797 | 0.995 | 0.483 | 0.107 |
| 17 | 938 | 0.786 | 0.994 | 0.396 | 0.096 |
However, the IoU value for individuals without masking (Fig. 11), was 1.000. This is likely because the DW Pose method used in this experiment failed to accurately estimate the skeleton of the person detected by YOLO. Consequently, masking could not be applied, and YOLO detected the person in exactly the same position. In videos generated using DensePose or Mosaic, a tendency for IoU to be 1.000 was also observed when masking was completely absent. Therefore, when the IoU value is 1.000, the pixel difference before and after masking can be verified. If there is no difference, it indicates that the masking has failed. Indicating this as a separate evaluation metric, namely, the number of masking failures, allows for a more accurate assessment of the masking precision. It also enables complementary approaches such as applying a different algorithm only to images where masking fails, thereby potentially improving the overall accuracy. However, because these masking omissions stem from the accuracy of the object detection and skeleton estimation models, improving the estimation accuracy of YOLO or DW Pose in the proposed method can help mitigate masking omissions.
To analyze images with IoU values other than 1.000 and 0.000 in greater detail, we aggregated the IoU values for each person by focusing on the walking segments within the generated video sequences (Table 10). Examining the maximum values in the table reveals that they are consistently 0.988 or higher, regardless of the person. Moreover, the average values are 0.786 or higher. These trends were consistent across all individuals. Therefore, it can be inferred that none of the results showed detection outcomes that significantly deviate from the actual individuals. However, examining the minimum values reveals cases of 0.000 and others ranging from 0.396 to 0.667. A review of the former results shows that detection failures occurred only in those specific frames, and these failures coincided with instances in which nearby objects, as shown in Fig. 12, were mistakenly detected as pedestrians. The latter reveal that an individual standing upright toward the bottom edge of the image was masked with an incorrect orientation or texture. As mentioned earlier, this is likely caused by a disruption in the skeleton estimation results from DW Pose, leading to masking with a completely different posture for that instant. Furthermore, the standard deviation reveals a maximum of 0.165 and a minimum of 0.048. Therefore, when an impossible pose estimation occurs relative to the image orientation or it is obtained owing to the skeletal structure, it is considered possible to improve the masking accuracy by applying correction based on the immediately preceding or following correct estimation results.

Fig. 12. Examples of frames in which nearby objects were mistakenly detected as pedestrians.
Based on the above, it was found that the videos generated by the proposed method enable human detection and tracking using object detection and can count pedestrians more accurately than existing methods. Therefore, it is considered that the proposed method improves upon the existing challenge of “being unable to detect and track pedestrians and mask their attributes in a readable shape.” Furthermore, using the IoU values given by the proposed method enables evaluation of the masking accuracy of the generated video, as discussed in this section. This addresses the problem of lack of masking precision. However, the detection, tracking, and masking accuracies depend on the precision of existing masking method used. Furthermore, if none of the methods can detect an individual in the original video, applying masking and generating a video that fully protects privacy becomes impossible. Therefore, to achieve more practical masking, it is necessary to improve the accuracy of existing methods by combining multiple algorithms. Combination of methods such as background subtraction or inter-frame difference techniques, which are not deep learning-based, can be used to detect pedestrians.
The present study has several limitations. First, the experiment was conducted using a single 15-minute video sequence from a single viewpoint; therefore, the results cannot be generalized to all pedestrian environments. Second, the attribute estimation models were trained using limited seasonal data, which caused domain-shift errors under winter clothing conditions. Third, the proposed generative masking method did not outperform the baselines in all IoU-related metrics and showed a higher incidence of masking omission. Fourth, this study did not conduct a formal privacy evaluation such as re-identification testing. Finally, gait patterns may persist because the pose sequences are preserved during generation. These limitations will be addressed in future studies by expanding the dataset, introducing seasonally balanced training data, improving the masking-failure detector, and developing gait anonymization techniques.
5. Conclusion
This study investigated the technical requirements and existing methods for generating video data using attribute-specific masking applied in a form suitable for long-term preservation. We then devised methods to address the limitations of the existing approaches. Through empirical experiments, we evaluated the accuracies of personal attribute estimation and machine-based detection and tracking, as well as the masking precision, for masked video data generated using our proposed method. The results demonstrated that in the tested counting scenario, the proposed method achieved a pedestrian count close to the manual reference count while replacing the facial and bodily appearances with synthetic pedestrian images. However, this study did not establish formal privacy guarantees, and gait-related motion patterns may persist in the generated video. Therefore, the proposed method should be regarded as a feasibility study for privacy-preserving pedestrian video archiving, rather than a complete privacy solution. This suggests the potential of the framework to support the retention of surveillance footage for future reanalysis with a reduced level of visual identifiability, although it does not guarantee safe or fully anonymized archiving by itself. While the pilot study revealed limitations in attribute retention owing to seasonal variation, the proposed framework demonstrated the feasibility of generating anonymized footage with reduced visual identifiability. We do not claim compliance with any specific legal privacy standards, because no formal privacy risk assessment was conducted. The IoU evaluation metric proposed in this study may serve as a building block for future privacy-preserving traffic observation systems, which will be subject to further validation. Furthermore, in the test setting, the IoU values calculated using the proposed method can indicate whether the generated footage remains suitable for the evaluated pedestrian counting task. Generalization to other monitoring tasks requires further evaluation. Furthermore, the error between the generated and original videos can be used to identify the areas where the masking results should be corrected. This addresses: the lack of clarity regarding the masking accuracy, a key limitation of existing methods. However, because an IoU value of 1.000 likely indicates masking failure (i.e., the person was not masked), future work must involve developing an evaluation metric, in addition to the IoU, for masking omissions. Furthermore, the accuracies of detection, tracking, and masking depend on the accuracies of the existing methods leveraged in the proposed technique. Therefore, to generate more practical videos, we plan to improve the overall accuracy by introducing an ensemble approach that integrates estimation results from multiple methods to reduce detection omissions and to correct the masking results. This study developed a method for protecting facial and bodily privacy. Nevertheless, because the proposed method performs masking based on the skeleton, the gait is also preserved. However, techniques for identifying individuals from their gait 30 have been proposed; therefore, improvements such as intentionally altering the skeletal information of the feet when creating input prompts can also be considered.
- [1] M. Shamroukh, A. Natapov, and T. Larimian, “Reliability and scalability of pedestrian monitoring practices: A systematic review,” IEEE Access, Vol.13, pp. 147679-147689, 2025. https://doi.org/10.1109/ACCESS.2025.3599283
- [2] E. S. Bibri, “Data-driven smart sustainable cities of the future: New conceptions of and approaches to the spatial scaling of urban form,” Future Cities and Environment, Vol.7, No.1, pp. 1-15, 2021. https://doi.org/10.5334/fce.120
- [3] P. Voigt and A. von dem Bussche, “The EU General Data Protection Regulation (GDPR): A Practical Guide,” Springer Nature, 2017. https://doi.org/10.1007/978-3-031-62328-8
- [4] R. J. Padilla-López, A. A. Chaaraoui and F. Flórez-Revuelta, “Visual privacy protection methods: A survey,” Expert Systems with Applications, Vol.42, No.9, pp. 4177-4195, 2015. https://doi.org/10.1016/j.eswa.2015.01.041
- [5] NEC Solution Innovators, Ltd., “Field Analyst.” https://www.nec-solutioninnovators.co.jp/en/sl/fieldanalyst/index.html [Accessed January 1, 2026]
- [6] S. Okamura, M. Nakahara, and Y. Matsui, “A Study on video image generation method for measuring town vitality considering age groups and gender,” Proc. 87th National Convention of IPSJ, Vol.87, No.2, pp. 867-868, 2025 (in Japanese).
- [7] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko, “End-to-end object detection with transformers,” Proc. European Conf. on Computer Vision (ECCV), 2020.
- [8] H. Jiang and E. Learned-Miller, “Face detection with the faster R-CNN,” Proc. 2017 12th IEEE Int. Conf. on Automatic Face and Gesture Recognition (FG 2017), pp. 650-657, 2017. https://doi.org/10.1109/FG.2017.82
- [9] E. K. Tokuda, Y. Lockerman, G. B. Ferreira, E. Sorrelgreen, D. Boyle, R. M. Cesar-Jr, and C. T. Silva, “A new approach for pedestrian density estimation using moving sensors and computer vision,” ACM Trans. on Spatial Algorithms and Systems (TSAS), Vol.6, No.4, pp. 1-20, 2020. https://doi.org/10.1145/3397575
- [10] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C. Y. Fu, and A. C. Berg, “SSD: Single shot multibox detector,” Proc. ECCV, pp. 21-37, 2016. https://doi.org/10.1007/978-3-319-46448-0_2
- [11] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You only look once: Unified, real-time object detection,” Proc. IEEE Conf. on Computer Vision and Pattern Recognition, pp. 779-788, 2016. https://doi.org/10.1109/CVPR.2016.91
- [12] Fannovel 16, “ComfyUI-video-matting.” https://github.com/Fannovel16/ComfyUI-Video-Matting [Accessed January 1, 2026]
- [13] IDEA-Research, “DWPose.” https://github.com/IDEA-Research/DWPose [Accessed January 1, 2026]
- [14] N. Wojke, A. Bewley, and D. Paulus, “Simple online and realtime tracking with a deep association metric,” Proc. Int. Conf. on Image Processing (ICIP), pp. 3645-3649, 2017. https://doi.org/10.1109/ICIP.2017.8296962
- [15] J. Cao, J. Pang, X. Weng, R. Khirodkar, and K. Kitani, “Observation-centric sort: Rethinking sort for robust multi-object tracking,” Proc. IEEE/CVF Conf. on Computer Vision and Pattern Recognition, pp. 9686-9696, 2023. https://doi.org/10.1109/CVPR52729.2023.00934
- [16] G. Maggiolino, A. Ahmad, J. Cao, and K. Kitani, “Deep OC-SORT: Multi-pedestrian tracking by adaptive re-identification,” Proc. IEEE Int. Conf. on Image Processing (ICIP), pp. 3025-3029, 2023. https://doi.org/10.1109/ICIP49359.2023.10222576
- [17] M. Kamijo, “Gait-based age estimation using spatial fluctuating image sequences during the gait cycle,” Bulletin of Graduate Studies, Computer and Information Sciences, Vol.19, pp. 1-6, 2024 (in Japanese).
- [18] Q. Qin, and J. Vychodil, “Pedestrian detection algorithm based on improved convolutional neural network,” J. Adv. Comput. Intell. Intell. Inform., Vol.21, No.5, pp. 834-839, 2017. https://doi.org/10.20965/jaciii.2017.p0834
- [19] H. Chao, Y. He, J. Zhang, and J. Feng, “GaitSet: Regarding gait as a set for cross-view gait recognition,” Proc. AAAI Conf. on Artificial Intelligence, pp. 8126-8133, 2019. https://doi.org/10.1609/aaai.v33i01.33018126
- [20] A. Frühstück, K. K. Singh, E. Shechtman, N. J. Mitra, P. Wonka, and J. Lu, “InsetGAN for full-body image generation,” Proc. IEEE/CVF Conf. on Computer Vision and Pattern Recognition, pp. 7723-7732, 2022. https://doi.org/10.1109/CVPR52688.2022.00757
- [21] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” Advances in Neural Information Processing Systems, Vol.27, 2014.
- [22] H. Hukkelås and F. Lindseth, “Deepprivacy2: Towards realistic full-body anonymization,” Proc. IEEE/CVF Winter Conf. on Applications of Computer Vision (WACV 2023), pp. 1329-1338, 2023. https://doi.org/10.1109/WACV56688.2023.00138
- [23] L. Ma, X. Jia, Q. Sun, B. Schiele, T. Tuytelaars, and L. Van Gool, “Pose guided person image generation,” Advances in Neural Information Processing Systems, Vol.30, 2017.
- [24] M. Mirza and S. Osindero, “Conditional generative adversarial nets,” arXiv:1411.1784, 2014. https://doi.org/10.48550/arXiv.1411.1784
- [25] Viggle Inc., “ViggleAI.” https://viggle.ai/home [Accessed January 1, 2026]
- [26] R. Güler, N. Neverova, and I. Kokkinos, “DensePose: Dense human pose estimation in the wild,” Proc. IEEE Conf. on Computer Vision and Pattern Recognition, pp. 7297-7306, 2018. https://doi.org/10.1109/CVPR.2018.00762
- [27] S. Fu, D. Wei and L. Zhou, “Improved YOLOv8-based algorithm for detecting helmets of electric moped drivers and passengers,” J. Adv. Comput. Intell. Intell. Inform., Vol.29, No.2, pp. 349-357, 2025. https://doi.org/10.20965/jaciii.2025.p0349
- [28] L. Zhang, A. Rao, and M. Agrawala, “Adding conditional control to text-to-image diffusion models,” Proc. IEEE/CVF Int. Conf. on Computer Vision, pp. 3836-3847, 2023.
- [29] Tencent AI Lab, “IP-adapter.” https://github.com/tencent-ailab/IP-Adapter [Accessed January 1, 2026]
- [30] C. Wan, L. Wang, V. V. Phoha, “A survey on gait recognition,” ACM Computing Surveys, Vol.51, No.5, pp. 1-35, 2018. https://doi.org/10.1145/3230633
This article is published under a Creative Commons Attribution-NoDerivatives 4.0 Internationa License.