Получи случайную криптовалюту за регистрацию!

You've never solved Object Detection this way This weekends I | Sergak's blog

You've never solved Object Detection this way

This weekends I wrote a selection stage of student olympiad "Я Профессионал" from Yandex. There were 5 tasks for each type: math, sport programming and ML. And one of ML was about Instance Object Detection .

There were 10k pictures with three types of bills: 100, 500 and 1000 rubles and you had to predict how much money on the image (for example, if there are 1x1000, 3x500 and 2x100, you should predict 2700) . And original solution was, I guess, to run Instance Object Detection, find how many bills of each cash type are on the image and then just compute a result. But it was just a selection stage, so why should I spent so much time on it?

After looking into the dataset , I understood that it was synthetic and there are only six types of images with different bills, which are combined in the pictures with whiter background. So, I decided to try a simpler one solution, instead of object detection.

Let's for each image just count number of pixels with a certain colors and then train three CatBoostRegressors, which will predict number of bills for each type. To save memory I reduced number of different colors , dividing them by 10 and after that also removed those colors, which didn't appear in the datasets. To speed up calculating (simple python code took about an hour to calculate this for all images) I rewrote them on numba.jit and then it took only 2 minutes .

Finally, I got MAE about 0.25 for each bill type and 7.9/10 points of score in the checking system . So, sometimes it can be very useful to try non-standard approaches, which can help you not only save time, but maybe even reach a higher score (I think, that even if I had tried an original solution it would have got a lower score).