1
School of Informatics and Computing, Indiana University Bloomington Charlene Tay and Mridul Birla Pharmaceutical Pill Recognition Using Computer Vision Techniques Introduction Unidentified and misidentifiedprescription pills present challenges for patientsand professionals. Taking such pillscan result in adverse drug reactions that affect healthor couldeven cause death. By coming up with ways toeasily identify and verify prescription pills, errors canbe greatly reduced. Our goal is to produce a framework or set of methods that will take a consumer-quality image of a pill (taken from mobile phones), and help to identify it by returning the most likely matches from our database set of pill images. Each image is converted to greyscale andbackground is subtracted to get an idea of overall shape. Twelve shape features are also extracted for each image, including: the 7 Hu invariant moments, circularity degree, rectangle degree,sphericity degree, concavity degree and flat degree. We categorized andlabeled each pill in our training dataset by shape and trained a neural network on these images and features Dataset Overview of Process Challenges and Future Work References and Acknowledgements Two examples of consumer-qualitypillimages The correspondingreference i magematches for the two pills shown onthe left The National Library of Medicine has made public a set of pill images that include: 2000 JPEG high-resolution reference images (one for the front and one for the back of each of 1000 pills) from the Computational Photography for Pill Identification Project. 5000 JPEG consumer quality images of the same 1000 pills, taken with digital cameras in varying light conditions Shape Determination What if you could take a photo of an unknown pill and almost immediately find out what it is? Marker/Imprint Extraction Shape Classification Marker/Imprint Extraction Results of Shape Determination Original Image Image after applying erosiontechn ique O utput after s ubtrac tingerosion output image from origina l image The most distinguishing factor for pill identification is the markings or imprints on the tablets or capsules. To extract these features, we used a few morphological image processing operations to enhance the imprints. Following that, we used open-sourced Object Character Recognition software to try to extract the numbers and words imprinted. Scale-Invariant Feature Transform (SIFT) descriptors of each pill were also extracted to try to capture a representation of the image. “ 3228 25mg “ Lu, W. (2012).Me th od f o r Ima ge Sha pe Re co gn i ti o n wi th Ne ura l Ne two rk. I n Adv ances i n Co mp u ter Sci e nc e a nd In forma ti o n En g ineering(pp. 547-551). Spri n g er Be r lin Heidel b e rg. Cunha, A., Adão, T., & Tri gueiros ,P. (20 1 4). He l p me Pi l l s: a mo b i le p i l re co gn iti o n too l fo r e lderly pers ons. Proc ed i a Te ch no l ogy , 16, 15 23-1532. Us h i z i ma , D., Ca rne i ro, A., So uz a, M., & Me de i ro s , F. (20 15 ). In ve sti g ati ng Pil l Re co g n i tio n Me th od s fo r a Ne w Nati on a l L ib rary of Me d ic in e Image Dataset. In Adv an ce s i n Vi su a l Co mp uti ng (pp . 41 0-4 1 9). Spri n ge r I n tern a t ional Pub lishi ng. 58% 75% 70.66% 55% 25% 10% 15% 10% 30% 0% 10% 20% 30% 40% 50% 60% 70% 80% Accuracy of Neural Network Capsule Circle Oblong/Oval/Football P entagon Fat Oval Triangle S quare Hexagon S pecial (all other shapes) When given the consumer quality images, the neural network gives an overall of 50.7% accuracy. Limited amount of data - only a few images for each specific pill. Need to gather more images from other resources. Lack of diversity in shape (mostly circle or oblong) Imprints challenging andrequiresmore research. Color hard to match due to differing light conditions and camera lenses. Create wrapper to classify and suggest best matches. 50.68% 74% 75% 81% 80% 55% 0.00% 10.00% 20.00% 30.00% 40.00% 50.00% 60.00% 70.00% 80.00% 90.00% Ne u ra l Ne two rk SVM KNN Dec is ion Tree Ra n d o m Fo rest Ad a b o o st Precision of Different Classifiers

Pharmaceutical Pill Recognition Using Computer Vision ...vision.soic.indiana.edu/b657/sp2016/projects/ctay/poster.pdf · Pharmaceutical Pill Recognition Using Computer Vision Techniques

  • Upload
    others

  • View
    14

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Pharmaceutical Pill Recognition Using Computer Vision ...vision.soic.indiana.edu/b657/sp2016/projects/ctay/poster.pdf · Pharmaceutical Pill Recognition Using Computer Vision Techniques

SchoolofInformaticsandComputing,IndianaUniversityBloomington

CharleneTayandMridul Birla

PharmaceuticalPillRecognitionUsingComputerVisionTechniques

Introduction

• Unidentifiedandmisidentifiedprescriptionpillspresentchallengesforpatientsandprofessionals. Takingsuchpillscanresultinadversedrugreactionsthataffecthealthorcouldevencausedeath.Bycomingupwithwaystoeasilyidentifyandverifyprescriptionpills,errorscanbegreatlyreduced.

• Ourgoalistoproduceaframeworkorsetofmethodsthatwilltakeaconsumer-qualityimageofapill(takenfrommobilephones),andhelptoidentifyitbyreturningthemostlikelymatchesfromourdatabasesetofpillimages.

• Eachimageisconvertedtogreyscaleandbackgroundissubtractedtogetanideaofoverallshape.

• Twelveshapefeaturesarealsoextractedforeachimage,including:the7Huinvariantmoments,circularitydegree,rectangledegree,sphericitydegree,concavitydegreeandflatdegree.

• Wecategorizedandlabeledeachpillinourtrainingdatasetbyshapeandtrainedaneuralnetworkontheseimagesandfeatures

Dataset

Overview ofProcessChallenges andFuture Work

References andAcknowledgements

Twoexamplesofconsumer-qualitypillimages Thecorrespondingreferenceimagematchesforthetwopills shownontheleft

TheNationalLibraryofMedicinehasmadepublicasetofpillimagesthatinclude:

• 2000JPEGhigh-resolutionreference images(oneforthefrontandoneforthebackofeachof1000pills)fromtheComputationalPhotographyforPillIdentificationProject.

• 5000JPEGconsumerqualityimagesofthesame1000pills,takenwithdigitalcamerasinvaryinglightconditions ShapeDetermination

Whatifyoucould takeaphotoofanunknown pilland almostimmediatelyfindoutwhatitis?

Marker/ImprintExtraction ShapeClassification

Marker/Imprint Extraction ResultsofShapeDetermination

OriginalImage Imageafterapplyingerosiontechnique Outputaftersubtractingerosionoutputimagefromoriginalimage

• Themostdistinguishingfactorforpillidentificationisthemarkingsorimprintsonthetabletsorcapsules.Toextractthesefeatures,weusedafewmorphologicalimageprocessingoperations toenhancetheimprints.

• Followingthat,weusedopen-sourcedObjectCharacterRecognitionsoftwaretotrytoextractthenumbersandwordsimprinted.

• Scale-InvariantFeatureTransform(SIFT)descriptorsofeachpillwerealsoextractedtotrytocapturearepresentationoftheimage.

“ 3228 25mg “

Lu, W. (2012). Method for Image Shape Recognition wi th Neura l Network. In Adv ances in Computer Scienc e and In formation Engineering (pp. 547-551). Springer Berl in Heide lberg.Cunha, A., Adão, T., & Triguei ros , P. (2014). HelpmePil ls: a mobi le pi ll recognition too l for elderly pers ons. Proc ediaTechnology, 16 , 1523-1532.Us hiz ima, D., Carnei ro, A., Souz a, M., & Medei ros , F. (2015). Investigating Pil l Recogni tion Methods for a New National L ibrary of Medic ine Image Datas et. In Adv ances in Visual Computing (pp. 410-419). Springer In ternational Publ ish ing.

58%

75%70.66%

55%

25%

10%15%

10%

30%

0%

10%

20%

30%

40%

50%

60%

70%

80%Accuracy of Neural Network

Capsule Circle Oblong/Oval/Football

Pentagon Fat Oval Triangle

Square Hexagon Special (all other shapes)

• Whengiventheconsumerqualityimages,theneuralnetworkgivesanoverallof50.7% accuracy.

• Limitedamountofdata- onlyafewimagesforeachspecificpill.Needtogathermoreimagesfromotherresources.

• Lackofdiversityinshape(mostlycircleoroblong)• Imprintschallengingandrequiresmoreresearch.• Colorhardtomatchduetodifferinglight

conditionsandcameralenses.• Createwrappertoclassifyandsuggestbest

matches.

50.68%

74% 75%81% 80%

55%

0.00%

10.00%

20.00%

30.00%

40.00%

50.00%

60.00%

70.00%

80.00%

90.00%

Neura l Network SVM KNN Dec is ion Tree Random Forest Adaboost

Precision of Different Classifiers