How I made an autonomous robot that can help you get your online orders faster

Automation has been the main trend over the last few years. And now, with the ever growing demand for e-commerce,and Amazon handling 5.76 million orders every single day (in the US alone!), the supply chain industry is facing a new optimization problem.

Sorting is an important step in the delivery process and traditionally, this process is carried out manually by hand. A simple Google search for “Package Sorting Jobs” will show you thousands of companies recruiting manpower for this task. Needless to say, manual sorting by hand is slow, inefficient and leads to delays. In a fast paced industry like Supply Chain, every minute of delay leads to loss of revenue for the company.

Source : “UPS’s $20 Billion Problem: Operations Stuck in the 20th Century

Thus, companies are looking for a faster, more efficient and more reliable system. This problem can be solved using Machine Learning.

So, during the Coronavirus Lockdown, with no access to electronics and hardware shops, I decided to make my own “automated sorting machine” using whatever scrap materials I could find at home. The machine is capable of sorting packages into different categories according to their final destination.

This video shows the functioning of the project.

How It Works!

  • A camera is placed above the conveyor belt.
  • The camera sends a snapshot of the parcel to the computer.
  • The computer processes the input and runs a Deep Learning algorithm (Faster RCNN) on the image.
  • The Deep Learning model determines the appropriate destination for the package and automatically sorts it.

The Technical Stuff

  • I used Tensorflow Object Detection API to train a deep learning model based on Faster RCNN Architecture.
Faster RCNN Architecture
  • I trained it on my own dataset by clicking hundreds of photos of the packages to be sorted.
  • After training the model using Tensorflow Object Detection API, OpenCV performs the task of classification using the inference graph and labelmap generated during training.

photo by author — Classification of packages by the Deep Learning Model
  • This is how the model classifies the packages.
  • Once identified, the algorithm sends a signal to the Arduino microcontroller.
  • The microcontroller signals the appropriate servo motor to swoop in and sort the package to its desired destination.


In order to increase speed, efficiency, reduce reliance on manual labor and maximize profit margins, industries are looking to automate every single step involved in the supply chain. As the world becomes increasingly reliant on online services, Robots, Self Driving Trucks, Augmented Reality, Warehouse Automation, are just some of the futuristic technologies which are going to change the face E-Commerce as we know it.


Tensorflow Object Detection API

Deep Learning for Supply Chain Optimization | Using Automated Robots to Sort Packages was originally published in Towards Data Science on Medium, where people are continuing the conversation by highlighting and responding to this story.