Git Product home page Git Product logo

product-matching-with-shelf-images-using-yolov4-following-product-recognition-using-resnet50v2's Introduction

Product-Matching

Matching givewn product in the shelf

Problem Statement

The problem statement here is to detect product images from a shelf of goods in a super market. The shelf may contain 100 product categories. So, we are asked to execute the detection or product matching task in two ways

  • case 1: If aproduct image is given, we need to locate the products inside the shelfimage
  • case 2: If shelfimage is given to the system, the system should detect list of known products present in the shelf

More detailed and elaborated problem statement an be found here - Product Detection from Packshots

Dataset

The dataset contains 3153 shelf images, and 300 product images corresponding to 100 different categories containing 3 images for each of the individual caregory.

Approach

  1. For Object Detection we have used Yolov4-P5 trained on grocery-shelf images data previously, where the image size is 896
  2. The next part is product matching, where we trained a classification model using transfer learning on Resnet50V2 trained on 'imagenet', where we added one softmax layer
  3. For fine-tuning the model and due to very less training data, we freezed the resnet50v2, and trained only softmax conatining 209,400 trainable parameters only.
  4. To handle lack of training data used data augmentations. For data augmentation we use image-augmentor module, where we utilized the following functionalities-
  • Auto-contrast
  • Auto-sharpness
  • Auto-rotate(-10 to +10 deg)
  • Auto-enhance color
  • Auto equalize hist

1st apply all on ooriginal image, then applied all on rotated image, so we obtain 10 augmented samples, total samples after augmentation from 300 to 3600.

  1. The train, validation split used is (valid+test) ratio 0.1665, so train contains 3400, i.e 34 images for each class, and valid and test are split with 50% split ratio. Thus, test and valid contain single image.
  2. Traained the model for 10 epochs, with LR= 1e-04, batch_size = 16, and got good accuracy on test set.
  3. After the classifier is trained, we fetched the detection result for shelf images.
  4. After detection is done, traversed through each bounding box, cropped those and pass to classififcation model, the classifier predicts the product id out of it.

Implementation

  • The detailed implementation can be found in the colab notebook here.
  • The model weights, predictions, solution text files can be found from drive here.
  • Solution text files can be found here

Reference

product-matching-with-shelf-images-using-yolov4-following-product-recognition-using-resnet50v2's People

Contributors

sayan0506 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mramanindia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.