An automatic object labeling method and system suitable for turnstile channels
By constructing an automatic annotation model based on a priority strategy, the problem of lack of annotation standards in the field of turnstile access was solved, achieving efficient and accurate dataset annotation and model training, thereby improving the access efficiency and security of turnstile systems.
Patent Information
- Application Number
- CN202510021548.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-01-07
AI Technical Summary
The lack of high-quality deep image dataset annotation standards in the field of turnstile access makes it difficult for model training to converge and results in low confidence. Furthermore, traditional annotation methods lead to inconsistent and overlapping object detection boxes, affecting the generalization and accuracy of the model.
An automatic labeling model based on a priority strategy is constructed. By using the YOLOv8 network structure and introducing a priority loss term, and taking into account the characteristics of gate passage, the consistency of detection box positions is ensured. The model is trained using an initial dataset, and the priority strategy is used to label human body parts, locations, and identities, and to filter out and process interfering targets.
It reduced annotation costs, improved the accuracy of datasets and the adaptability of models, enhanced detection performance, especially in complex scenarios, shortened project cycles, and reduced labor costs.
Smart Images

Figure CN119418281B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of gate control and machine vision technology, and particularly relates to an automatic object labeling method and system suitable for gate channels. Background Technology
[0002] A turnstile is a device used for area separation and access control. By combining authorization verification and payment transactions, turnstiles can divide areas into paid and non-paid zones, and authorized and unauthorized zones, thereby achieving effective access management. Turnstiles are widely used in various access control scenarios such as automated fare collection (AFC) systems, building management, and stadiums. The passage logic technology of a turnstile is the technical foundation for evaluating its passage detection performance and a core component for ensuring the efficiency and reliability of turnstile passage.
[0003] With the continuous advancement of technology, the access control logic technology of turnstiles has gradually shifted from traditional sensor-based solutions to machine vision-based solutions. In recent years, deep learning methods, which utilize depth images obtained by depth cameras and combine them with object detection and tracking algorithms, have begun to attract attention. In machine vision-based turnstile access control logic technology, the accuracy of the machine learning model in object detection and tracking is a key indicator for measuring its access efficiency and security, and the accuracy of the model depends on a high-quality training dataset.
[0004] However, for specialized equipment applications like turnstiles where the field of view is limited, there are currently no publicly available depth image datasets or universal annotation standards. This leads to a situation where multiple annotators may apply different annotation criteria during the lengthy annotation process, resulting in problems such as difficulty in model training based on the annotated dataset, low confidence, and other issues. For example, in situations where pedestrians and objects (such as luggage or carts) occlude each other within the passageway, object detection models trained using traditional annotation methods may tend to avoid overlapping detection boxes, maximize the detection box directly, or use inconsistent rules—sometimes labeling hands as part of the human body while ignoring them. This results in low generalization and accuracy of the model, and in severe cases, may even lead to model non-convergence.
[0005] An excellent model training dataset should contain a large amount of accurately labeled image data. The labeling accuracy of the image data directly affects the training effect and detection performance of the model. Therefore, providing a high-quality automatic labeling solution for target objects within turnstile channels is one of the key means to reduce labeling costs, increase the labeling speed of labelers, and improve the training effect and detection performance of the model. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention provides an automatic object labeling method and system suitable for turnstile channels. The aim is to train an automatic labeling model that learns a priority-based detection box generation paradigm by combining a dataset of turnstile passage characteristics, ensuring that the output detection boxes do not interfere with each other's position determination.
[0007] The technical solution provided by this invention is as follows:
[0008] An automatic object labeling method suitable for turnstile channels includes the following steps:
[0009] S1. Construct an initial dataset based on the characteristics and priority strategy of the turnstile passage;
[0010] S2. Construct an automatically labeled model and train the model using the initial dataset;
[0011] S3. Use an automatic annotation model to perform target detection on the image to be annotated, and use the pedestrian target information in the target detection results as the annotation information of the image to be annotated.
[0012] Furthermore, in step S1, in the depth image of the gate channel from a top-down view, all human objects need to be identified and marked during annotation to ensure that the complete human body pixels of each person are included in their corresponding annotation box as much as possible, while excluding other irrelevant objects and people; overlap between annotation boxes should be avoided as much as possible. For unavoidable overlapping areas, according to the annotation priority strategy, the integrity of the annotation box of the high priority area is ensured, and the annotation box of the low priority area is adjusted or reduced.
[0013] Furthermore, the annotation priority strategy includes a human body part priority strategy: for human body parts, the head has the highest priority. Under any circumstances, the head of an adult or child must appear completely within its own annotation box and cannot appear in the annotation box of others; the torso has the next highest priority, with the area above the shoulders having a higher priority than the chest, and the chest having a higher priority than the waist; the limbs have the lowest priority and are discarded when necessary to ensure the complete annotation of high-priority parts.
[0014] Furthermore, the labeling priority strategy includes a location priority strategy: for the location of an object, in the same image, a pedestrian located in the center of the gate channel has a higher labeling priority than a pedestrian located at the edge. The integrity of the labeling box of a high-priority object should be ensured, and the labeling box of a lower-priority object should avoid obscuring the labeling box of a higher-priority object.
[0015] Furthermore, the labeling priority strategy includes a personnel identity priority strategy: when a child is occluded by an adult or when the boundary between the child and the adult is not obvious, the integrity of the adult's label box is ensured first.
[0016] Furthermore, when labeling, the clothing worn by pedestrians is considered part of the human body, unless there is a clear color boundary or shape feature between the clothing and the body; if the personal belongings carried by pedestrians have a clear boundary with the human body, these items should be excluded from the labeling frame while ensuring the integrity of the adult body; when a child is in close contact with an adult and there is no clear boundary between the child's head and the adult, the child is considered the adult's personal belongings. If there is a clear boundary between the child and the adult, a separate labeling frame should be drawn for the child, and the adult's labeling frame should not include the child's head pixels.
[0017] Furthermore, in step S2, the automatic annotation model adopts the YOLOv8 network structure, and the model loss function, based on YOLOv8, introduces a priority loss term:
[0018] ,
[0019] In the formula, L total The loss function for the automatic labeling model; L cls This represents the classification loss, used to measure the difference between the predicted class and the true class; L obj This represents the confidence loss, which measures the confidence level of whether the predicted bounding box contains the target. L box This represents the bounding box regression loss, used to measure the difference in position and size between the predicted box and the ground truth box; Indicates priority loss, and
[0020] ,
[0021] ,
[0022] in, P(x,y) The priority weight is calculated based on the center coordinates (x, y) of the bounding box. W and H Let be the width and height of the image, respectively.
[0023] Further, in step S3, the pedestrian target detection results of the automatic annotation model are filtered to exclude interfering targets. The filtering process includes noise detection: calculating the mean and standard deviation of pixel intensity of the pedestrian target image region. If the mean or standard deviation of pixel intensity exceeds a set threshold, it indicates that the pedestrian target detected by the automatic annotation model is an interfering target and should not be included in the dataset as an annotation sample. The filtering process also includes pattern matching: calculating the correlation between the pedestrian target image region and a known noise pattern. If the correlation exceeds a set threshold, it indicates that the pedestrian target detected by the automatic annotation model is an interfering target.
[0024] An automatic object annotation system based on the above method includes an initial dataset construction module, an automatic annotation model training module, and an automatic annotation module.
[0025] The initial dataset construction module includes an image display module, a manual annotation module, and an annotation information storage module. Annotators use the annotation tools provided by the manual annotation module to annotate pedestrian targets in the gate channel images displayed in the image display module according to a priority strategy. Then, the manual annotation module saves the corresponding annotation information to the annotation information storage module. The automatic annotation model training module is used to train the constructed automatic annotation model using the initial dataset. It includes a training parameter setting module and a training process visualization module. The automatic annotation module uses the trained automatic annotation model to perform target detection on the image to be annotated and uses the pedestrian target information in the target detection results as the annotation information for the image to be annotated.
[0026] Preferably, the automatic labeling module further includes a filtering processing module for filtering pedestrian targets in the target detection results to eliminate interfering targets.
[0027] Compared with the prior art, the present invention has at least the following beneficial effects:
[0028] Reduced dataset annotation costs: The automatic annotation model in this invention uses a pre-learned priority strategy to determine the subject, thereby providing highly consistent bounding box judgments, reducing positional errors caused by overlap, and lowering annotation review costs, model training costs, and field application costs throughout the project process.
[0029] It possesses greater adaptability: turnstile passage may encounter various complex scenarios, such as different objects, high density, different overlaps, or interactions. The automatic annotation model in this invention takes these complexities into account during training based on a specific dataset, enabling it to maintain consistency across various situations and consequently making the model more prone to convergence.
[0030] Improving the accuracy of dataset annotation: False positives and false negatives are one of the main challenges in the field of machine vision. Overlapping areas caused by interference between multiple objects are often areas with a high incidence of difficult examples. In order to improve the accuracy of difficult example detection, the automatic annotation model in this invention can provide annotators with consistent annotation references for different scenarios to be annotated, thereby improving the quality of the final dataset and indirectly ensuring the smooth operation of the gate system. Attached Figure Description
[0031] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0032] Figure 1 This is a schematic flowchart of an automatic object annotation method provided in an embodiment of the present invention;
[0033] Figure 2 This is a schematic diagram of a priority strategy provided in an embodiment of the present invention;
[0034] Figure 3 This is a labeling example A provided in an embodiment of the present invention;
[0035] Figure 4 This is an example of labeling provided in an embodiment of the present invention;
[0036] Figure 5 This is a labeling example C provided in an embodiment of the present invention;
[0037] Figure 6 This is a labeling example D provided in an embodiment of the present invention;
[0038] Figure 7 This is a labeling example E provided in an embodiment of the present invention;
[0039] Figure 8 This is a labeling example F provided in an embodiment of the present invention;
[0040] Figure 9 This is a labeling example G provided in an embodiment of the present invention;
[0041] Figure 10 This is a labeling example H provided in an embodiment of the present invention;
[0042] Figure 11 This is an example of labeling provided in an embodiment of the present invention;
[0043] Figure 12 This is a labeling example J provided in an embodiment of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, other embodiments obtained by those skilled in the art without creative effort are all within the scope of protection of the present invention.
[0045] Example 1
[0046] This embodiment provides a method for automatic object labeling suitable for turnstile channels, such as... Figure 1 As shown, the method mainly includes the following steps:
[0047] An initial dataset was constructed based on the characteristics and priority strategies of turnstile access.
[0048] Build an automatically labeled model and train it using the initial dataset;
[0049] An automatic annotation model is used to perform target detection on the images to be annotated, and the pedestrian target information in the target detection results is used as the annotation information for the images to be annotated.
[0050] I. Construction of the initial dataset
[0051] 1. Determining the Marked Object
[0052] In the acquired depth images of the turnstile passage from a top-down view, all human objects need to be identified and labeled during annotation. Labeled objects include all identifiable human individuals in the images, including both adults and children. During annotation, it should be ensured that the complete human body pixels of each person are included within their corresponding bounding box as much as possible, while excluding other irrelevant objects and people. The initial dataset should contain pedestrians at various locations within the turnstile passage and various occlusion scenarios, with a dataset size of at least 2000 images.
[0053] 2. Setting the priority of annotations
[0054] To effectively handle the obstruction and overlap between multiple pedestrians within the turnstile channel, such as Figure 2 As shown, the concept of labeling priority is introduced, and it is defined from three dimensions: body part, location, and person's identity.
[0055] 2.1. Priority of body parts:
[0056] Head has the highest priority: Under all circumstances, the head of an adult or child must appear completely within its own annotation frame and cannot appear within the annotation frames of others. The completeness of the head is crucial for accurately determining the location and identity of a pedestrian. Torso has the next highest priority: the area above the shoulders has higher priority than the chest, and the chest has higher priority than the waist. High-priority torso areas should be included in the annotation whenever possible. Limbs have the lowest priority: in order of upper arm and thigh, forearm and lower leg, and hand and foot. Limbs can be omitted if necessary to ensure the complete annotation of high-priority areas.
[0057] 2.2. Priority of Position:
[0058] Higher priority is given to centrally located objects: Pedestrians in the center of the turnstile channel in an image have a higher labeling priority than those at the edges. This strategy helps improve the detection accuracy in the central region of the channel, meeting the practical application requirements of turnstile channels. Within the same image, the integrity of high-priority object bounding boxes should be ensured, while lower-priority object bounding boxes should avoid obscuring higher-priority object bounding boxes. For example: Figure 3 The pedestrians in the lower middle have higher priority, so to avoid overlap, the label box of the pedestrians above does not extend to the right to include the entire torso; Figure 4 The pedestrian on the right has a higher position priority, while the label box for the pedestrian on the left does not extend to the right to include the entire torso.
[0059] 2.3. Priority of Personnel Identity
[0060] Children are given relatively lower priority: due to their shorter stature, accurate detection may be difficult from a top-down perspective. While a child's head should still be fully contained within its annotation frame, priority should be given to ensuring the integrity of the adult's annotation when the child is occluded by an adult or when the boundary between the two is unclear.
[0061] In some embodiments, the labeling of pedestrians' clothing and belongings may follow the following strategies:
[0062] 3.1. Handling of Adult Clothing
[0063] Clothing is considered part of the body: Clothing worn by adults (such as sleeves, hems, skirts, etc.) should be considered part of their body and entirely included within the labeled box, unless there is a clear color boundary or shape between the clothing and the body. Figure 5 The adult's sleeves, hem, etc., can be identified and there is no clear boundary between them and the adult, so they should all be included within the adult label box.
[0064] 3.2. Adults carrying small objects
[0065] Items carried by adults should not be included in the label box: For small items such as handbags, underarm bags, and backpacks carried by adults, if there is a clear boundary between them and the human body, these items should be excluded from the label box, provided that the adult's body integrity is ensured. Figure 6 When an adult carries a bag under their arm, the edge of the bag and the person have a clear color boundary, indicating that it is not part of the human body. Therefore, it is directly labeled as an adult human body, thus separating the bag from the person.
[0066] 3.3. Adults carrying large objects
[0067] Handling based on the degree of occlusion: When an adult is carrying a large object (such as a stroller or oversized item), the labeling should be based on how much the object occludes the person. If the large object occludes the area below the adult's waist and has a clear color or shape boundary with the person, the label should ideally only include the person's body. If necessary, the label box can appropriately include some of the object's pixels, but this should not affect the judgment of the person's position and shape. Figure 7An adult pushes a stroller in front, treating the stroller as an ordinary object. Therefore, the adult's head, shoulders, and back are used as dividing lines for labeling, and the label box will include some stroller pixels.
[0068] In some embodiments, the following strategies can be used to handle occlusion and overlap issues that occur during the annotation process:
[0069] 4.1 Conflict at the shoulders and above
[0070] Priority Determination: When multiple pedestrians' shoulders and above conflict, priority is first determined by their location. For pedestrians with higher priority, their heads and shoulders should be fully contained within their designated area, as shown in the image. Figure 8 As shown. For personnel with the same priority, the conflict area can be handled by uniformly cutting the conflict area and making the edges of the annotation boxes overlap, as shown. Figure 9 As shown.
[0071] 4.2 Conflicts at the waist and below
[0072] Reduce the annotation of low-priority areas: When multiple people have conflicting annotations of their waist and lower body areas, prioritize ensuring complete annotation of high-priority areas (above the chest) for others. The annotation boxes for low-priority personnel can be appropriately reduced to avoid interfering with the annotation of high-priority personnel. For example... Figure 10 As shown, the arms of the two people conflict (the priority of the arms is lower than that of the waist, so they are collectively referred to as the waist and below). The person with the higher priority in the center is labeled first, and then the people on the outside are labeled close to their borders.
[0073] 4.3 Obstruction between children and adults
[0074] Handle according to the situation: When a child is in close contact with an adult, and there is no clear boundary between the child's head and the adult's head, the child is considered the adult's personal belongings. Figure 11 As shown, no separate annotation is required. If there is a clear boundary between the child and the adult, the child should be labeled separately, and the adult's annotation box should not include the child's head pixels. Figure 12 As shown.
[0075] 4.4 Handling Overlapping Annotation Boxes
[0076] Minimize overlap: Label boxes should overlap as little as possible to reduce computational complexity during inference. For unavoidable overlaps, a pre-defined priority strategy should be used. Label boxes for high-priority personnel should be complete, while those for low-priority personnel can be adjusted or reduced appropriately.
[0077] II. Construction and Training of Automatic Labeling Model
[0078] After creating the initial dataset, this embodiment trains an automatic annotation model based on this dataset. To adapt to the pedestrian detection requirements from the top-down view of the turnstile, the model structure is optimized based on the standard object detection model, and a priority loss term is introduced into the loss function to ensure that the model can learn and follow the aforementioned priority-based annotation specifications.
[0079] 1. Model Structure
[0080] This embodiment uses a YOLOv8-based object detection model as its basic structure, which mainly consists of three parts: Backbone, Neck, and Head. The Backbone is responsible for extracting multi-scale feature representations from the input image, including multiple convolutional layers, residual modules, and CSP (Cross Stage Partial) modules. It obtains feature maps of different scales through layer-by-layer downsampling. The Neck is used to fuse features of different scales to enhance the model's ability to detect targets of different sizes. It adopts a structure combining FPN (Feature Pyramid Network) and PANet (Path Aggregation Network) to achieve top-down and bottom-up feature fusion. By fusing the multi-scale features extracted by the Backbone, the Neck can obtain rich contextual information. The Head is used for object classification and localization (providing bounding box parameters) of the fused features. It includes prediction modules at multiple scales. Each prediction module contains a bounding box parameter regression branch and a class probability output branch. Each branch includes a convolutional layer and an activation function. For the specific network structure, please refer to YOLOv8.
[0081] 2. Model Training
[0082] 2.1 Data Preprocessing
[0083] Before training, the initial dataset undergoes data augmentation and preprocessing. This includes operations such as random cropping, scaling, flipping, and color dithering to increase data diversity and improve the model's generalization ability.
[0084] 2.2 Loss Function Design
[0085] To enable the model to learn priority-based annotation specifications, a priority loss term is introduced in addition to the standard YOLOv8 object detection loss. The total loss function L total It includes the following parts:
[0086] ,
[0087] in, L clsThis represents the classification loss, which measures the difference between the predicted class and the true class. In this embodiment, cross-entropy loss or focal loss is used to address the problem of imbalance between positive and negative samples. L obj This represents the confidence loss, which measures the confidence level of whether the predicted bounding box contains the target. In this embodiment, binary cross-entropy loss is used. L box The bounding box regression loss measures the difference in position and size between the predicted and ground truth bounding boxes. In this embodiment, CIoU loss (Complete Intersection over Union Loss) is used to comprehensively consider the position, size, and shape of the bounding box.
[0088] ,
[0089] ,
[0090] in, The intersection-union ratio (IU) of the predicted bounding box and the ground truth bounding box. This represents the Euclidean distance between the center of the predicted bounding box and the center of the ground truth bounding box. c Let be the diagonal length of the smallest closure region containing both the predicted and ground truth boxes. v To measure the difference in aspect ratio between the predicted bounding box and the ground truth bounding box, These are the weighting coefficients. .
[0091] To enable the model to focus on high-priority target locations, a priority loss is defined. This encourages the model to provide more accurate predictions in high-priority regions. Since the application scenario is pedestrian detection in turnstiles, and the image is taken from a top-down view of the turnstiles, the central region of the turnstile should have higher priority than the edge regions. Therefore, the priority loss is set as follows:
[0092] ,
[0093] ,
[0094] in, L box For bounding box regression loss, P(x,y) The priority weight is calculated based on the center coordinates (x, y) of the bounding box. W and H Let be the width and height of the sample image, respectively. The image closer to the center has the highest priority weight. P(x,y) The value ranges from 0 to 1, with the center position having the highest priority of 1 and the edge position having the lowest priority of 0.
[0095] 2.3 Model Training Strategy
[0096] During training, multi-scale training and random data augmentation are employed to improve the model's robustness. The Adam or SGD optimizer is used to update the model parameters based on the gradient of the loss function.
[0097] To ensure the convergence and stability of the model, a cosine annealing learning rate scheduling strategy is adopted, setting the initial learning rate to lr0 and then gradually decreasing the learning rate during training:
[0098]
[0099] in, To minimize the learning rate, This represents the current number of training steps. This represents the maximum number of training steps.
[0100] 2.4 Model Evaluation Indicators
[0101] The model performance was evaluated on the validation set, using mAP (mean Average Precision) as the primary evaluation metric. Simultaneously, the model's detection accuracy in high-priority regions was considered, and AP values were calculated for different priorities. The effectiveness of the priority loss was verified by comparing the model's performance changes before and after incorporating it.
[0102] III. Automatic Labeling
[0103] The trained automatic annotation model is used to perform object detection on the image to be annotated, and the pedestrian annotation information (including the position and size of the annotation box) in the object detection result is used as the annotation information of the image to be annotated.
[0104] After using an automatic annotation model for target detection, to further improve the annotation accuracy, pedestrian targets can be filtered to eliminate interference (such as large areas of dust, light spots, or other non-person images captured by the camera), avoiding contamination of the final dataset and ensuring the accuracy of the dataset.
[0105] The screening process mainly includes two methods: noise detection and pattern matching.
[0106] Noise Detection (NoiseCheck): Calculates the mean and standard deviation of pixel intensity in the pedestrian target image region. If the mean or standard deviation exceeds a set threshold, it indicates that the pedestrian target detected by the automatic annotation model is an interfering target and is not suitable for inclusion in the dataset as an annotation sample. For pixels in the pedestrian target detection box, calculate the mean and standard deviation of their pixel intensity values; if they exceed a set threshold... or If the result is negative, it is identified as noise and eliminated. The formula is as follows:
[0107] ,
[0108] in, N It is the number of pixels within the detection box, I( x i , y i ) is a pixel ( x i , y i The intensity value of ) It is the mean threshold. It is the standard deviation threshold.
[0109] Pattern matching (PatternMatch): Calculates the target region of a pedestrian in an image. I Compared with known noise patterns P noise The correlation between the two is set. If the correlation exceeds the set threshold Tpattern, it indicates that the pedestrian target detected by the automatic annotation model is an interference target and is excluded. The formula is as follows:
[0110] ,
[0111] in, I The intensity matrix of the pedestrian target image region. P noise The noise pattern matrix is known. This noise pattern can be predefined, such as the matrix form corresponding to salt and pepper noise pattern, Gaussian noise pattern, etc. For correlation calculation functions, Pearson correlation coefficient, etc., can be used.
[0112] The above summarizes the main content of the automatic object annotation method for turnstile channels provided in this embodiment. The automatic annotation model obtained after the above training process demonstrates excellent performance in pedestrian detection tasks from a top-down view of the turnstile channel. The automatic annotation model can automatically identify and annotate pedestrians in images, significantly reducing the workload of manual annotation. Experimental data shows that using this method improved the efficiency of the annotation team by approximately 70%, thereby shortening the project cycle and reducing labor costs. By introducing a priority strategy into the initial dataset of the automatic annotation model, the model exhibits high consistency in annotation results when handling occlusion and overlap. Whether it's adults with adults, adults with children, or adults carrying items, the model can generate bounding boxes according to pre-set priority rules, avoiding inconsistent annotation standards caused by subjective human judgment. The automatic annotation model has higher detection accuracy in high-priority regions (such as the head and torso). By introducing priority loss, the model focuses more on features of important locations, improving its recognition ability in complex scenes. Based on the test set evaluation results: the overall detection accuracy (mAP) reached 95%, the detection accuracy in the head region improved to 98%, and the detection accuracy under occlusion conditions improved by approximately 45%.
[0113] Example 2
[0114] Based on the above method, this embodiment provides an automatic object annotation system suitable for turnstile channels. The system mainly includes: an initial dataset construction module, an automatic annotation model training module, and an automatic annotation module.
[0115] The initial dataset construction module includes an image display module, a manual annotation module, and an annotation information storage module. Annotators use the annotation tools provided by the manual annotation module to annotate pedestrian targets in the gate channel images displayed in the image display module according to a priority strategy. Then, the manual annotation module saves the corresponding annotation information to the annotation information storage module.
[0116] The automatic annotation model training module is used to train the constructed automatic annotation model using the initial dataset. It includes a training parameter setting module and a training process visualization module, which can display the training loss, iteration rounds, etc. in real time.
[0117] The automatic annotation module uses a trained automatic annotation model to detect objects in the image to be annotated, and uses the pedestrian target information (position and size of the annotation box) in the target detection results as the annotation information for the image to be annotated. In some embodiments, the automatic annotation module also includes a filtering module for filtering pedestrian targets in the target detection results to exclude interfering targets caused by factors such as dust and lighting.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; under the concept of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the present invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for automatic object labeling suitable for turnstile channels, characterized in that, Includes the following steps: S1. Construct an initial dataset based on the characteristics and priority strategy of gate passage; S2. Construct an automatic annotation model and train the model using the initial dataset; S3. Use the automatic annotation model to perform target detection on the image to be annotated, and use the pedestrian target information in the target detection results as the annotation information of the image to be annotated. In step S1, during the annotation process, all human objects need to be identified and marked in the depth image of the gate channel from a top-down perspective. This ensures that the complete human body pixels of each person are included in their corresponding annotation box, while excluding other irrelevant objects and people. Overlapping annotation boxes should be avoided. For unavoidable overlapping areas, the annotation box of the high-priority area should be kept intact according to the annotation priority strategy, while the annotation box of the low-priority area should be adjusted or reduced. The annotation priority strategy includes a human body part priority strategy: for human body parts, the head has the highest priority. Under any circumstances, the head of an adult or child must appear completely within its own annotation box and cannot appear in the annotation box of others; the torso has the next highest priority, with the area above the shoulders having a higher priority than the chest, and the chest having a higher priority than the waist; the limbs have the lowest priority. The labeling priority strategy includes a location priority strategy: for the location of an object, in the same image, a pedestrian located in the center of the gate channel has a higher labeling priority than a pedestrian located at the edge. The integrity of the labeling box of a high-priority object should be ensured, and the labeling box of a lower-priority object should avoid obscuring the labeling box of a higher-priority object. In step S2, the automatic annotation model adopts the YOLOv8 network structure, and the model loss function, based on YOLOv8, introduces a priority loss term: In the formula, The loss function for the automatic labeling model; This represents the classification loss, used to measure the difference between the predicted class and the true class; This represents the confidence loss, which measures the confidence level of whether the predicted bounding box contains the target. This represents the bounding box regression loss, used to measure the difference in position and size between the predicted box and the ground truth box; Indicates priority loss, and , , Where P(x,y) is the priority weight calculated based on the center coordinates (x,y) of the bounding box, and W and H are the width and height of the image, respectively; The labeling priority strategy includes a personnel identity priority strategy: when a child is obscured by an adult or when the boundary between the child and the adult is not obvious, the integrity of the adult's label box should be ensured first. When labeling, the clothing worn by pedestrians is considered part of the human body unless there is a clear color boundary or shape feature between the clothing and the body; if the personal belongings carried by pedestrians have a clear boundary with the human body, these items should be excluded from the labeling frame while ensuring the integrity of the adult body; when a child is in close contact with an adult and there is no clear boundary between the child's head and the adult, the child is considered the adult's personal belongings; if there is a clear boundary between the child and the adult, a separate labeling frame should be drawn for the child, and the adult's labeling frame should not include the child's head pixels; In step S3, the pedestrian target detection results of the automatic annotation model are filtered to exclude interfering targets. The filtering process includes noise detection: calculating the mean and standard deviation of pixel intensity of the pedestrian target image region. If the mean or standard deviation of pixel intensity exceeds a set threshold, it indicates that the pedestrian target detected by the automatic annotation model is an interfering target and should not be included in the dataset as an annotation sample. The filtering process also includes pattern matching: calculating the correlation between the pedestrian target image region and a known noise pattern. If the correlation exceeds a set threshold, it indicates that the pedestrian target detected by the automatic annotation model is an interfering target.
2. An automatic object annotation system based on the method of claim 1, characterized in that, The system includes an initial dataset construction module, an automatic annotation model training module, and an automatic annotation module. The initial dataset construction module includes an image display module, a manual annotation module, and an annotation information storage module. Annotators use the annotation tools provided by the manual annotation module to annotate pedestrian targets on the turnstile channel images displayed in the image display module according to a priority strategy. Then, the manual annotation module saves the corresponding annotation information to the annotation information storage module. The automatic annotation model training module is used to train the constructed automatic annotation model using the initial dataset, and includes a training parameter setting module and a training process visualization module. The automatic annotation module uses the trained automatic annotation model to perform target detection on the image to be annotated, and uses the pedestrian target information in the target detection results as the annotation information for the image to be annotated.
3. The automatic object annotation system as described in claim 2, characterized in that, The automatic labeling module also includes a filtering module for filtering pedestrian targets in the target detection results to eliminate interfering targets.
Citation Information
Patent Citations
Method and system for automatically labeling facial expressions
CN116012903A
Image label configuration method and device, electronic equipment and storage medium
CN116229242A