Traffic scene-based sample labeling method and device, display device, and medium
By dividing candidate regions in traffic scenarios and using a sample library for similarity and spatial relationship analysis, the problems of low annotation efficiency and accuracy caused by small sample size and scene migration are solved, achieving efficient sample annotation and model training.
Patent Information
- Application Number
- CN202611638618.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-20
AI Technical Summary
In existing technologies, for targets with a small sample size or after migrating to new traffic scenarios, a large number of samples need to be collected for sample labeling, which leads to a long model training cycle and affects accuracy.
By acquiring images of the target road segment to be processed, candidate regions are divided using image features and baseline visual features. Similarity scoring and spatial relationship analysis are performed by combining samples in the traffic target sample library to determine sample background labels and update the sample library.
It reduces the data requirements for sample labeling, improves labeling efficiency and accuracy, and adapts to rapid migration to new traffic scenarios and low-cost model training.
Smart Images

Figure CN123142231A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sample annotation. More specifically, it relates to a sample annotation method, apparatus, display device, and medium based on traffic scenarios. Background Technology
[0002] Traffic segmentation data is a crucial foundation for training models such as road target recognition, traffic event analysis, road facility inspection, and traffic state understanding. Although the cameras that collect traffic images are located in fixed positions, there are significant differences between different road segments, and fixed objects in traffic scenes often cause occlusion and other interference. Therefore, each time a relevant model is trained, data needs to be collected again, and samples need to be segmented before model training. For targets with small sample sizes or when migrating to new traffic scenes, a large number of samples need to be collected and labeled, resulting in a long model training cycle. In addition, there are many easily confused factors in traffic scenes, which can also affect the accuracy of model sample labeling. Summary of the Invention
[0003] To address or at least partially address the aforementioned technical problems, this application provides a sample annotation method, apparatus, display device, and medium based on traffic scenarios. This addresses the issue that in the prior art, for targets with small sample sizes or after migrating to new traffic scenarios, a large number of samples need to be collected for sample annotation, resulting in a long model training cycle. Furthermore, traffic scenarios contain numerous easily confused influencing factors that also affect the accuracy of model sample annotation.
[0004] To achieve the above objectives, the technical solutions provided in this application are as follows: In a first aspect, embodiments of this application provide a sample annotation method based on traffic scenarios, the sample annotation method based on traffic scenarios including: Acquire the image to be processed on the target road segment; Based on the image features of the image to be processed and the baseline visual features, the deviation features of the target road segment are determined. The baseline visual features are visual features that can indicate the daily state of the road, other than the target sample to be labeled, that are extracted from the video of the target road segment. Based on the deviation features and the image features, the image to be processed is divided into multiple candidate regions; The first similarity between the candidate region and the first sample in the traffic target sample library, and the second similarity between the candidate region and the second sample in the traffic target sample library are determined respectively. The first sample is a positive sample related to the target sample, and the positive sample is a sample that is the same as the target sample. The second sample is a negative sample related to the target sample, and the negative sample is a pre-labeled easily confused sample related to the target sample. Based on the first similarity, the second similarity, and the consistency score among multiple pre-stored samples related to the target sample in the traffic target sample library, the scene matching score corresponding to each candidate region is determined; Based on the scene matching score and the region relationship graph corresponding to the candidate region, each candidate region is labeled with samples to determine the sample background label corresponding to the candidate region. The sample background label is used to indicate that the candidate region includes a sample or a background, and the region relationship graph is used to indicate the spatial relationship between the candidate regions. The target sample is obtained by combining at least one candidate region of the sample indicated by the sample background label. The traffic target sample library is updated based on the target sample.
[0005] Secondly, embodiments of this application provide a sample annotation device based on a traffic scenario, the sample annotation device based on a traffic scenario comprising: The acquisition module is used to acquire the image to be processed on the target road segment; The processing module is used to determine the deviation features of the target road segment based on the image features of the image to be processed and the reference visual features. The reference visual features are visual features that can indicate the daily state of the road, other than the target sample to be labeled, that are extracted from the video of the target road segment. The processing module is further configured to divide the image to be processed into multiple candidate regions based on the deviation features and the image features; The processing module is further configured to determine a first similarity between the candidate region and a first sample in the traffic target sample library, and a second similarity between the candidate region and a second sample in the traffic target sample library, wherein the first sample is a positive sample related to the target sample, the positive sample is a sample that is the same as the target sample, and the second sample is a negative sample related to the target sample, the negative sample is a pre-labeled easily confused sample related to the target sample; The processing module is further configured to determine the scene matching score corresponding to each candidate region based on the first similarity, the second similarity, and the consistency score among multiple pre-stored samples related to the target sample in the traffic target sample library; The processing module is further configured to perform sample annotation on each candidate region based on the scene matching score and the region relationship graph corresponding to the candidate region, and determine the sample background label corresponding to the candidate region. The sample background label is used to indicate that the candidate region includes a sample or a background, and the region relationship graph is used to indicate the spatial relationship between the candidate regions. The processing module is further configured to combine at least one candidate region of the sample, as indicated by the sample background label, to obtain the target sample; The processing module is also used to update the traffic target sample library based on the target sample.
[0006] Thirdly, embodiments of this application provide a display device, the display device comprising: a memory configured to store a computer program; and a processor configured to invoke the computer program, such that the display device implements the sample annotation method based on traffic scenarios as described in the first aspect.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium, including: storing a computer program on the computer-readable storage medium, wherein when the computer program is executed by a processor, it implements the sample annotation method based on traffic scenarios as described in the first aspect.
[0008] Fifthly, embodiments of this application provide a computer program product, including: when the computer program product is run on a computer, causing the computer to implement the sample annotation method based on traffic scenarios as described in the first aspect.
[0009] The technical solution provided in this application has the following advantages compared with the prior art: It acquires the image to be processed on the target road segment; determines the deviation features of the target road segment based on the image features and reference visual features of the image to be processed, wherein the reference visual features are visual features extracted from the video of the target road segment that can indicate the daily state of the road, excluding the target sample to be labeled; divides the image to be processed into multiple candidate regions based on the deviation features and image features; determines the first similarity between the candidate region and the first sample in the traffic target sample library, and the second similarity between the candidate region and the second sample in the traffic target sample library, wherein the first sample is a positive sample related to the target sample, and the positive sample is a sample identical to the target sample; the second sample... The initial sample is a negative sample related to the target sample, which is a pre-labeled, easily confused sample related to the target sample. Based on the first similarity, the second similarity, and the consistency score among multiple pre-stored samples related to the target sample in the traffic target sample library, the scene matching score corresponding to each candidate region is determined. Based on the scene matching score and the region relationship graph corresponding to the candidate region, each candidate region is labeled separately, and the sample background label corresponding to the candidate region is determined. The sample background label is used to indicate that the candidate region includes the sample or the background, and the region relationship graph is used to indicate the spatial relationship between the candidate regions. The candidate regions that are indicated by the sample background label to include the sample are combined to obtain the target sample. Based on the target sample, the traffic target sample library is updated. In this scheme, the baseline visual features can be pre-constructed based on the target road segment, which can avoid the influence of some fixed easily confused objects on the road on subsequent sample labeling and reduce scene differences. Then, based on some pre-stored samples related to the required sample in the traffic target sample library, sample matching can be performed on each region in the current image. Finally, combined with the spatial relationship between the candidate regions, the target sample in the image is labeled, thereby completing the image sample labeling. This does not require a large amount of sample data and effectively improves the efficiency and accuracy of the entire sample labeling. Attached Figure Description
[0010] To more clearly illustrate the implementation methods in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0011] Figure 1 This paper illustrates the flowchart of a sample annotation method based on a traffic scenario provided in an embodiment of this application. Figure 1 ; Figure 2 This paper illustrates the flowchart of a sample annotation method based on a traffic scenario provided in an embodiment of this application. Figure 2; Figure 3 The diagram shows a structural diagram of a sample annotation system based on a traffic scenario provided in an embodiment of this application; Figure 4 A structural diagram of a sample annotation device based on a traffic scenario provided in an embodiment of this application is shown; Figure 5 A structural diagram of a display device provided in an embodiment of this application is shown. Detailed Implementation
[0012] To better understand the above-mentioned objectives, features, and advantages of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features of this application can be combined with each other. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0013] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0014] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0015] The terms “comprising” and “having”, and any variations thereof, in this application are intended to cover but not exclude inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.
[0016] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0017] Traffic segmentation data is a crucial foundation for training models related to road target recognition, traffic event analysis, road facility inspection, and traffic state understanding. Compared to ordinary images, traffic-related images have several distinct characteristics: camera positions are usually fixed, but the viewing angle, focal length, and installation height of cameras at different intersections vary; road surfaces, markings, guardrails, and shadows within the camera's field of view tend to occupy fixed positions for extended periods; pixel sizes of objects at different distances vary significantly; daytime, nighttime, rain, snow, and backlighting cause significant changes in appearance; and many objects requiring recognition are temporary, rare, or highly localized, such as fallen objects, overturned non-motorized vehicles, construction barriers, special cones, accumulated water, damaged areas, and specific support vehicles.
[0018] To better train the model, the target in the image needs to be segmented. Traditional solutions usually involve re-collecting a large number of images, manually annotating them, and then training the model. The model can only be applied after it has passed evaluation. This whole process is inefficient for some rare targets. When new targets are added, the above process needs to be repeated. The cost of adding fixed-category models is high, and for targets that only appear at a few intersections, the investment and usage cycle do not match. When migrating to new scenes, the model also needs to be retrained or fine-tuned, resulting in high maintenance costs and a lack of low-cost scene adaptation.
[0019] Furthermore, for small samples, matching is often based solely on appearance similarity; however, targets can easily be confused with lane markings, road stains, shadows, reflections, or vehicles of the same color. The same target viewed from different cameras can also exhibit significant scale differences due to variations in perspective and resolution.
[0020] Traffic data often comes from video. If each frame is processed separately, the mask is prone to flickering, edge jumping, or temporary disappearance, which not only affects subsequent statistics but also reduces the reliability of automatic labeling. The results of a single image are not stable enough.
[0021] Current automatic labeling tools typically only output a mask, which cannot indicate whether the label is supported by multiple samples, whether the boundary is clear, whether it is stable across frames, or whether the road location is reasonable. They also cannot clearly indicate which results can be directly included in the training set and which results need to be manually reviewed, lacking clear quality results.
[0022] Therefore, a technical solution is needed that starts with a small number of samples, fully utilizes unlabeled data of the target scene and road structure information, and can stably segment across cameras and directly generate quality-level labels. In this solution, a reusable traffic target sample library can be established; a scene benchmark can be established using unlabeled images from the current scene, and regions under different cameras can be converted into relative road positions and perspective scales; based on this, target masks can be generated by combining positive and negative sample matching, regional spatial relationships, and video temporal consistency; finally, segmentation labels can be output according to quality level, either for direct storage or awaiting manual review.
[0023] It should be noted that this application addresses the problems of low-sample, long-tailed targets and cross-scene transfer in traffic vision. Suppose we already have some data on a certain target object at other intersections, such as fallen cardboard boxes, tires, irregularly shaped construction facilities, or localized water accumulation. However, when moving to a new intersection with a new camera, the existing model may not be directly usable due to differences in road surface color, camera angle, lighting, and weather. Re-collecting a large amount of image data and re-outlining each image to train a model for the current scene would be very costly. Therefore, this solution aims to utilize: a small number of existing samples, an unlabeled ordinary video clip from the new scene, and optional road structure information; to automatically generate pixel-level segmentation labels for targets in the new traffic scene without relabeling a large amount of data or retraining the entire model. The final result can be used primarily in two directions: rapidly generating high-quality training data, and performing low-cost, rapid transfer analysis on new intersections and new targets. Furthermore, this approach can also be applied before retraining the model. It is conceivable that a large number of images are needed as samples when training the model, and the images need to be labeled with objects so that the model can learn the recognition rules of objects in the images. Therefore, this approach can also be used to label objects in images of new traffic scenarios, and the results obtained by this approach can be used to train the model.
[0024] like Figure 1 As shown, Figure 1 A flowchart of a sample annotation method based on a traffic scenario provided in this application embodiment, the method may include the following steps: 101. Obtain the image to be processed on the target road segment.
[0025] In this embodiment of the application, the target road segment can be a newly added traffic scene. It can be understood that there is currently no pre-trained traffic segmentation model to identify the target objects on the target road segment. The existing models are not familiar with the target road segment and cannot accurately identify the target objects on the target road segment. Therefore, the image to be processed on the target road segment can be obtained. The image to be processed can be any frame image in the traffic video captured by the camera located on the target road segment. The number of images to be processed is not limited and can be multiple frames.
[0026] 102. Based on the image features of the image to be processed and the baseline visual features of the target road segment, the image to be processed is divided into multiple candidate regions.
[0027] In this embodiment of the application, the field of view of the camera in the traffic scene is usually wide, so the image to be processed may be large. If the entire image to be processed is processed, some details may be ignored. However, if each pixel is processed separately, the workload is huge, and the target object includes many pixels, making it impossible to accurately extract the complete sample. Therefore, the entire image to be processed can be divided into multiple candidate regions, and each candidate region can be treated as a whole and processed separately.
[0028] It should be noted that when dividing the image to be processed, it is not strictly divided according to the image pixel size. Instead, it is divided according to the image features of the image to be processed. Since the purpose of dividing candidate regions is to better identify the targets included therein, the baseline visual features of the target road segment can also be referenced. The baseline visual features can be understood as what the target road segment should look like. That is, the visual features included when there are no targets on the target road segment. Based on this, the difference between the image features of the image to be processed and the baseline visual features of the target road segment can reflect the targets present in the target road segment. Therefore, the image to be processed can be divided into multiple candidate regions based on the image features of the image to be processed and the baseline visual features of the target road segment.
[0029] It should be noted that the image features of the image to be processed can be multi-layered dense features extracted by a general pre-trained visual network that is frozen or substantially frozen. These dense features can include color boundaries, texture boundaries, deep feature boundaries, and road structure boundaries, etc.
[0030] The pre-trained visual network can be a commonly used visual encoder. This pre-trained visual network can convert each image location into visual features that the machine can compare, and convert information such as color, texture, shape, and semantics into a string of values.
[0031] In some embodiments, when dividing candidate regions, the division can be carried out by the original image color boundary; texture boundary; model feature change boundary; road, lane, curb boundary, etc., and specific algorithms such as superpixel, watershed, and region growing can be used for division.
[0032] 103. Based on multiple pre-stored samples related to the target sample to be labeled in the traffic target sample library, determine the scene matching score corresponding to each candidate region.
[0033] In this embodiment of the application, after dividing the candidate regions into multiple candidate regions, it is necessary to determine whether each candidate region includes a target object. At this time, a pre-built traffic target sample library can be used. The traffic target sample library stores sample images of various objects. The traffic target sample library may also include the target sample that needs to be labeled. Therefore, the candidate regions can be matched with the pre-stored samples in the traffic target sample library to determine the scene matching score corresponding to each candidate region.
[0034] It should be noted that the target sample is the target object that needs to be labeled in this scheme. The target sample can be a static target on the target road segment or a moving target. Theoretically, it is more suitable for traffic targets with few samples, large morphological changes, or temporary additions, such as: road debris, such as cardboard boxes, tires, plastic bags, and fallen bicycles; temporary construction facilities, such as cones, water-filled barriers, and fences; road surface water, oil stains, and damage; special vehicles or regional vehicle types; it can also be extended to moving targets such as vehicles and pedestrians.
[0035] It's important to note that this traffic target sample library is used to uniformly store reusable target knowledge. Instead of using a single image as a one-time input, it organizes samples from multiple sources, different environments, and varying levels of difficulty into a sustainably maintainable data asset. Each sample record includes at least a reference image and the target region, and may also include: positive sample regions and their annotation methods, such as pixel masks, polygons, boxes, points, or manual correction records; easily confused negative samples, such as shadows, road markings, reflections, vehicles of the same color, normal road surfaces, and historical false alarms; the sample source scene, shooting time, lighting, and weather labels; whether the target is a stationary object, a moving object, or a region state; the road areas where the target typically appears and its reasonable scale range; sample quality, creator, version, and usage history, etc. When there is only one positive sample, negative samples can be automatically supplemented from the surrounding ring area, normal frames at the same intersection, and historical false alarms. When multiple samples exist, they can be grouped by viewpoint, weather, and sharpness to prevent a single low-quality sample from having an excessive impact on the entire scene. Specific pre-stored samples can come from: data from other intersections that have been marked in historical projects; data accumulated at the current intersection; data obtained by mobile data collection devices; a small number of images that are temporarily taken and marked by humans; and new samples that are manually reviewed and confirmed after the system is running.
[0036] 104. Based on the scene matching score and the regional relationship graph corresponding to the candidate region, determine the target samples included in the candidate region.
[0037] In this embodiment of the application, after the scene matching score is determined, since the scene matching score can indicate whether the candidate region and the target sample are similar, even if some candidate regions are determined to be similar, there may be the influence of environmental factors, or a complete sample may be divided into multiple candidate regions. Therefore, it is also necessary to combine the spatial relationship between candidate regions, i.e., the region relationship diagram, to jointly determine the target sample included in the candidate region. The region relationship diagram can be used to indicate the spatial relationship between candidate regions.
[0038] It should be noted that in traffic scenarios, to avoid missing any real boundaries, the entire image to be processed might be divided into relatively small segments when segmenting candidate regions. For example, a complete cardboard box might be divided into 6 segments, or the shadow area of a billboard might be divided into 8 segments. As a result, after obtaining the scene matching score for each candidate region, different candidate regions will correspond to different judgment results due to their scene matching scores. This could lead to a situation where some candidate regions included in a complete object are judged as the target, while other candidate regions are judged as the background, which may result in omissions and ultimately fail to obtain a complete sample. Therefore, by considering the spatial relationships between candidate regions, related candidate regions can be combined. For example, adjacent candidate regions with similar features and no strong boundaries can be connected and considered as a complete region.
[0039] Conversely, some candidate regions may look quite similar to the target sample. When judging the similarity of each candidate region individually, it is easy to be mistaken for the target sample. Therefore, we can also compare the candidate region with other candidate regions around it, or judge whether the shape of the candidate region matches, or whether the location of the candidate region is reasonable, etc. In this way, we can further extract the candidate regions that are indeed the target samples.
[0040] In addition, cameras capture video in traffic scenes, but various transient interferences may appear in a single frame, such as: compression noise (color blocks generated by video encoding); momentary reflections (car headlights, glass reflections); shadows of birds / fallen leaves; brief occlusions (a car speeding by); these interferences may look very similar to the target sample in a certain frame and have a high scene matching score in the current frame, but they do not appear in the previous and next frames. Therefore, the images of the previous and next frames can be used together for judgment.
[0041] In summary, the target samples included in the candidate regions can be determined by combining the scene matching score and the regional relationship graph corresponding to the candidate regions.
[0042] 105. Update the traffic target sample library based on the target samples.
[0043] In this embodiment of the application, after obtaining the target sample, the target sample can be stored in the traffic target sample library to update the traffic target sample library.
[0044] In some embodiments, the model of the target road segment can also be trained using the image to be processed and the target sample. The trained model can then recognize images captured by subsequent cameras, thereby identifying the target samples that subsequently appear on the target road segment.
[0045] This application discloses a traffic scene-based sample annotation method. The method involves acquiring an image to be processed on a target road segment; dividing the image into multiple candidate regions based on image features and baseline visual features of the target road segment; determining a scene matching score for each candidate region based on multiple pre-stored samples related to the target sample in the traffic target sample library; identifying the target sample included in the candidate region based on the scene matching score and the corresponding region relationship graph, where the region relationship graph indicates the spatial relationship between candidate regions; and updating the traffic target sample library based on the target samples. In this scheme, baseline visual features can be pre-constructed based on the target road segment, which avoids the influence of easily confused objects on subsequent sample annotation and reduces scene differences. Then, based on some pre-stored samples related to the required sample in the traffic target sample library, sample matching is performed on each region of the current image. Finally, combining the spatial relationship between candidate regions, the target samples present in the image are annotated, thus completing the image sample annotation. This method does not require a large amount of sample data, effectively improving the efficiency and accuracy of the entire sample annotation process.
[0046] like Figure 2 As shown, Figure 2 Another flowchart of a sample annotation method based on a traffic scenario provided in this application embodiment, the method may include the following steps: 201. Obtain the image to be processed on the target road segment.
[0047] In this embodiment, the description of step 201 is the same as the detailed description of step 101 in the above embodiments, and will not be repeated in this embodiment.
[0048] 202. Obtain the scene baseline video of the target road segment.
[0049] In this embodiment, the scene reference video can be an unlabeled video captured by a camera on the target road segment. The label can be understood as the manually labeled information of the target sample, mainly the pixel-level segmentation mask. That is to say, the scene reference video does not need to be labeled in advance with which pixels are target samples, which pixels belong to the background, where the sample outline is, etc., and can directly retrieve a video of a period of time captured by the camera. The duration of the scene reference video can be set by yourself and is not specifically limited.
[0050] 203. Extract features from the scene baseline video to obtain the baseline visual features of the target road segment.
[0051] In this embodiment of the application, the baseline visual features can be understood as what the target road segment itself looks like, that is, the fixed outline of fixed objects in the road segment. For example, if the target road segment is a crossroads, then what do the curbs at the four corners look like, what do the lane lines on the road look like, what do the traffic lights look like, etc. The baseline visual features can be obtained by feature extraction from the scene baseline video.
[0052] In some embodiments, after acquiring the scene reference video, some normal frames can be selected for feature extraction. These normal frames can be understood as reference frames where the target sample of interest does not exist, and the road conditions represent the daily state of that location. For example, if we want to identify a cardboard box fallen on the road, the normal frames can include normally moving cars and pedestrians, as long as the cardboard box is not present. By statistically analyzing a large number of normal frames, we can determine the normal visual state of the middle of the second lane of this road segment under normal circumstances.
[0053] In some embodiments, the road surface color, road marking shape, camera exposure, and installation angle vary greatly at different intersections. This invention does not require retraining the complete model; instead, it first establishes a local scene baseline using unlabeled, normal images readily available from the target camera.
[0054] 204. Based on the image features of the image to be processed and the baseline visual features, determine the deviation features of the target road segment.
[0055] In this embodiment of the application, since the candidate region can be understood as the region that may include the target sample, when dividing the candidate region, it is necessary to first see which regions are different from the road segment itself. This means that these regions contain things that do not belong to the road segment, which may be the target sample. Therefore, the image features of the image to be processed can be compared with the baseline visual features to determine the deviation features of the target road segment. The deviation features can be the scene normalization features obtained after normalization processing.
[0056] In some embodiments, the current scenario is The functional areas of the road are The image features of the current region are The robust center of this region is determined by statistical analysis of normal images. and fluctuation scale The scene normalization features are obtained as follows:
[0057] in, To prevent small values with a denominator of zero, simply put, first subtract "what this road segment or area usually looks like," then determine if the remaining changes are similar to the target sample. Robust centers and fluctuation scales can be obtained from the median, truncated mean, absolute deviation, sample cohorts, or multiple cluster centers. The resulting scene normalization feature reflects "how significantly this area deviates from its normal state." Changes within normal fluctuations are removed, while only suddenly appearing cardboard boxes leave a significant anomalous signal.
[0058] For example, 100 targetless reference frame images were acquired for the middle area of the second lane at the intersection. Feature extraction was performed on these images, outputting a visual feature vector. This can be simply understood as follows: the first vector element describes some texture information of the area; the second vector element describes some shape information of the area; ... the 100th vector element describes other visual features of the area. Thus, 100 sets of feature vectors are obtained for the same road location.
[0059] The robust center can represent the most typical characteristics of this road area under normal circumstances. Specifically, it can be obtained by taking the median of each dimension of 100 feature vectors, or by using methods such as geometric median or cluster centers. In simpler terms, it represents what this road area typically looks like.
[0060] The fluctuation scale can be expressed as: how much this road will fluctuate under normal circumstances, even without any target. For example, cloudy days, sunny days, and compressed noise will cause slight changes in the characteristics. It can be calculated using standard deviation, median absolute deviation, interquartile range, etc. In simple terms, it means: how much normal variation this road surface is allowed to undergo under normal circumstances.
[0061] Suppose a region appears in the current image, and its characteristics are: We won't look directly at it. Instead of the original value itself, subtract the following: That is, subtract "what this position is normally like". Then divide by: That is, to consider "how much natural fluctuation this location usually experiences".
[0062] 205. Based on the deviation characteristics and image features, the image to be processed is divided into multiple candidate regions.
[0063] In this embodiment of the application, after obtaining the deviation features, if the deviation is only a little within a reasonable range, it may be caused by factors such as image error. However, if the deviation is large, it indicates that there is a suddenly appearing object in this area, which may be the target sample. Therefore, the image can be divided according to the deviation features. In addition, the boundary features indicated by the image features of the image to be processed can also be combined for division, thereby obtaining multiple candidate regions.
[0064] In some embodiments, after obtaining candidate regions, each candidate region can be mapped back to the original image to be processed to determine the position coordinates of the candidate region in the image to be processed. The road relative coordinate system and perspective scale conversion relationship of the target scene can be established in advance to correspond a certain position in the image to the relative position in the road. Then, the candidate region is brought in to convert the position of the candidate region in the image into the relative lateral position in the lane, the relative longitudinal position along the road direction, and the perspective-corrected relative scale, so that the target under different cameras can be compared in a more uniform road coordinate system, and determine the candidate region's location in which lane, its approximate distance from the camera, its relative size after perspective correction, and other similar region description information.
[0065] In some embodiments, for road structure normalization, the center point of the candidate region is mapped to road relative coordinates via camera calibration or road polygon mapping:
[0066] in, Indicates the relative position along the road direction. Indicates the relative position in the direction of lane width. This indicates the relative scale after perspective correction. Even if the pixel coordinates of two cameras are completely different, their road descriptions can still be compared as long as the targets are located in similar road positions and have a reasonable scale.
[0067] The final candidate region description can be composed of scene-normalized visual features, road relative coordinates, shape, and boundary information:
[0068] in, The description of the boundary and shape can include the area of the candidate region, aspect ratio, perimeter, compactness, boundary strength, whether it coincides with the road edge, etc., which can be directly calculated from the contour of the candidate region and the edge of the image to be processed; Optional motion descriptions can include the average optical flow of the candidate region, the displacement between preceding and following frames, the direction of motion, the duration of consecutive occurrences, and the overlap rate of adjacent frame regions. If the image to be processed has only one frame, then... It can be zero. , and For weights.
[0069] It should be noted that when precise camera calibration is unavailable, approximate road coordinates can be obtained using artificial road regions, lane polygons, vanishing point estimation, or layered grids. Typically, the most affected element is the precise longitudinal position of the road. Perspective scale However, approximate values can still be obtained using lane lines, road polygons, vanishing points, and far, middle, and near partitions. If road information is completely missing, the system degenerates to using only scene baselines and visual features, but the label quality level is correspondingly reduced. This set of road space descriptions will become unusable or have very low reliability. At this point, the road-related weights can be set to 0, and segmentation can continue based solely on visual features, positive and negative samples, scene benchmarks, video temporal sequences, etc., but the final label quality evaluation will be more conservative.
[0070] 206. Determine the first similarity between the candidate region and the first sample in the traffic target sample library, and the second similarity between the candidate region and the second sample in the traffic target sample library.
[0071] In this embodiment, after obtaining multiple candidate regions, it is necessary to determine whether each candidate region contains a target sample or is merely a background image. This requires using pre-stored samples from a pre-built traffic target sample library as a reference. Since it is necessary to determine whether a target sample exists in the candidate region, the traffic target sample library must store at least some positive samples related to the target sample. In other words, it can store images of the target sample that have appeared in other locations previously. Of course, in actual road scenarios, there may be confusion caused by road surfaces, shadows, and markings. Therefore, the traffic target sample library can also store some easily confused negative samples related to the target sample, such as manhole covers with colors similar to cardboard boxes, road shadows, yellow or brown lane markings, road stains, and other areas historically misidentified as cardboard boxes. These negative samples can be pre-selected manually. For example, before model deployment, it is well known that shadows are prone to false positives, so some shadowed areas are marked as negative samples. The second type is "difficult negative sample mining" after model operation. For example, if a manhole cover was previously mistaken for a cardboard box, and this result was deleted during manual review, then this manhole cover can be stored as a negative sample in the traffic target sample library.
[0072] It should be noted that if a target sample does exist in the candidate region, then theoretically the candidate region should have a high similarity to the positive sample and a certain similarity to the negative sample, but this similarity will not be higher than that with the positive sample. If the object in the candidate region has a high similarity to both the positive and negative samples, then it is necessary to further carefully distinguish whether it is the target sample or the object indicated by a negative sample that is similar to the target sample and easily confused. If the candidate region does not contain a target sample and is only a road background image, then theoretically the candidate region should have a low similarity to the positive sample and a high similarity to the negative sample. Therefore, the first similarity between the candidate region and the first sample in the traffic target sample library, and the second similarity between the candidate region and the second sample in the traffic target sample library can be calculated separately, where the first sample is the positive sample related to the target sample, and the second sample is the negative sample related to the target sample.
[0073] 207. Based on the first similarity, the second similarity, and the consistency score among multiple pre-stored samples, determine the scene matching score corresponding to each candidate region.
[0074] In this embodiment, after obtaining the first similarity and the second similarity, the scene matching score of the candidate region can be further calculated. However, it is conceivable that the similarity is the similarity between the candidate region and each individual sample. But individual samples have a certain degree of randomness. The candidate region may just happen to be similar to a certain sample. If it is not similar to other samples, it cannot be directly said that the candidate region includes this sample. In addition, the pre-stored samples in the traffic target sample library may not be comprehensive. For example, if there are a lot of samples of a certain type, it may also be biased by special samples and the correct target sample may be identified as the background. Therefore, in addition to similarity, the consistency score between the pre-stored samples in the traffic target sample library can also be determined to jointly calculate the scene matching score corresponding to the candidate region.
[0075] It should be noted that the consistency among pre-stored samples does not only depend on whether a single sample gives a high similarity score, but rather checks at least one of the following relationships: whether multiple positive samples from different scenes or times jointly support the candidate region; whether the sample group that best matches the candidate region also lists the candidate region as the main response region; whether the conclusions of the candidate region in multi-layer visual features are consistent; whether positive support is significantly higher than that of negative samples and the normal background of the target scene; and whether the position, scale, and shape of the candidate region conform to the allowable range in the sample library.
[0076] To determine the consistency score, positive samples can be divided into several groups based on factors such as source scenario, weather, time, and clarity. The number of groups that "support" the candidate region is considered "supported." If at least one sample in each group has a similarity exceeding a threshold, that group is considered supported. For example, a traffic target sample library contains five cardboard box samples from: intersection A during the day, intersection A at night, intersection B during the day, intersection B in the rain, and intersection D during the day. These are divided into groups based on different scenarios. If the current candidate region is not only similar to the cardboard box at intersection A but also supported by cardboard box samples from intersections B and D, then the credibility is higher. It can be determined whether at least one sample in each sample group has a similarity exceeding the threshold. For example, if four sample groups receive the following similarities: support, support, support, and no support, then the consistency score can be recorded as 3 / 4 = 0.75. Multiple sample groups supporting the candidate region result in a higher consistency score, leading to a higher scenario matching score; conversely, only a few samples supporting it result in a lower consistency score, reducing the scenario matching score and preventing a single, accidental match from dominating the final judgment.
[0077] Based on this, by combining the first similarity score, the second similarity score, and the consistency score, the scene matching score corresponding to each candidate region can be determined, which can be specifically expressed as:
[0078] in, This refers to scene matching score. That is, the i-th candidate region. It is a set of positive samples. It is a set of negative samples. This is the consistency score. It can be calculated using cosine similarity, correlation coefficient, or learning distance. and For weights.
[0079] In summary, positive samples can be divided into one or more sample groups according to different scenarios, times, or environmental conditions, and the matching degree between the candidate region and each positive sample group can be calculated separately. When multiple sample groups provide effective support for the candidate region, the consistency score of the multi-sample group support for that candidate region is increased; when only a single sample generates a high similarity, while other sample groups do not support it, the impact of this accidental match on the final result is reduced. Furthermore, a graded judgment can be made based on the overall matching score of the candidate region, the difference in similarity between positive and negative samples, and the consistency of support among multiple sample groups: regions with sufficient evidence are judged as targets, and regions with a clear dominance of negative samples are judged as background; regions with scores close to the threshold, similar conclusions between positive and negative samples, or only receiving support from some sample groups are marked as uncertain candidates and submitted for further confirmation by subsequent spatiotemporal regional reasoning or manual review.
[0080] 208. Based on the scene matching score and the regional relationship graph corresponding to the candidate region, determine the sample background label corresponding to the candidate region.
[0081] In this embodiment of the application, after obtaining the scene matching score of the candidate region, a region relationship graph can be established based on the adjacent relationship in the same frame, image boundary, road boundary and the correspondence between previous and subsequent frames, etc., and the relevant regions around the high-confidence candidate can be jointly judged. This can be used to complete the target that has been divided into multiple small blocks, suppress isolated false alarms, and keep the results stable.
[0082] It should be noted that the region relationship map corresponding to the candidate region can be used to indicate the following relationships: spatial relationships between adjacent regions in the same frame that are visually, texturally, or motionally similar. Specifically, it can determine whether two regions are adjacent, have borders that touch, have similar visual features, or have no obvious strong boundary in between. For example, if a cardboard box is divided into four regions, and these four regions are adjacent and visually similar, then it is more likely to merge the four regions; road structure relationships that are suppressed when crossing lane boundaries, curbs, or strong image boundaries. Specifically, it can determine the relationship between two regions in the road, including whether the two regions are located in the same lane, cross lane edges, cross curbs, or whether the position and scale relationship is reasonable. For example, if one region is located in the lane and another adjacent region has crossed into the area of an overhead billboard, then it cannot be merged; temporal relationships between consecutive frames of the video obtained by optical flow, region overlap, feature correspondence, or target trajectory. Specifically, it can determine whether a certain region in the previous frame and a certain region in the next frame include the same target. Correspondence can be established through optical flow, region overlap, feature similarity, target trajectory, etc. For example, if a cardboard box on the road appears in a similar position in five consecutive frames, then these regions are related to each other.
[0083] In some embodiments, based on scene matching scores and region relationship graphs, all candidate regions can be jointly solved using the following formula:
[0084] in, The score is determined by the matching score of the candidate region and the rationality of the road. For spatial relationships within the same frame, This refers to the temporal relationship across frames; and This indicates the degree to which two regions should maintain the same label. Here, i and j represent the numbers of any two candidate regions; they simply indicate two different candidate regions, without specifically specifying which two candidate regions they are. and This is the weight value for the corresponding item, and this weight value can be dynamically adjusted.
[0085] It should be noted that after solving the above formula, we can determine whether each candidate region includes the target sample or belongs to the background image, and assign a sample / background label to each. This sample / background label can be used to indicate whether the candidate region includes the sample or the background. Specifically, A value of 1 indicates that the candidate region includes the target sample. =0 indicates that the candidate region is the background image.
[0086] It should be noted that in the above formula, This represents the cost, for each candidate region itself, of determining whether the current candidate region is the target sample and the cost of determining whether it belongs to the background, without considering its correlation with other candidate regions. This indicates the cost required to identify a sample as a target sample (the higher the scene matching score, the lower the cost). This indicates the cost of classifying a region as background (the lower the scene matching score, the lower the cost). Specifically, after obtaining the scene matching score, a penalty can be applied to the road rationality of the candidate region. If the location and perspective scale of the candidate region fall within the range of reasonable roads recorded in the sample library, the road rationality penalty will be low; conversely, if the candidate region appears in a road area that is highly unlikely to appear in the target sample, a larger value can be assigned to the road rationality penalty. At this point, a binary output function can be constructed by fusing the scene matching score and the road rationality penalty, and the values can be determined separately for each road rationality penalty. Cost when =0 ,as well as Cost when =1 For example, the confidence score is determined by the difference between the scene matching score and the road rationality penalty. The higher the confidence score, the more likely the candidate region is to be the target sample. The value of is relatively large. A smaller confidence score indicates that the candidate region is more likely to be labeled with a sample label; the smaller the confidence score, the more the candidate region resembles the background. The value of is relatively large. If the value is small, the candidate region will be given a background label first.
[0087] It should be noted that, This indicates a spatial relationship penalty, meaning that if two strongly related regions, as indicated by the regional relationship map, are judged to have different labels, a certain cost will be incurred and points will be deducted. This indicates a time relationship penalty, meaning that if two corresponding regions in consecutive frames are judged to have different labels according to the region relationship diagram, a certain cost will be incurred and points will be deducted.
[0088] Therefore, when solving the above formulas together, it is necessary to ensure that the total cost is... To find the minimum, we need to find a set of sample background labels y1, y2, ..., yn (each region takes the value 0 or 1), and then calculate the result by substituting them into the formula above. Minimize. The solution can be achieved through methods such as graph cut, random walk, belief propagation, dynamic programming, message passing, or other joint methods. Specifically, a set of sample background labels can be randomly generated first, and the corresponding initial total cost can be calculated. Then, the background labels of the samples corresponding to each candidate region are adjusted sequentially, and the adjusted total cost is compared with the initial total cost. Based on the comparison results, the background labels of any candidate samples are continuously adjusted until the total cost is found. The minimum solution is used to determine the final sample background labels y1, y2, ..., yn.
[0089] In summary, the spatiotemporal joint solution process can recombine regions belonging to the same target but divided into multiple small blocks by boundaries, and can also remove isolated high-resolution regions that appear only in one frame and have no surrounding support. For batch annotation of static images, temporal relationships can be omitted, and only spatial and road structure relationships are used.
[0090] 209. Combine the sample background label indications that include at least one candidate region of the sample to obtain the target sample.
[0091] In this embodiment of the application, after obtaining the sample background label corresponding to each candidate region, at least one candidate region whose sample background label indicates includes the sample can be extracted, that is, these candidate regions =1 indicates that these candidate regions are likely to include the target sample. Therefore, combining at least one candidate region will yield the target sample.
[0092] In some embodiments, the above steps only perform sample judgment on candidate regions to determine that some candidate regions are likely to contain target samples, but not necessarily the entire candidate region. In addition, the boundary clarity, temporal stability, and road location rationality of each candidate region are different, which will affect the subsequent usability of the target samples included in the candidate regions. Therefore, the target samples included in the candidate regions can be quality rated. Specifically, the sample background label indicates that at least one candidate region containing the sample is combined to obtain the target sample. This can include: combining the sample background label indicates that at least one candidate region containing the sample is combined to obtain the candidate sample; determining the quality level corresponding to the candidate sample based on the mapping relationship between the candidate sample and the image to be processed and the image features of the image to be processed; and performing a sample labeling strategy corresponding to the quality level on the candidate sample according to the quality level to obtain the target sample.
[0093] It should be noted that the candidate samples can be obtained by first combining the sample background label indications including at least one candidate region of the sample. Then, the candidate samples are mapped back to the original image to be processed. The boundaries are refined by using high-resolution edges and information from previous and next frames. The labels are divided into three quality levels: high, medium and low, based on a comprehensive consideration of cross-sample matching consistency, boundary clarity, temporal stability, road location rationality and uncertainty. Different processing strategies are applied to different quality levels.
[0094] It should be noted that boundary refinement can be achieved using original image edges, high-resolution shallow features, guided filtering, conditional random fields, morphological processing, or interactive segmentation models. This refinement process can be performed near the target sample in the candidate region, resulting in a pixel-level segmentation mask with finer boundaries that better matches the real target contour. However, during this process, if the highest candidate score is insufficient, multiple sample conclusions conflict, the result fails the road location check, or the non-empty solution is not significantly better than the empty solution, it can be determined that no target sample exists, and an empty mask is output.
[0095] Furthermore, when determining the quality level of candidate samples, the rating can be based on the quality score corresponding to the candidate samples. This quality score can be obtained by weighting factors such as multi-sample matching consistency, boundary clarity, temporal stability, road location and scale rationality, and uncertainty, and can be specifically expressed as follows:
[0096] in, For multi-sample matching consistency, it indicates how many groups of samples support the result and what the difference between positive and negative samples is. For edge sharpness, it indicates whether the refined edge is sharp and fits the edge of the original image. For time stability, it indicates whether the occurrence is continuous across frames and whether the position and shape are stable; To determine the reasonableness of road location and scale, it indicates whether the road is within a reasonable range of lanes, distances, and dimensions. The uncertainty represents the degree of sample conflict, boundary ambiguity, and the degree to which a match approaches a threshold. , , , and The weight can be determined based on validation data, historical project experience, web search, cross-validation, etc., and is not specifically limited.
[0097] In some embodiments, when determining the quality level of a candidate sample, in addition to comparing the quality score and a threshold, it can also be determined whether the candidate sample meets the following conditions: the sample matching score is not lower than the minimum threshold; the uncertainty does not exceed the upper limit; when video is available, the temporal stability is not lower than the minimum value; when road information is available, the road location is not obviously illegal; and the non-empty target solution is significantly better than the non-target solution. Therefore, when the quality score is greater than or equal to the first threshold and meets the above conditions, the quality level of the candidate sample can be determined as the first quality level, i.e., a high-quality sample; when the quality score is less than the first threshold but greater than or equal to the second threshold, the quality level of the candidate sample can be determined as the second quality level, i.e., a medium-quality sample; when the quality score is less than the second threshold or does not meet the above conditions, the quality level of the candidate sample can be determined as the third quality level, i.e., a low-quality sample. The first quality level is higher than the second quality level, and the second quality level is higher than the third quality level.
[0098] Furthermore, according to the quality level, the candidate samples are labeled with a sample labeling strategy corresponding to the quality level to obtain the target samples. Specifically, this may include: when the quality level is the first quality level, the candidate samples are determined as target samples; when the quality level is the second quality level, the candidate samples are output to the user, and the user feedback verification results are received, indicating that the verification passed candidate samples are determined as target samples; when the quality level is the third quality level, the candidate samples are deleted.
[0099] It should be noted that if the quality level of a candidate sample is first-level, it can be basically determined that this candidate sample is the target sample we need to label, so it can be directly identified as the target sample. If the quality level of a candidate sample is second-level, it means that it is not yet possible to accurately determine whether the candidate sample is the target sample. Therefore, manual verification is required. The candidate sample can be output to the user for staff to verify and provide feedback on the verification results. If the staff's verification result indicates that the verification passed, then it can be said that this candidate sample is the target sample to be labeled, and it can be identified as the target sample. However, if the staff's verification result indicates that the verification failed, then it means that this candidate sample is not the target sample to be labeled, and it can be discarded. In addition, if the quality level of a candidate sample is third-level, it can be said that this candidate sample is not the target sample, and it can be directly discarded.
[0100] 210. Update the traffic target sample library based on the target samples.
[0101] In this embodiment of the application, after classifying the quality levels as described above and implementing different processing strategies, it can be considered that only samples with a quality level of the first quality level (i.e., high-quality samples) and samples with a quality level of the second quality level (i.e., medium-quality samples), and samples that have passed manual review and verification, can be stored in the traffic target sample library to update the traffic target sample library.
[0102] In some embodiments, in conjunction with the above steps, different processing methods can be applied to different input scenarios and abnormal conditions. Examples may include the following scenarios: Table 1 Overall processing strategies under different input conditions and abnormal states.
[0103] In some embodiments, taking the example of "a city has accumulated a small number of pixel-level samples of cardboard boxes, tires, fallen non-motorized vehicles, and other debris at intersection A, and wants to quickly generate similar labels in historical videos from intersection B to intersection H for training a new obstacle analysis model," the following steps can be taken: Obstacles identified at intersection A can be used as positive samples, while shadows, road markings, manhole covers, road stains, and vehicles of the same color can be used as negative samples, and written into a traffic target sample library. Then, for each new intersection, a video segment without events is extracted, and scene benchmarks are established according to lane and shoulder areas, without the need for manual frame-by-frame annotation. The candidate areas of each intersection are mapped to their relative positions within the lanes, and the target scale is corrected according to perspective. The positive and negative sample matching scores are calculated, and high-confidence areas supported by multiple samples are selected. Temporal relationships are established in continuous videos, and reflections and compression noise that only appear in one frame are removed. Boundaries are refined, and label quality is calculated. High-quality results are directly entered into the library, while medium-quality results are quickly confirmed by the annotator or by dragging local boundaries. Newly confirmed targets and false alarms are supplemented as positive and negative samples, respectively, and subsequent intersection processing does not require retraining the complete model.
[0104] Figure 3 This is a schematic diagram illustrating the structure of a traffic scenario-based sample annotation system according to an embodiment of this application, as shown below. Figure 3As shown, this traffic scene-based sample annotation system may include: a traffic target sample library module, used to store positive target samples, easily confused negative samples, sample sources, applicable environments, target motion forms, and road location ranges, with each target corresponding to one or more sample records; a scene access and road structure module, used to access images or videos of target intersections and obtain road structures such as lanes, curbs, stop lines, shoulders, and pedestrian areas, which can be manually drawn, imported from maps, or automatically estimated; a scene baseline feature module, used to statistically analyze common features of different road areas under different lighting or weather conditions from unlabeled normal images of target cameras, eliminating local background and camera style differences; and a visual feature and candidate region module, used to extract dense features from a general pre-trained visual network and combine them with images. The boundary and road boundaries divide the image into several candidate regions; the cross-scene consistency matching module is used to calculate the matching degree between candidate regions and targets based on positive samples, negative samples, road relative positions and scale relationships, and to filter high-confidence candidate regions; the spatiotemporal region inference module is used to connect adjacent candidate regions in a single frame and connect corresponding regions in consecutive frames in the video to jointly obtain a complete and stable target mask; the boundary refinement and label quality evaluation module is used to correct target boundaries, determine the existence of targets, and calculate label quality levels by comprehensively considering matching, boundary, time and road structure information; the dataset output and manual review module is used to directly write high-quality labels into the dataset, generate manual review tasks for medium-quality labels, reject or resample low-quality results, and manually corrected results can be written back to the sample library.
[0105] The main inputs of this traffic scene-based sample annotation system include: a small number of traffic samples with target regions, optional easily confused negative samples, unlabeled images or videos of the target scene, and optional road structure information. The main outputs of the traffic scene-based sample annotation system include: pixel-level masks, instance numbers, confidence scores, label quality levels, sample and algorithm version sources, and data files available for training or analysis.
[0106] Figure 4 This is a schematic diagram of the structure of a sample annotation device based on a traffic scenario, as shown in an embodiment of this application. Figure 4 As shown, the sample annotation device based on traffic scenarios includes: The acquisition module 401 is used to acquire the image to be processed on the target road segment; The processing module 402 is used to divide the image to be processed into multiple candidate regions based on the image features of the image to be processed and the baseline visual features of the target road segment. The processing module 402 is also used to determine the scene matching score corresponding to each candidate region based on multiple pre-stored samples related to the target sample to be labeled in the traffic target sample library. The processing module 402 is also used to determine the target samples included in the candidate regions based on the scene matching score and the region relationship graph corresponding to the candidate regions. The region relationship graph is used to indicate the spatial relationship between the candidate regions. The processing module 402 is also used to update the traffic target sample library based on the target sample.
[0107] In some embodiments, the acquisition module 401 is further configured to acquire a scene reference video of the target road segment; The processing module 402 is also used to extract features from the scene reference video to obtain the reference visual features of the target road segment.
[0108] In some embodiments, the processing module 402 is specifically used to determine the deviation characteristics of the target road segment based on the image features of the image to be processed and the reference visual features; The processing module 402 is specifically used to divide the image to be processed into multiple candidate regions based on the deviation features and image features.
[0109] In some embodiments, the processing module 402 is specifically used to determine the first similarity between the candidate region and the first sample in the traffic target sample library, and the second similarity between the candidate region and the second sample in the traffic target sample library, wherein the first sample is a positive sample related to the target sample and the second sample is a negative sample related to the target sample. The processing module 402 is specifically used to determine the scene matching score corresponding to each candidate region based on the first similarity, the second similarity, and the consistency score among multiple pre-stored samples.
[0110] In some embodiments, the processing module 402 is specifically used to determine the sample background label corresponding to the candidate region based on the scene matching score and the region relationship graph corresponding to the candidate region. The sample background label is used to indicate that the candidate region includes a sample or a background. The processing module 402 is specifically used to combine at least one candidate region of the sample, which is indicated by the sample background label, to obtain the target sample.
[0111] In some embodiments, the processing module 402 is specifically configured to combine at least one candidate region including the sample from the sample background label indication to obtain a candidate sample; Processing module 402 is specifically used to determine the quality level of the candidate sample based on the mapping relationship between the candidate sample and the image to be processed and the image features of the image to be processed; The processing module 402 is specifically used to execute a sample labeling strategy corresponding to the quality level on the candidate samples according to the quality level, so as to obtain the target samples.
[0112] In some embodiments, the processing module 402 is specifically used to determine the candidate sample as the target sample when the quality level is the first quality level; The processing module 402 is specifically used to output candidate samples to the user when the quality level is the second quality level, and to receive the verification result fed back by the user, and to determine the candidate sample that has passed the verification as the target sample. The processing module 402 is specifically used to delete candidate samples when the quality level is the third quality level, where the first quality level is higher than the second quality level, and the second quality level is higher than the third quality level.
[0113] For a description of the features in the embodiment of the traffic scenario-based sample annotation device, please refer to the relevant description of the embodiment of the traffic scenario-based sample annotation method, which will not be repeated here.
[0114] like Figure 5 As shown, this application embodiment also provides a display device, which includes a memory 501 storing a computer program; a processor 502 connected to the memory 501; wherein the processor 502 calls the computer program stored in the memory 501 to execute the traffic scene-based sample annotation method executed by the traffic scene-based sample annotation device in the above method embodiments.
[0115] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements each process of the above-described traffic scenario-based sample annotation method and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0116] This application provides a computer program product, including: when the computer program product is run on a computer, it enables the computer to implement the above-described sample annotation method based on traffic scenarios.
[0117] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0118] It should be understood, in the several embodiments provided in this application, that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0119] In this application, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0120] In this application, memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0121] In this application, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, including permanent and non-permanent, removable and non-removable storage media. The storage medium can implement information storage by any method or technology, and the information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), other types of random access memory (RAM), read-only memory (ROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information that can be accessed by a computing device. As defined in this document, computer-readable media do not include transient media, such as modulated data signals and carrier waves.
[0122] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0123] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application. The above-mentioned multiple embodiments are not necessarily multiple independent embodiments; they are divided into multiple embodiments only to highlight different technical features in different embodiments. Those skilled in the art should understand that the above-mentioned multiple embodiments can also be combined arbitrarily.
[0124] In the various embodiments of this application, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0125] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they can be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0126] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0127] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-accessible memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several requests to cause a computer device (which can be a personal computer, server, or network device, specifically a processor in the computer device) to execute some or all of the steps of the methods described in each embodiment of this application.
[0128] The above are merely specific embodiments of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A sample annotation method based on traffic scenarios, characterized in that, include: Acquire the image to be processed on the target road segment; Based on the image features of the image to be processed and the baseline visual features, the deviation features of the target road segment are determined. The baseline visual features are visual features that can indicate the daily state of the road, other than the target sample to be labeled, that are extracted from the video of the target road segment. Based on the deviation features and the image features, the image to be processed is divided into multiple candidate regions; The first similarity between the candidate region and the first sample in the traffic target sample library, and the second similarity between the candidate region and the second sample in the traffic target sample library are determined respectively. The first sample is a positive sample related to the target sample, and the positive sample is a sample that is the same as the target sample. The second sample is a negative sample related to the target sample, and the negative sample is a pre-labeled easily confused sample related to the target sample. Based on the first similarity, the second similarity, and the consistency score among multiple pre-stored samples related to the target sample in the traffic target sample library, the scene matching score corresponding to each candidate region is determined; Based on the scene matching score and the region relationship graph corresponding to the candidate region, each candidate region is labeled with samples to determine the sample background label corresponding to the candidate region. The sample background label is used to indicate that the candidate region includes a sample or a background, and the region relationship graph is used to indicate the spatial relationship between the candidate regions. The target sample is obtained by combining at least one candidate region of the sample indicated by the sample background label. The traffic target sample library is updated based on the target sample.
2. The sample annotation method based on traffic scenarios according to claim 1, characterized in that, Before determining the deviation features of the target road segment based on the image features of the image to be processed and the reference visual features, the method further includes: Obtain the scene reference video of the target road segment; Feature extraction is performed on the baseline video of the scene to obtain the baseline visual features of the target road segment.
3. The sample annotation method based on traffic scenarios according to claim 1, characterized in that, The step of combining at least one candidate region of the sample, indicated by the sample background label, to obtain the target sample includes: The candidate samples are obtained by combining the at least one candidate region of the sample indicated by the sample background label; Based on the mapping relationship between the candidate samples and the image to be processed, as well as the image features of the image to be processed, the quality level corresponding to the candidate samples is determined; According to the quality level, the candidate samples are labeled with a sample labeling strategy corresponding to the quality level to obtain the target samples.
4. The sample annotation method based on traffic scenarios according to claim 3, characterized in that, The step of executing a sample labeling strategy corresponding to the quality level on the candidate samples according to the quality level to obtain the target samples includes: When the quality level is the first quality level, the candidate sample is determined as the target sample; When the quality level is the second quality level, the candidate sample is output to the user, and the verification result fed back by the user is received. The candidate sample that passes the verification is identified as the target sample. When the quality level is the third quality level, the candidate sample is deleted. The first quality level is higher than the second quality level, and the second quality level is higher than the third quality level.
5. A sample annotation device based on traffic scenarios, characterized in that, include: The acquisition module is used to acquire the image to be processed on the target road segment; The processing module is used to determine the deviation features of the target road segment based on the image features of the image to be processed and the reference visual features. The reference visual features are visual features that can indicate the daily state of the road, other than the target sample to be labeled, that are extracted from the video of the target road segment. The processing module is further configured to divide the image to be processed into multiple candidate regions based on the deviation features and the image features; The processing module is further configured to determine a first similarity between the candidate region and a first sample in the traffic target sample library, and a second similarity between the candidate region and a second sample in the traffic target sample library, wherein the first sample is a positive sample related to the target sample, the positive sample is a sample that is the same as the target sample, and the second sample is a negative sample related to the target sample, the negative sample is a pre-labeled easily confused sample related to the target sample; The processing module is further configured to determine the scene matching score corresponding to each candidate region based on the first similarity, the second similarity, and the consistency score among multiple pre-stored samples related to the target sample in the traffic target sample library; The processing module is further configured to perform sample annotation on each candidate region based on the scene matching score and the region relationship graph corresponding to the candidate region, and determine the sample background label corresponding to the candidate region. The sample background label is used to indicate that the candidate region includes a sample or a background, and the region relationship graph is used to indicate the spatial relationship between the candidate regions. The processing module is further configured to combine at least one candidate region of the sample, as indicated by the sample background label, to obtain the target sample; The processing module is also used to update the traffic target sample library based on the target sample.
6. A display device, characterized in that, include: Memory, configured to store computer programs; The processor is configured to invoke the computer program, causing the display device to implement the traffic scene-based sample annotation method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, include: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the sample annotation method based on a traffic scenario as described in any one of claims 1 to 4.
