Instance-aware repetition factor sampling method for unbalanced data in object detection

Through the instance-aware repeated factor sampling method, the number of instances of the image and bounding box is considered to generate more accurate category weights, which solves the problem of rare category information not being captured in the existing technology and improves the detection performance of the model under long-tail distribution. .

CN118691869APending Publication Date: 2024-09-24ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410334150.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-24
Filing Date
2024-03-22
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

When existing repeated factor sampling methods deal with class imbalance in images, the information of rare classes may not be fully captured, resulting in bias and poor performance during the training process.

Method used

The instance-aware repeated factor sampling (I-RFS) method is proposed to generate more accurate category weights by considering the number of instances of images and bounding boxes, ensuring that rare categories receive appropriate attention during the training process.

Benefits of technology

It effectively solves the problem of underutilization of rare category information in the repeated factor sampling method. The generated training set can better represent the majority and minority categories in the image, improving the detection performance of the model under long-tail distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691869A
    Figure CN118691869A
Patent Text Reader

Abstract

The invention provides an instance-aware repetition factor sampling method for unbalanced data in object detection. The invention discloses a method for processing long-tail distribution under the condition of data imbalance. The disclosed embodiments improve a repetition factor sampling method by considering both images and bounding boxes (i.e., instances) to generate an improved training data set. The disclosed embodiments may be used in the field of image analysis, such as object detection and classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to computer vision and image analysis, including detection and classification of objects in images. The disclosed embodiments can be used to generate improved training data sets for training classifiers. Background Art

[0002] Long-tail distribution of imbalanced data in class distribution is a problem in many real-world applications. For example, the long-tail distribution problem arises in computer vision fields such as image recognition, object detection, semantic segmentation, etc. Models (e.g., classifiers) may become biased towards the majority class (i.e., the class with many training samples) during training. It may become increasingly difficult to achieve good performance on the minority class (i.e., the class with few training samples). In order to properly utilize all available data and reduce overfitting to the majority class, it may be necessary to incorporate optimization strategies. Summary of the invention

[0003] There are two approaches for addressing the problems associated with the long-tail distribution in the training set. The first approach involves data augmentation using class-balanced sampling, and the second approach involves using a modified loss function.

[0004] Data augmentation using class-balanced sampling involves upsampling the minority class and downsampling the majority class through data augmentation. This approach may not properly exploit the available data representation of the majority class, and performance may be biased towards the augmented minority class. Utilizing long-tail instance balanced sampling and class-balanced sampling are solutions that can exploit the available data and achieve better performance on the minority class. However, in cases where there is a significant imbalance between the majority and minority classes, this approach may require much larger upsampling and downsampling ratios, which may not adequately represent the majority class and make training biased.

[0005] Modifying the loss function to handle the effects of large class imbalance involves adaptive weighting of classes in the loss function in an attempt to add more weight to the minority class predictions to handle class imbalance. However, this approach faces similar complexities in the case of large imbalances between classes. Grouping predictions and loss functions based on the available samples for each class is another promising solution. Despite considerable improvements in performance, large imbalances in the dataset may severely underrepresent the minority class that faces similar challenges since the optimization is performed on long-tail data in a single-stage training.

[0006] Some disclosed embodiments focus on class-balanced sampling to address the class imbalance problem in object detection. Some disclosed embodiments describe a method for sampling an image set to create a training image set for training a classifier, comprising: for each class c of an object to be classified by the classifier, generating a value f,c , which is the fraction of images in the image set that include at least one bounding box of category c; for each category c of objects to be classified by the classifier, generate a value f b,c , which is the score of the bounding box of category c in the image set; for each category c of the object to be classified by the classifier, the combination f i,c and f b,c To generate the value f c ; and according to the value f c The image set is sampled to generate a training image set. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 An example diagram of a representation of a set of images according to the disclosed embodiments is disclosed.

[0008] Figure 2 An example system for generating a training set according to disclosed embodiments is disclosed.

[0009] Figure 3 An example computing system in accordance with the disclosed embodiments is disclosed.

[0010] Figure 4 An example flow chart of a method according to a disclosed embodiment is disclosed. DETAILED DESCRIPTION

[0011] As required, detailed embodiments of the present invention are disclosed herein; however, it should be understood that the disclosed embodiments are merely exemplary of the present invention, which may be embodied in various and alternative forms. The drawings are not necessarily to scale; some features may be enlarged or minimized to show details of particular components. Therefore, the specific structural and functional details disclosed herein should not be interpreted as limiting, but merely as a representative basis for teaching those skilled in the art to adopt the present invention in different ways.

[0012] The disclosed embodiments may build upon or improve upon a sampling method known as Repeated Factor Sampling ("RFS"). RFS is an effective method for sampling balanced images when training object detection models. RFS increases the rate at which tail classes are observed by oversampling images containing the tail classes. This method can be applied to long-tail classification problems by repeating images containing rare classes in each epoch. However, RFS has drawbacks or issues associated with it.

[0013] Referring to RFS, for each category c, let f c is the fraction of training images that contain at least one instance of class c. Thus, the class-level repetition factor r c Defined as

[0014]

[0015] where t is a hyperparameter. Since each image can include multiple different categories, an image-level repetition factor r is defined i More formally, for each image i, the image-level repetition factor r i is defined as

[0016] r i =max c∈ ir c ,

[0017] where {c∈i} denotes the category present in image i. During training, each image is trained according to its repetition factor r i Repeat. The hyperparameter t is the threshold, which intuitively controls the point at which oversampling begins. For f c For the class ≥t, there is no oversampling.

[0018] The problem with RFS is that c May not be representative, especially if there is an imbalance between the number of images and the number of bounding boxes. Figure 1 can be used to further illustrate this issue. Figure 1 A diagram 100 is depicted including a representation of a set of images, each of which includes one or more objects that may be found at a construction site. Table 1 illustrates Figure 1 The distribution of images and bounding boxes in the image set disclosed in . For example, Table 1 shows that 839 images in the image set include at least one instance of a person. As shown in Table 1, there are 2219 images in the image set. Table 1 shows the distribution of f for each category. c For example, the ratio or score of images that include at least one instance of a person is 0.3781 (839 / 2219=0.3781). Figure 1 It shows that colored cones are the most frequent class in terms of instances. That is, colored cones have the highest number of bounding boxes (i.e., instances). However, as can be seen in Table 1, f c The ratio considers excavator as the most frequent class. Therefore, it depends only on the value of image f c Information about rare or less frequent classes is not fully captured, and there is a tendency to weight rare and frequent classes similarly, which conflicts with the purpose of RFS.

[0019] Table 1

[0020]

[0021]

[0022] To address these issues with RFS and ensure that rare categories are prioritized during the RFS process, embodiments of instance-aware RFS (“I-RFS”) that considers both images and bounding boxes are disclosed herein. Figure 2 , the disclosed embodiments may include a data store 210 and a computing system 220. The data store 210 may include an image collection 212, such as Figure 1 . In accordance with the disclosed embodiments, the data storage 210 may also include a training set 214 derived from the image set 212. The data storage 210 may be communicatively connected 230 to a computer system 220 in a manner that allows the computer system 220 to read data from the data storage 210 and write data to the data storage 210. The computer system 220 may include a sampler module 222 that includes processor-executable instructions. The computer system 220 may execute the processor-executable instructions in the sampler module 222 to perform the method of the disclosed embodiments of generating the training set 214. The computer system 220 may include a training module 224 that includes processor-executable instructions. The computer system 220 may execute the processor-executable instructions in the training module 224 to perform the method of the disclosed embodiments of training a classifier on the training set 214.

[0023] Figure 3 A block diagram of an example embodiment of a general purpose computer system 300 is shown. The general purpose computer system 300 may be used as Figure 2 The computer system 220 shown. The computer system 300 may include an instruction set that can be executed to cause the computer system 300 to perform any one or more methods or computer-based functions of the disclosed embodiments. For example, the computer system 300 may include executable instructions to perform the functions of the sampler module 222 or the training module 224. The computer system 300 may be connected to other computer systems or peripheral devices via a network. For example, the computer system 300 may be communicatively connected 230 to Figure 2 Data storage 210 is shown. In addition, computer system 300 may include or be included in other computing devices.

[0024] like Figure 3As shown, the computer system 300 may include one or more processors 302. The one or more processors 302 may include, for example, one or more central processing units ("CPUs"), one or more graphics processing units ("GPUs"), or both. The computer system 300 may include a main memory 304 and a static memory 306, which may communicate with each other via a bus 308. As shown, the computer system 300 may also include a video display unit 310, such as a liquid crystal display ("LCD"), a projection television display, a flat panel display, a plasma display, or a solid-state display. In addition, the computer system 300 may include an input device 312 (e.g., a remote control device with a wireless keypad, a keyboard, a microphone coupled to a speech recognition engine, a camera such as a video camera or a still camera) or a cursor control device 314 (such as a mouse device). The computer system 300 may also include a disk drive unit 316, a signal generating device 318 (e.g., a speaker), and a network interface device 320. The network interface 320 may enable the computer system 300 to communicate with other systems via a network 328. For example, network interface 320 may enable the machine learning system to communicate with a database server (not shown) or a controller (not shown) in a manufacturing system.

[0025] In some embodiments, Figure 3 As depicted, disk drive unit 316 may include one or more computer-readable media 322 in which one or more sets of instructions 324, such as software, may be embedded. For example, instructions 324 may embody one or more methods or functions, such as the methods or functions of the disclosed embodiments. In certain embodiments, instructions 324 may reside completely or at least partially within main memory 304, static memory 306, and / or processor 302 during execution by computer system 300. Main memory 304 and processor 302 may also include computer-readable media.

[0026] In some embodiments, dedicated hardware implementations (e.g., application specific integrated circuits, programmable logic arrays, and other hardware devices) may be constructed to implement one or more methods or functions described herein. Applications that may include the apparatus and systems of various embodiments may broadly include various electronic and computer systems. One or more embodiments described herein may use two or more specific interconnected hardware modules or devices to implement functions (with associated control and data signals that may be transmitted between or through these modules), or may implement functions as part of an application specific integrated circuit. Therefore, embodiments of the present system encompass software, firmware, and hardware implementations or combinations thereof.

[0027] Although the computer-readable medium is shown as a single medium, the term "computer-readable medium" includes a single medium or multiple media, such as a centralized or distributed database and / or associated caches and servers storing one or more instruction sets. The term "computer-readable medium" should also include any medium that can store or encode an instruction set that is executed by a processor or causes a computer system to perform any one or more methods or functions of the disclosed embodiments.

[0028] In some embodiments, some or all of the computer-readable media will be non-transitory media. In a specific non-limiting exemplary embodiment, the computer-readable medium may include a solid-state memory, such as a memory card or other package that accommodates one or more non-volatile read-only memories. In addition, the computer-readable medium may be a random access memory or other volatile rewritable memory. In addition, the computer-readable medium may include a magneto-optical or optical medium, such as a disk or tape or other storage device, to capture a carrier signal, such as a signal transmitted through a transmission medium.

[0029] Figure 4 An example method 400 according to the disclosed embodiments is disclosed. In some embodiments, the method 400 addresses the deficiencies in the above-described RFS by considering both the number of images that include a class and the number of bounding boxes corresponding to the class (i.e., instances of the class). The method 400 may be referred to herein as an instance-aware RFS ("I-RFS"). In some embodiments, the method 400 may be used for object detection with unbalanced data.

[0030] Method 400 begins at operation 402. In some embodiments, operation 402 includes performing any initialization that method 400 needs to perform. Such initialization may include loading all or part of an image set from a data store into memory, such as loading all or part of image set 212 from data store 210. The initialization performed by operation 402 may include initializing parameters, such as initializing the hyperparameter t discussed above. In some embodiments, t is 0, 0.1, 0.01, 0.001, or 0.0001.

[0031] After operation 402 is completed, two operations 404 and 406 are performed. Operations 404 and 406 may be performed sequentially or may be performed simultaneously. In operation 404, an image factor f may be generated for each category c of an object to be classified by the classifier. i,c , the classifier is trained using the training set generated by method 400. Image factor f i,c The fraction of images in the image set (e.g., image set 212) that include at least one bounding box (i.e., at least one instance) of category c may be indicated. In operation 406, a box factor f may be generated for each category c of an object to be classified by the classifier. b,c . Frame factor fb,c The scores of all bounding boxes corresponding to category c can be labeled.

[0032] In operation 408, a value f is generated for each category c of the object to be classified by the classifier. c In some embodiments, the image factor f of category c i,c and frame factor f b,c are combined to generate a value f for category c c In some embodiments, the image factor f is generated i,c and frame factor f b,c The average of the values ​​to produce the value f for category c c In some embodiments, the value f of category c c It can be a geometric mean generated by the following formula:

[0033]

[0034] In some embodiments, the value f of category c c It can be the arithmetic mean generated by the following formula:

[0035]

[0036] In some embodiments, the value f of category c c It can be a harmonic mean generated by the following formula:

[0037]

[0038] In some embodiments, the value f of category c c It can be the RMS value generated by the following formula:

[0039]

[0040] Table 2

[0041] category Number of images #Number of bounding boxes <![CDATA[f i,c ]]> <![CDATA[f b,c ]]> <![CDATA[f c ]]> people 839 1674 0.3781 0.0704 0.1631 Dump Truck 1001 1215 0.4511 0.0511 0.1518 Earth compactor 456 503 0.2055 0.0212 0.0656 excavator 1349 3145 0.6079 0.1323 0.2836 Sleepy person 665 748 0.2997 0.0315 0.0971 sprinkler 349 390 0.1573 0.0164 0.0508 vehicle 1178 3639 0.5309 0.1530 0.2850 pipeline 574 604 0.2587 0.0254 0.0811 Colored Cone 987 10872 0.4448 0.4571 0.4511 Rod 90 176 0.0406 0.0074 0.0173 Barrels 2 2 0.0009 0.00008 0.0003 dynamo 451 636 0.2032 0.0267 0.0737 Surveying and mapping equipment 116 176 0.0523 0.0074 0.0197 Total number of images 2219 Total number of bounding boxes 23780

[0042] Table 2 shows the image factor f for each of the 13 categories shown in Table 1. i,c and frame factor f b,c Table 2 also shows the f c value, which is the image factor f i,c and frame factor f b,c As shown in Table 2, Table 2 shows the geometric mean of f generated by the I-RFS method. c The value is different from the f generated for the non-instance-aware RFS method in Table 1. c In addition, the f c The value successfully marks the colored cone as the most frequent category, where the f in Table 1c The value indicates excavator as the most frequent category.

[0043] The f generated in operation 408 c The values ​​may be used to sample an image set (e.g., image set 212) to generate a training set (e.g., training set 214) useful for training a classifier. In operation 410, the values ​​used to generate f in operation 408 are sampled. c In some embodiments, the class-level repetition factor r can be generated for each class in a manner similar to the way the class-level repetition factor is generated in RFS. c For example, in some embodiments, by using f generated by the I-RFS method (eg, method 400) c The value replaces the f generated by the non-instance-aware RFS method c value, generating a category-level replication factor r for each category c c For example, operation 408 may use a geometric mean to generate f c value, and the category-level repeated factor can be generated for each category c according to the following formula:

[0044]

[0045] where r c is the class-level repetition factor for class c, and t is a hyperparameter that is a threshold that controls the start point of oversampling. In some embodiments, the value of t is selected from the set {0, 0.1, 0.01, 0.001, 0.0001}. In some embodiments of method 400, a t value of 0.001 achieves the best results.

[0046] In some embodiments, the image-level repetition factor r may be generated for each image i according to the following formula: i :

[0047] r i =max c∈i r c ,

[0048] where {c∈i} denotes the category present in image i. In some embodiments, if there are more objects from rare categories in the image, then r i For example, the image-level repetition factor r can be generated for each image i according to the following formula i :

[0049]

[0050] where {c∈i} denotes the category present in image i, and where a c is the number of instances of the least frequent class in image i.

[0051] In some embodiments, the image-level repetition factor r i Can be used to determine how many times an image was used when training a classifier. In some embodiments, r i The value of is rounded up to the next integer. For example, r i The value 2.1 or 2.7 will be rounded up to 3 to indicate that image i should be used 3 times when training the classifier. The generated training set (e.g., training set 214) can include copies of images to be used multiple times, or to save memory or storage space, the training set can include a single copy of each image along with the number of times the image should be used in training. For example, a training set can include the image set {i1,i2,i2,i2,i3,i3,…,i n} (i.e., 3 copies of image i2 and 2 copies of image i3). The same training set can be stored as a set of tuples, where each tuple is a copy of an image along with the number or number of times the image should be used during training. For example, the same training set can be stored as {(i1,1),(i2,3),(i3,2),…,(i n ,1)} to show that image i2 is used 3 times and image i3 is used 2 times.

[0052] Although exemplary embodiments are described above, this does not mean that these embodiments describe all possible forms of the present invention. On the contrary, the words used in the specification are descriptive words rather than restrictive words, and it should be understood that various changes can be made without departing from the spirit and scope of the present invention. In addition, the features of various implementation embodiments can be combined to form other embodiments of the present invention.

Claims

1. A method for sampling an image set to create a training image set for training a classifier, comprising: For each category c of the object to be classified by the classifier, generate a value f i,c , the value f i,c is the fraction of images in the image set that include at least one bounding box of class c; For each category c of the object to be classified by the classifier, generate a value f b,c , the value f b,c is the score of bounding boxes of category c in the image set; For each category c of the object to be classified by the classifier, the combination f ,c and f b,c To generate the value f c ; as well as According to the value f c The image set is sampled to generate a training image set.

2. The method according to claim 1, further comprising: Train the classifier on the training image set. The method of claim 1 , wherein each image in the image set is suitable for training a classifier.

4. The method according to claim 1, wherein the combined value f i,c and f b,c Including the generated value f i,c and f b,c The average value of .

5. The method according to claim 4, wherein the value f i,c and f b,c The mean is the root mean square value, arithmetic mean, geometric mean, or harmonic mean.

6. The method according to claim 4, wherein the value f i,c and f b,c The mean of is the harmonic mean.

7. The method of claim 1, wherein the training set comprises multiple copies of at least one image in the image set.

8. The method according to claim 1, further comprising: For each category c, according to the value f c Generate category-level repeated factors; as well as For each image i, according to the value f c Generate image-level repetition factor, The sampling of the image set is performed according to the category-level repetition factor and the image-level repetition factor.

9. The method according to claim 8, wherein the category-level repetition factor is generated according to the following formula: where r c is the class-level repetition factor for class c, and t is a hyperparameter that is the threshold that controls the starting point of oversampling.

10. The method of claim 9, wherein t is 0, 0.1, 0.01, 0.001 or 0.0001.

11. The method of claim 9, wherein the image level repetition factor is generated according to the following formula: r i =max c∈i r c , where r i is the image-level repetition factor of image i, and where {c∈i} denotes the categories present in image i.

12. The method of claim 9, wherein the image level repetition factor is generated according to the following formula: where r i is the image-level repetition factor of image i, and where {c∈i} denotes the class in image i, and Indicates the number of instances from category c in image i.

13. The method according to claim 1, further comprising: For each category c, according to the value f c Generate category-level repeated factors, where the category-level repeated factors are generated according to the following formula: where r c is the class-level repetition factor for class c, and t is a hyperparameter that is a threshold that controls the start point of oversampling; as well as For each image i, according to the value f c Generate an image-level repetition factor, where the image-level repetition factor is generated according to the following formula: r i =max c∈i r c , where r i is the image-level repetition factor of image i, and where {c∈i} denotes the categories present in image i, where the sampling of the image set is performed according to a class-level repetition factor and an image-level repetition factor, and The training set includes multiple copies of at least one image in the image set.

14. The method according to claim 12, wherein the combined value f i,c and f b,c Including the generated value f i,c and f b,c The average value of .

15. The method of claim 12, wherein the training set comprises multiple copies of at least one image in the image set.

16. A non-transitory memory comprising processor-executable instructions that, when executed by one or more processors, cause a system to perform operations for sampling a set of images to create a training set of images for training a classifier, the operations comprising: For each category c of the object to be classified by the classifier, generate a value f i,c , the value f i,c is the fraction of images in the image set that include at least one bounding box of class c; For each category c of the object to be classified by the classifier, generate a value f b,c , the value f b,c is the score of bounding boxes of category c in the image set; For each category c of the object to be classified by the classifier, the combination f i,c and f b,c To generate the value f c ; as well as According to the value f c The image set is sampled to generate a training image set.

17. The non-transitory memory of claim 16, wherein the training set comprises multiple copies of at least one image in the set of images.

18. The non-transitory memory of claim 16, wherein the operations further comprise: Train the classifier on the training image set.

19. A system comprising: one or more processors; as well as A memory communicatively coupled to the one or more processors, the memory comprising processor-executable instructions that, when executed by the one or more processors, cause the system to perform operations for sampling a set of images to create a training set of images for training a classifier, the operations comprising: For each category c of the object to be classified by the classifier, generate a value f i,c , the value f i,c is the fraction of images in the image set that include at least one bounding box of class c; For each category c of the object to be classified by the classifier, generate a value f b,c , the value f b,c is the score of bounding boxes of category c in the image set; For each category c of the object to be classified by the classifier, generate a value f c , the value f c is the value f i,c and f b,c The average value of For each category c, according to the value f c Generate category-level repeated factors, where the category-level repeated factors are generated according to the following formula: where r c is the class-level repetition factor for class c, and t is a hyperparameter that is a threshold that controls the start point of oversampling; For each image i, according to the value f c Generate an image-level repetition factor, where the image-level repetition factor is generated according to the following formula: r i =max c∈i r c , where r i is the image-level repetition factor for image i, where {c∈i} denotes the categories present in image i, and where a c is the number of instances of the least frequent class in image i; and The image set is sampled according to the category-level repetition factor and the image-level repetition factor to generate a training set, wherein the training set includes multiple copies of at least one image in the image set.

20. The system of claim 19, wherein the operations further comprise: Train the classifier on the training image set.