A method for generating negative sample images of personnel uniform identification

CN123015713APending Publication Date: 2026-10-30CHINESE PEOPLES LIBERATION ARMY UNIT 93236
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611240259.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

但现有基于全局GAN的生成方案大多从随机噪声出发整体合成图像,生成图像经常出现人体与制服错位、身体比例失调、服装缺少自然褶皱、光影与背景环境违和等严重缺陷,生成样本的真实度和可用性不高,难以直接投入模型训练

Benefits of technology

[0011]在本申请实施例中,该人员制服识别负样本图像生成方法,仅需现场便捷采集合规正样本,即可全自动批量生成高真实度的负样本图像,摆脱了人工摆拍负样本的高成本与低效率问题,解决了负样本天然稀缺的行业瓶颈;此外,通过引入人体姿态约束、部件语义掩码、自适应形变对齐及同源光影色温匹配,再由GAN生成器补全纹理褶皱,从源头避免了姿态错位、比例失调、光影割裂等传统合成缺陷,生成图像视觉自然、违和感极低;跨样本部件随机混搭与多维几何变换相结合,可海量产出制服错配、穿戴不规范等各类异常样本,覆盖模型训练所需的多样化场景,并且生成器与判别器迭代筛选形成闭环质控,确保输出负样本质量稳定可靠,显著提升了人员制服识别模型的泛化能力与落地效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015713A_ABST
    Figure CN123015713A_ABST
Patent Text Reader

Abstract

The application provides a personnel uniform identification negative sample image generation method, comprising: obtaining multiple positive samples, processing each positive sample: performing human body region segmentation on the positive sample to obtain a human body region image, and then establishing a posture constraint relationship; performing semantic segmentation on the positive sample to obtain multiple independent regions, generating a mask for each independent region, and performing local labeling on the uniform component region in the independent region, which is labeled as a positive sample component; based on the mask of the uniform component region, removing the original uniform component region from the positive sample to form a human body base image, and labeling the removal range; randomly extracting a uniform component combination from the positive sample components of multiple different positive samples, performing geometric morphing on the uniform components in the cross-sample combination based on the posture constraint relationship and the removal range; fusing the morphed uniform components and the human body base image using a generator to generate a negative sample; and using a discriminator to determine the authenticity of the negative sample to obtain a qualified negative sample.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer vision, deep learning image generation and target recognition technology, and specifically to a method for generating negative sample images for personnel uniform recognition. Background Technology

[0002] Intelligent uniform recognition is a core requirement in scenarios such as government and enterprise security and park duty. Its detection accuracy highly depends on the training quality of the deep learning model, and the training effect directly depends on the availability of a sufficient, diverse, and realistic dataset of positive and negative samples. Positive samples are compliant images of properly worn uniforms, which can be easily and efficiently acquired in large quantities by setting up cameras and capturing images on-site. However, negative samples refer to images of various non-compliant clothing, such as mismatched uniforms, mixed parts, and improper wearing. These occur infrequently in real-world scenarios, and their styles are uncontrollable, making them impossible to obtain in large quantities naturally through conventional on-site collection. If negative samples are constructed by manually posing for photos, it not only requires organizing a large number of people to repeatedly change clothes, adjust combinations, and simulate various non-compliant postures, resulting in extremely high time and labor costs, but also limits the coverage of clothing combinations, lighting conditions, human postures, and body shape differences due to limitations in venue and number of models, making it difficult to meet the model's generalization requirements for diverse negative samples.

[0003] To reduce the difficulty of acquiring negative samples, some current solutions employ image stitching and synthesis techniques, manually cutting and pasting different uniform parts onto a target human image. While this method can quickly generate a large number of combinations, due to a lack of structural understanding of the human body, the synthesized results generally suffer from problems such as harsh edges, unnatural transitions, misalignment of pose and clothing, and missing clothing texture and wrinkles. Especially under complex lighting conditions, the light source direction, color temperature distribution, and shadow levels of the stitched parts are severely disconnected from the original image, resulting in local color casts, whitening, or obvious contrast between light and dark areas, leading to a very poor sense of realism. The trained model has limited ability to distinguish real-world scenes and is prone to a large number of false positives or false negatives.

[0004] In recent years, Generative Adversarial Networks (GANs) have made significant progress in the field of image generation and have been attempted to directly generate complete negative sample images. However, most existing generation schemes based on global GANs synthesize images from random noise, resulting in serious defects such as misalignment of the human body and uniform, disproportionate body proportions, lack of natural folds in clothing, and inconsistencies between lighting and background. The realism and usability of the generated samples are not high, making them difficult to directly use for model training.

[0005] Therefore, there is an urgent need for a method that can automatically and quickly generate a large number of high-fidelity negative samples to solve the problems of difficulty in obtaining negative samples, high cost, lack of diversity and fidelity. Summary of the Invention

[0006] This application provides a method for generating negative sample images for personnel uniform recognition. Relying solely on compliant positive samples collected on-site, the method utilizes a complete chain of processes including human detection, pose key points, component segmentation masking, original clothing removal, component reconstruction and deformation, GAN generation and synthesis, and discriminator iterative optimization to quickly, cost-effectively, and automatically generate a large number of high-fidelity negative sample images, meeting the training requirements of uniform recognition models.

[0007] To achieve the above objectives, this application adopts the following technical solution: In a first aspect, this application provides a method for generating negative sample images for personnel uniform recognition, the method comprising: Obtain multiple positive sample images of personnel wearing standard uniforms, and perform the following processing on each positive sample image, including: Human body region segmentation is performed on positive sample images to obtain human body region images; Human pose key points are detected in human body region images, human skeleton key points are extracted, and then the geometric constraint relationship of human pose is established. Using a pre-defined human body analysis model, the positive sample image is semantically segmented into multiple independent regions. For each independent region, a corresponding mask is generated, and the uniform parts region in the independent region is locally labeled as positive sample parts. The independent region includes at least the uniform parts regions of the upper garment, lower garment, and hat. The mask edge fits the outline of the corresponding region. Based on the mask of the uniform parts region, the original uniform parts region is removed from the positive sample image, while the human body outline and exposed skin area are preserved to form a human body base image, and the removal range of the original uniform parts is marked. Uniform parts are randomly selected from positive sample parts of multiple different positive sample images, and cross-sample combination is performed. Based on the geometric constraints of human posture and the removal range, the geometric deformation of each uniform part in the cross-sample combination is performed to adapt to the human base image. Using a generator from a generative adversarial network, under preset constraints, deformed uniform parts are fused with a human body base image to generate negative sample images. The discriminator of a generative adversarial network is used to judge the realism of negative sample images. If the judgment result is lower than a preset threshold, the parameters of the generator are adjusted to regenerate negative sample images. This process is repeated until a qualified negative sample image is obtained.

[0008] Secondly, this application provides a negative sample image generation system for personnel uniform recognition, the system comprising: The positive sample acquisition and annotation module is used to acquire multiple positive sample images of people wearing standard uniforms, and to perform human body region segmentation on the positive sample images to obtain human body region images. The human pose extraction module is used to detect key points of human pose in human body region images, extract key points of human skeleton, and then establish geometric constraints of human pose. The component segmentation and masking module is used to perform semantic segmentation on positive sample images using a preset human body analysis model, segmenting them into multiple independent regions. For each independent region, a corresponding mask is generated, and the uniform component regions in the independent regions are locally labeled as positive sample components. The independent regions include at least the uniform component regions of the upper garment, lower garment, and hat. The mask edges fit the contours of the corresponding regions. The clothing removal module is used to remove the original uniform parts from the positive sample image based on the mask of the uniform parts area, while preserving the human body outline and exposed skin area to form a human body base image, and to mark the removal range of the original uniform parts. The component deformation alignment module is used to randomly extract uniform components from positive sample components of multiple different positive sample images, perform cross-sample combination, and perform geometric deformation on each uniform component in the cross-sample combination based on the geometric constraints of human posture and the removal range to adapt to the human base image. A generator is used to fuse deformed uniform parts with a human body base image under preset constraints to generate a negative sample image. The discriminator is used to determine the realism of negative sample images. If the determination result is lower than a preset threshold, the parameters of the generator are adjusted to regenerate the negative sample image, and the process is iterated until a qualified negative sample image is obtained.

[0009] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement the personnel uniform recognition negative sample image generation method of the first aspect.

[0010] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium including a computer program or instructions that, when executed, cause the personnel uniform recognition negative sample image generation method of the first aspect to be performed.

[0011] In this embodiment, the method for generating negative sample images for uniform recognition only requires convenient on-site collection of compliant positive samples to automatically generate high-fidelity negative sample images in batches. This eliminates the high cost and low efficiency of manually posing negative samples and solves the industry bottleneck of the natural scarcity of negative samples. Furthermore, by introducing human posture constraints, component semantic masks, adaptive deformation alignment, and homogeneous light and shadow color temperature matching, and then using a GAN generator to complete texture wrinkles, the method avoids traditional synthesis defects such as posture misalignment, proportional imbalance, and light and shadow fragmentation from the source. The generated images are visually natural and have extremely low sense of incongruity. The combination of random mixing of cross-sample components and multi-dimensional geometric transformation can generate a massive amount of abnormal samples such as uniform mismatch and improper wearing, covering the diverse scenarios required for model training. Moreover, the generator and discriminator iteratively screen to form a closed-loop quality control, ensuring that the output negative sample quality is stable and reliable, significantly improving the generalization ability and implementation effect of the uniform recognition model.

[0012] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 A flowchart illustrating the method for generating negative sample images for personnel uniform recognition provided in this application embodiment. Figure 1 ; Figure 2 A flowchart illustrating the method for generating negative sample images for personnel uniform recognition provided in this application embodiment. Figure 2 ; Figure 3 This is a schematic diagram of the structure of the personnel uniform recognition negative sample image generation system provided in the embodiments of this application. Detailed Implementation

[0015] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. At the same time, in the description of the embodiments of this application, the terms "first," "second," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0016] Figure 1 A flowchart illustrating the method for generating negative sample images for personnel uniform recognition provided in this application embodiment. Figure 1 ; Figure 2 A flowchart illustrating the method for generating negative sample images for personnel uniform recognition provided in this application embodiment. Figure 2 The following can be combined Figure 1 and Figure 2 The understanding is as follows: The process of generating negative sample images for personnel uniform recognition is as follows: Obtain multiple positive sample images of personnel wearing standard uniforms, and perform the following processing on each positive sample image, including: Step S101: Perform human body region segmentation on the positive sample image to obtain the human body region image.

[0017] In this embodiment, the resolution of each positive sample image is no less than 1080P.

[0018] For example, 1080P high-definition surveillance cameras were deployed at the entrances, corridors, and offices of government and enterprise office buildings. The camera coverage included three typical time periods: 9:00 AM, 2:00 PM, and 5:30 PM. Lighting conditions included natural light from windows, fluorescent indoor ceiling lights, and backlighting in corridors. Shooting angles included frontal, side, and approximately 45-degree oblique angles. The subjects included individuals aged 22 to 55, approximately 3000 men and 2000 women, in standing, walking, and sitting postures. A total of 5000 positive sample images were obtained, all with proper attire (shirts, bottoms, and hats all worn correctly). The SegFormer B2 semantic segmentation model was used to segment the human body region in each image, achieving an accuracy of 96%. Images retaining only the human body and uniform areas after segmentation were uniformly labeled as "positive samples," thus constructing a positive sample image dataset.

[0019] Then, each positive sample image in the positive sample image dataset is processed through steps S101-S107.

[0020] Step S102: Perform human pose key point detection on the human body region image, extract human skeletal key points, and then establish human pose geometric constraint relationships.

[0021] In this embodiment, the key points of human posture include at least four types of skeletal key points: shoulder, elbow, hip, and knee, and may also include four types of auxiliary key points: neck, wrist, ankle, and head.

[0022] Understandably, the OpenPose human pose detection model is used to detect skeletal key points in human body images. Eight key coordinate points are extracted: neck, shoulder (left / right), elbow (left / right), wrist (left / right), hip (left / right), knee (left / right), ankle (left / right), and head. By fitting these key point coordinates, the complete human skeletal pose is delineated, establishing geometric constraints and outputting human pose parameters (key point coordinates, bone length ratios, and joint angles). This ensures that subsequent uniform component deformation accurately matches the human pose, achieving a pose detection accuracy of over 95% with no missed or incorrect key point detections.

[0023] Step S103: Using a preset human body analysis model, semantic segmentation is performed on the positive sample image, dividing it into multiple independent regions. For each independent region, a corresponding mask is generated, and the uniform parts region in the independent region is locally labeled as positive sample parts. The independent region includes at least the uniform parts regions of the upper garment, lower garment, and hat. The mask edges fit the contour of the corresponding region.

[0024] In this embodiment, the multiple independent areas also include skin, hair, shoes, and background.

[0025] The SegFormer B2 human body parsing model, fine-tuned using the ATR human body parsing dataset, was used to perform pixel-by-pixel semantic segmentation on each positive sample image, dividing the image into 7 independent semantic regions: skin, hair, hat, top, bottom, shoes, and background.

[0026] Subsequently, a binary mask (1 for the inside of the region and 0 for the outside) is generated for each semantic region. The mask edges fit the actual contours of each region without obvious jagged edges or blurring. For the three core uniform components—hats, tops, and bottoms—a human-assisted machine annotation method is used to accurately annotate the position and contour of each component, achieving an accuracy rate of 99%. The annotated components are defined as "positive sample components," and their mask bounding box coordinates and coverage area parameters are recorded.

[0027] Step S104: Based on the mask of the uniform parts region, remove the original uniform parts region from the positive sample image, retain the human body outline and exposed skin area, form a human body base image, and mark the removal range of the original uniform parts.

[0028] That is, using the binary masks of the three types of parts—hat, top, and bottom—generated in step S103, a pixel-by-pixel logical removal operation is performed on the original positive sample image to accurately remove the original uniform parts. The removal process strictly controls the boundaries to ensure that the human skin area (face, hands, etc.), hair area, and human contour edges remain intact and undamaged, retaining only the human base image without the original uniform covering.

[0029] At the same time, based on the position of each mask in the original image, the positioning parameters of the uniform area to be replaced are automatically recorded, including the center coordinates, bounding box size, and outline polygon pixel set.

[0030] Step S105: Randomly extract uniform parts from the positive sample parts of multiple different positive sample images, perform cross-sample combination, and perform geometric deformation on each uniform part in the cross-sample combination based on the geometric constraints of human posture and the removal range to adapt to the human base image.

[0031] In this embodiment, geometric deformation is achieved by combining affine transformation with mesh distortion, scaling, rotating, and twisting to adapt to the human body base image.

[0032] It is understandable that a random sampling strategy is adopted, randomly selecting hats, tops, and bottoms from all positive sample components obtained in step S103 across different person images for mismatched combinations. For example, the top of sample A is replaced with the top of sample B, and the bottom of sample C is replaced with the bottom of sample D, generating multiple non-compliant component matching schemes. For each recombined component, its original size and proportion in the original image are determined. Combined with the key point coordinates and joint angle parameters of the target human body base image obtained in step S102, the scaling factor and rotation angle required for the target position are determined. First, the component is initially scaled, rotated, and translated through affine transformation. Then, a mesh-based local distortion algorithm (ThinPlate Spline, TPS) is used, with the shoulder width, waistline, and hip contour of the target human body as control points, to refine the deformation of the component, so that the edge of the component perfectly fits the contour of the target human body, with harmonious proportions and no deformation or misalignment.

[0033] Step S106: Using the generator of the generative adversarial network, under preset constraints, the deformed uniform parts are fused with the human body base image to generate a negative sample image.

[0034] In this embodiment, the preset constraints include: ensuring that the deformed uniform parts conform to the human body contour of the human body base image when the deformed uniform parts are fused with the human body base image, adding texture details and clothing wrinkles to the uniform parts, and performing light and shadow consistency matching on the uniform parts based on the light source direction, color temperature and shadow features of the original positive sample image.

[0035] It is understandable that the generator of the generative adversarial network (GAN) using the DCGAN architecture generates negative sample images in an unsupervised manner under the constraints of preset rules (parts fitting the contour, texture continuity, natural wrinkles, and homogeneous light and shadow). First, based on the topological relationship of the human body key points in step S102, the generator adaptively stretches and adjusts the uniform parts reconstructed and deformed in step S105 to closely fit the human body contour. Then, it automatically learns the uniform texture features of the positive sample image, completes the texture details of the uniform parts, and generates natural clothing wrinkles to restore a realistic wearing effect. Simultaneously, through an image lighting detection algorithm, it analyzes the light source direction, color temperature distribution, and shadow levels of the original positive sample image, adding corresponding light and dark transitions, highlights, and reflections to match the newly replaced uniform parts, ensuring that the lighting of the uniform parts is consistent with the human body base and background environment, avoiding problems such as light and shadow fragmentation and color cast. After synthesis, the entire image is labeled as a negative sample, and mismatched uniform parts within the image are locally labeled and defined as negative sample parts, facilitating part-level recognition during subsequent model training.

[0036] Step S107: The discriminator of the generative adversarial network is used to judge the realism of the negative sample image. If the judgment result is lower than the preset threshold, the parameters of the generator are adjusted to regenerate the negative sample image. The process is iterated until a qualified negative sample image is obtained.

[0037] In this embodiment, the preset threshold is 0.75 and the preset maximum number of iterations is 100.

[0038] In this embodiment, the discriminator of the generative adversarial network is pre-trained, and the specific training steps are as follows: A batch of negative sample images pre-generated by the generator are collected. Each negative sample image is observed by a person to determine whether each negative sample image is natural and realistic, has weak splicing traces, and has low overall sense of incongruity. Each negative sample image is labeled with a binary supervision label of "acceptable" or "unacceptable". Negative sample images labeled with binary supervision are used as training data and input into the discriminator for supervised learning training. This enables the discriminator to distinguish between natural and real images and incongruous images, thus obtaining a well-trained discriminator.

[0039] It should be noted that the discriminator needs to be pre-trained before official use. For example, 2000 negative sample images are randomly selected from the results generated in step S102, and each image is independently observed by three annotators. The annotation principle is: if an image looks "natural and realistic, without obvious splicing traces, and has no overall sense of incongruity," it is labeled "acceptable" (label 1); otherwise, it is labeled "unacceptable" (label 0). The final label for each image is determined by majority voting. The 2000 annotated images are used as training data and input into the supervised discriminator for supervised learning training. The binary cross-entropy loss function is used for iterative optimization until the discriminator's accuracy on the validation set reaches more than 90%. The weight parameters obtained during training are saved. At this point, the discriminator has learned the ability to distinguish between natural and realistic images and incongruous images.

[0040] After training, the system enters the practical application generation phase. The trained supervised discriminator, based on the saved weight parameters, automatically calculates and outputs a truth score between 0 and 1 for the newly generated negative sample images in step S106, without any manual intervention. The system's preset discrimination threshold is 0.75. When the discriminator output score for an image is greater than or equal to 0.75, the image is automatically determined to be a qualified negative sample and saved to the negative sample dataset. If the score is lower than 0.75, the system automatically adjusts the generator's texture completion intensity, lighting and shadow matching weights, and other parameters, triggering step S106 to regenerate and resubmit for discriminator evaluation. This automatic iteration loop has a maximum of 100 iterations; if the target is not met after 100 iterations, the combination is discarded.

[0041] In summary, in this embodiment, the method for generating negative sample images for personnel uniform recognition can automatically generate high-fidelity negative sample images in batches by simply collecting compliant positive samples on-site. This eliminates the high cost and low efficiency of manually posing negative samples and solves the industry bottleneck of the natural scarcity of negative samples. Furthermore, by introducing human posture constraints, component semantic masks, adaptive deformation alignment, and homogeneous light and shadow color temperature matching, and then using a GAN generator to complete texture wrinkles, the traditional synthesis defects such as posture misalignment, proportional imbalance, and light and shadow fragmentation are avoided from the source. The generated images are visually natural and have extremely low sense of incongruity. The combination of random mixing of cross-sample components and multi-dimensional geometric transformation can generate a large number of abnormal samples such as uniform mismatch and non-standard wearing, covering the diverse scenarios required for model training. Moreover, the generator and discriminator iteratively screen to form a closed-loop quality control, ensuring that the output negative sample quality is stable and reliable, significantly improving the generalization ability and implementation effect of the personnel uniform recognition model.

[0042] The above combination Figures 1-2 This application describes the method for generating negative sample images for personnel uniform recognition, as illustrated in the embodiments below. Figure 3 This describes a negative sample image generation system for personnel uniform recognition provided in the embodiments of this application.

[0043] The system includes: a positive sample acquisition and annotation module, a human pose extraction module, a component segmentation and masking module, a clothing removal module, a component deformation alignment module, a generator, and a discriminator, as detailed below.

[0044] The positive sample acquisition and annotation module is used to acquire multiple positive sample images of people wearing standard uniforms, and to perform human body region segmentation on the positive sample images to obtain human body region images. The human pose extraction module is used to detect key points of human pose in human body region images, extract key points of human skeleton, and then establish geometric constraints of human pose. The component segmentation and masking module is used to perform semantic segmentation on positive sample images using a preset human body analysis model, segmenting them into multiple independent regions. For each independent region, a corresponding mask is generated, and the uniform component regions in the independent regions are locally labeled as positive sample components. The independent regions include at least the uniform component regions of the upper garment, lower garment, and hat. The mask edges fit the contours of the corresponding regions. The clothing removal module is used to remove the original uniform parts from the positive sample image based on the mask of the uniform parts area, while preserving the human body outline and exposed skin area to form a human body base image, and to mark the removal range of the original uniform parts. The component deformation alignment module is used to randomly extract uniform components from positive sample components of multiple different positive sample images, perform cross-sample combination, and perform geometric deformation on each uniform component in the cross-sample combination based on the geometric constraints of human posture and the removal range to adapt to the human base image. A generator is used to fuse deformed uniform parts with a human body base image under preset constraints to generate a negative sample image. The discriminator is used to determine the realism of negative sample images. If the determination result is lower than a preset threshold, the parameters of the generator are adjusted to regenerate the negative sample image, and the process is iterated until a qualified negative sample image is obtained.

[0045] Furthermore, the specific implementation of the above system is basically similar to the method implementation, so the description is relatively simple. For relevant details, please refer to the description of the method implementation. Moreover, it should be noted that in the various modules of the system of this application, the components are logically divided according to the functions they are to perform. However, this application is not limited to this and can re-divide or combine the components as needed.

[0046] In another aspect, the present invention provides an electronic device for implementing the above-described method for generating negative sample images for personnel uniform recognition. This electronic device is not limited to a terminal device or server within a system. The electronic device includes, but is not limited to, a memory and a processor. The memory stores a computer program, and the processor is configured to execute the steps of any of the above-described method embodiments via the computer program.

[0047] In another aspect, the present invention provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various alternative embodiments of the above-described method for generating negative sample images for personnel uniform recognition. The computer program is configured to execute the steps in any of the above-described method embodiments during runtime.

[0048] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than those shown in the embodiments and still achieve the desired result. Furthermore, the specific order or sequential order shown in the drawings is not necessarily required to achieve the desired result; in some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0049] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for generating negative sample images for personnel uniform recognition, characterized in that, Includes the following steps: Obtain multiple positive sample images of personnel wearing standard uniforms, and perform the following processing on each positive sample image, including: Human body region segmentation is performed on positive sample images to obtain human body region images; Human pose key points are detected in the human body region image, human skeleton key points are extracted, and then the geometric constraint relationship of human pose is established. Using a pre-defined human body analysis model, the positive sample image is semantically segmented into multiple independent regions. For each independent region, a corresponding mask is generated, and the uniform component regions in the independent regions are locally labeled as positive sample components. The independent regions include at least the uniform component regions of the upper garment, lower garment, and hat. The mask edges fit the contour of the corresponding region. Based on the mask of the uniform component area, the original uniform component area is removed from the positive sample image, while the human body outline and exposed skin area are preserved to form a human body base image, and the removal range of the original uniform component is marked. Uniform parts are randomly selected from positive sample parts of multiple different positive sample images, and cross-sample combination is performed. Based on the geometric constraints of the human body posture and the removal range, the geometric deformation of each uniform part in the cross-sample combination is performed to adapt to the human body base image. Using a generator from a generative adversarial network, under preset constraints, the deformed uniform parts are fused with the human body base image to generate a negative sample image; The discriminator of a generative adversarial network is used to determine the realism of the negative sample image. If the determination result is lower than a preset threshold, the parameters of the generator are adjusted to regenerate the negative sample image. This process is repeated until a qualified negative sample image is obtained.

2. The method for generating negative sample images for personnel uniform recognition according to claim 1, characterized in that, The preset constraints include: when the deformed uniform part is fused with the human body base image, ensuring that the deformed uniform part conforms to the human body contour of the human body base image, adding texture details and clothing wrinkles to the uniform part, and performing light and shadow consistency matching on the uniform part based on the light source direction, color temperature and shadow features of the original positive sample image.

3. The method for generating negative sample images for personnel uniform recognition according to claim 1, characterized in that, The multiple independent areas also include skin, hair, shoes, and background.

4. The method for generating negative sample images for personnel uniform recognition according to claim 1, characterized in that, The geometric deformation is achieved by combining affine transformation with mesh distortion, scaling, rotating, and twisting to adapt to the human body base image.

5. The method for generating negative sample images for personnel uniform recognition according to claim 1, characterized in that, The key points of human posture include at least four types of skeletal key points: shoulder, elbow, hip, and knee.

6. The method for generating negative sample images for personnel uniform recognition according to claim 1, characterized in that, The discriminator of the generative adversarial network is pre-trained, and the specific training steps are as follows: A batch of negative sample images pre-generated by the generator are collected. Each negative sample image is observed by a person to determine whether each negative sample image is natural and realistic, has weak splicing traces, and has low overall sense of incongruity. Each negative sample image is labeled with a binary supervision label of "acceptable" or "unacceptable". The negative sample images labeled with binary supervision are used as training data and input into the discriminator for supervised learning training, so that the discriminator has the ability to distinguish between natural real images and incongruous images, thereby obtaining a trained discriminator.

7. The method for generating negative sample images for personnel uniform recognition according to claim 1, characterized in that, The preset threshold is 0.75, and the preset maximum number of iterations is 100.

8. The method for generating negative sample images for personnel uniform recognition according to claim 1, characterized in that, The resolution of the multiple positive sample images acquired is no less than 1080P.

9. A system for generating negative sample images for personnel uniform recognition, characterized in that, include: The positive sample acquisition and annotation module is used to acquire multiple positive sample images of people wearing standard uniforms, and to perform human body region segmentation on the positive sample images to obtain human body region images. The human pose extraction module is used to detect key points of human pose in the human body region image, extract key points of human skeleton, and then establish geometric constraint relationships of human pose. The component segmentation and masking module is used to perform semantic segmentation on positive sample images using a preset human body analysis model, segmenting them into multiple independent regions. For each independent region, a corresponding mask is generated, and the uniform component regions in the independent regions are locally labeled as positive sample components. The independent regions include at least the uniform component regions of the upper garment, lower garment, and hat. The mask edges fit the contours of the corresponding regions. The clothing removal module is used to remove the original uniform parts area from the positive sample image based on the mask of the uniform parts area, while preserving the human body outline and exposed skin area to form a human body base image, and to mark the removal range of the original uniform parts. The component deformation alignment module is used to randomly extract uniform components from positive sample components of multiple different positive sample images, perform cross-sample combination, and perform geometric deformation on each uniform component in the cross-sample combination based on the human body posture geometric constraint relationship and the cutout range to adapt to the human body base image. A generator is used to fuse the deformed uniform parts with the human body base image under preset constraints to generate a negative sample image; The discriminator is used to determine the realism of the negative sample image. If the determination result is lower than a preset threshold, the parameters of the generator are adjusted to regenerate the negative sample image, and the process is iterated until a qualified negative sample image is obtained.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the personnel uniform recognition negative sample image generation method as described in any one of claims 1-8.