CutMix Augmentation for Object Detection

CutMix Augmentation for Object Detection

When building a computer vision model, sometimes, we get an F1-score accuracy that is not good enough. Then, we decide to do some optimization algorithms to search for optimum hyperparameters to improve our accuracy. However, sometimes our accuracy doesn't improve significantly. We may ask, is it because of our model?

The answer is not always. Many sources can cause the model to be unable to learn from the images we give. Imbalanced class instances can be a problem. Imagine we have to develop a model that can classify multiple classes of ripeness of fruits, the proportion of unripe fruits may be larger than the proportion of ripe fruits, therefore, the number of fruits classified is imbalanced between ripe and unripe. How to solve this?

Image copyright ? RadiaX AI Consulting

The solution is augmentation. Augmentation is a technique to reproduce images by manipulating the images. We can do an augmentation technique called "CutMix". CutMix is a technique to selectively cut the object by its bounding boxes at the pixel level, remove it from the image, and add it to another image. If we have 90 instances of class ripe and only 10 instances of class unripe, by CutMix, we can have a balanced 50-50 instances for both classes. CutMix can be done algorithmically. Below are examples of datasets after CutMix implementation on oil palm fruits on trees.

Image copyright ? RadiaX AI Consulting

Besides, we can make use of photo editing tools such as Adobe Photoshop to do CutMix manually. We have a collection of cropped oil palm fruits with different levels of ripeness that we scraped from a website image repository.

The following process is to add these cropped objects on other images to introduce the addition of the minority class instances to our training datasets. Below are examples of images before and after CutMix implementation. We cannot almost notice the differences between the added objects and the original objects. To make good quality CutMix images, we need to try several editing parameters such as image blending to blend the objects with the background to make them look real.

Image copyright ? RadiaX AI Consulting

There is a significant improvement in Precision, Recall, and Mean Average Precision at 50% Confidence Level (mAP50) between training without augmented images with CutMix and training with augmented images with CutMix. Below is a summary of the results.

Image copyright ? RadiaX AI Consulting

We can see that CutMix augmentation increases the performance of the model to better generalize on minority class instances.


Yohanes Nuwara - Founder & CEO of RadiaX AI Consulting

To see more of our services, visit our website: https://radiax.godaddysites.com/

Bagas Pramana Putra Fadhila

Tsinghua & TaiwanICDF Embedded AI + IoT ? We provide scalable clean heating solutions for sustainable food and fuel!

1 年

Cool practical technique!

回复

要查看或添加评论,请登录

Yohanes Nuwara的更多文章

  • MLP (Keras) Optimizers for Discrete Problems

    MLP (Keras) Optimizers for Discrete Problems

    Optimization problem occurs every time in our daily life. In engineering, optimization is widely in many setup and it…

    10 条评论
  • Training Kolmogorov-Arnold Network (KAN) for Lithology Classification

    Training Kolmogorov-Arnold Network (KAN) for Lithology Classification

    We may have heard about the ground-breaking new type of neural network called Kolmogorov-Arnold Network (KAN), which is…

    11 条评论
  • Well Placement Optimization using Python PyMRST

    Well Placement Optimization using Python PyMRST

    Well placement optimization is one of the most challenging and expensive problems in the oil and gas industry. Well…

    1 条评论
  • Tutorial: Reservoir Simulation with Python PyMRST

    Tutorial: Reservoir Simulation with Python PyMRST

    Can you name the best reservoir simulator in the world? Perhaps ECLIPSE, CMG IMEX, Nexus, and so on. You may have heard…

    31 条评论
  • Big Data & AI in Indonesian Healthcare Services

    Big Data & AI in Indonesian Healthcare Services

    Artificial Intelligence (AI) has become a transformative force in the field of healthcare, offering numerous benefits…

    7 条评论
  • ChatGPT for Sustainability

    ChatGPT for Sustainability

    The use of ChatGPT in the corporate world is becoming popular nowadays. It helps people work more productively and…

    5 条评论
  • Unlocking the Value of AI in Precision Forestry

    Unlocking the Value of AI in Precision Forestry

    We use forest products every day, for example paper products. Paper products come from wood fiber as its raw material…

    3 条评论
  • PDA Series #2 Facies Classification from Well Logs

    PDA Series #2 Facies Classification from Well Logs

    In the second series, we will discuss the application of supervised learning ML for the classification of lithofacies…

    2 条评论
  • PDA Series #1 Recovering Missing Sonic Logs

    PDA Series #1 Recovering Missing Sonic Logs

    In the first series, we will discuss the application of supervised learning ML for recovering missing sonic logs. PDA…

    10 条评论
  • Digital Transformation in the Context of G20 Collaboration

    Digital Transformation in the Context of G20 Collaboration

    The digital transformation is a BIG revolution in many aspects. There is no reason any enterprise is not going digital.