Closed JIA-HONG-CHU closed 3 years ago
Hi @JIA-HONG-CHU. Thanks for your interest. The goal is to split the dataset (ADE in our case) into different splits, one for each subset of classes. However, in ADE neither the overlapped or disjoint protocol can be employed due to too many cooccurrences.
In this script, we divided the dataset following this algorithm. We iterate on every image of the dataset and we: 1) we compute how many images are available for a certain class. 2) we compute how many images we already assigned to that class and we compute a ratio added/available. 3) we compute a score for each class which represents the importance of assigning that image to the class. 4) we assign the image to the max scoring class and we update the sets.
Overall, the idea is that we should divide images to maintain enough images for each class. Let make an example to explain this: assume to have a class A in step 1 (let say bird) that is contained in few images (e.g. 100) and another class B in step 0 (person) that is contained in many (e.g. 1000). Assume also that in all images of A there's also B (so, in every image where bird is contained there's also person). If when dividing the dataset we randomly split the images, the resulting split may include all the A class images in the step 0 (since they also contain class B), and none of A in the step 1 (thus, we will have NO annotation for it in the whole training). Differently, our heuristic assigns the images based on the number of images and how many images are left. Doing so, when encountering an image containing both class A and B, we will assign it in step 1, enabling us to learn it properly.
I hope that I gave you the general idea. If you aimed for a different answer, please let me know. Best.
Tks for reply. After I read your code, my idea is that the number of newly added category photos of this incremental training step cannot be less than 50% of the total number of photos in that category or less than 100 photos (Except for the fact that there are very few photos in this category) . Is it also right?
Well, this is not enforced by the algorithm. The line you see there was just a check that we had enough images in each step... Ideally, you want to assign more than 50% of the images and more than 100 images, but there may be cases where it is not possible. In our case, if I remember correctly (sorry, but already 2 years had passed) we manually discarded such splits.
Thank you for your reply. I will close this issue.
Hello,I want to ask about the logic of cutting data, how a photo puts it on the incremental learning steps. Sorry to bother you.Tks.