Know Your Pills: A Pill Shape Classifier

Vaidheeswaran Archana -

Vaidheeswaran Archana -

Chennai, Tamil Nadu

6 0
  • 0 Collaborators

Pill Shape Classifier can be used in industrial belts to help classify pills on their shapes. This can further increase the speed and help to decrease human errors. Pill segregation can also be domestically used by older adults to help identify their medicines. This project was made using the UP Embedded Vision Starter Kit. ...learn more

Project status: Published/In Market

Internet of Things, Artificial Intelligence

Intel Technologies
Other

Code Samples [1]

Overview / Usage

Pill Shape Classifier can be used in industrial belts to help classify pills on their shapes. This can further increase the speed and help to decrease human errors. Pill segregation can also be domestically used by older adults to help identify their medicines. This project was made using the UP Embedded Vision Starter Kit.

Methodology / Approach

Data:
The data for this project was collected from the Pillbox dataset. The link for this can be found here.(https://pillbox.nlm.nih.gov/developer.html#data)

From this dataset, we separated the pills into 5 classes: Capsule, Oval, Oblong, Round and Other. The separated dataset which is the one that was used for this project can be found here

This is a new dataset that was built for this project. We believe that this dataset can be used also for learning about Deep Learning as it is simple and yet complex enough due to class imbalances to be challenging. You can find out more information about this dataset here(https://github.com/ArchanaIyer1996/medicine_shape_data)

Technologies Used

Neural Network

Since the neural network is meant to be run on an embedded or Edge device, the neural network model chosen was one built specifically for Edge devices: Xception.

You can train the neural network here. You can specify whether how many epochs you want to train for, where to save the model and how many times to fine tune to model using command line arguments.

A sample training code would be like this:

python3 xception_transfer.py --nb_epoch 1 --batch_size 16 --model models/model.h5
You can then perform classification on the model by using the classification script here. Run it using the following command:

python3 classify_pills.py

Requirements

This project requires python3.6. While you can train on a GPU or any other machine, for performing inference, you will need the UP Vision Embedded Kit. Other package requirements are in the requirements file.

his project was made using the UP Board Embedded Vision Starter Kit. It consisted of UP Board, Basler Camera and an Adapter of 5 V.

UP Board: UP Board has the provision of running and installing an Ubuntu OS. This helps in easily running and deploying machine learning and deep learning models

Basler Camera: The Basler Camera runs on the Pylon Software which can be easily installed. There is also a provision for taking multiple consecutive images on the software which helps in creating the appropriate test data.

Applications

  1. Industrial Applications: This particular project can be used on the industrial floor of pharmaceutical industries. The entire embedded vision starter kit consisting of the Basler camera to take pictures with the UP board microcontroller can be used to help identify the shapes of the pills and further segregate them. The Basler camera can be installed on an industrial belt and this can further help to increase speed, consecutively reducing errors.

  2. Domestic Applications: This project can also be used for identifying pills for older adults. Older people take medicines quotidianly. And due to their health complications sometimes accompanied with reduced vision, can cause them to misidentify pills. A pill identifier can help reduce such fatal errors. Therefore, combining this pill shape identifier with a software application can help them distinguish medicines.

Further Work
There can be further work be done in creating a mobile application along with the board giving users a better interface for pill segregation.

Repository

https://github.com/ArchanaIyer1996/pill_shape_classifier

Comments (0)