Journal of Pharmaceutical Innovation

, Volume 14, Issue 4, pp 341–358 | Cite as

A System for Real-Time Syringe Classification and Volume Measurement Using a Combination of Image Processing and Artificial Neural Networks

  • Hem K. Regmi
  • Jerry NesamonyEmail author
  • Scott M. Pappada
  • Thomas J. Papadimos
  • Vijay Devabhaktuni
Original Article



The purpose of this research was to develop a system that can read and report the volume of liquid medication present in syringes.


The system is comprised of a digital webcam which is designed to communicate with a computer program developed using MATLAB. The system includes two functional modules, one supporting syringe classification, and another supporting volume measurement. Adaptive template matching was used to determine the best match point between target and template images. The connected component labeling method was used during volume measurement. An artificial neural network (ANN) model was developed using MATLAB to support the intended volume measurement functionality. The developed ANN was designed as a classifier which determines the plunger depth of the syringe and then leverages this result to calculate and derive the volume of medication inside the syringe as the final system output. Commercial Luer-lock syringes of sizes from 1 to 30 ml were used in conjunction with syringe tip caps of blue and yellow color. Tap water or aqueous dye solutions of yellow, red, and blue color simulated liquid medication in the syringe.


The developed syringe classification system successfully detected and categorized all tested syringes according to their size. The best accuracy of the system was found to be 99.95% with a 3-ml syringe, while the worst accuracy was 95.82% with a 5-ml syringe. It took approximately 6 s to perform the entire task demonstrating the utility of this system to report volumes in real time.


The developed system can be used across a variety of settings that routinely support measuring and handling liquids in syringes including hospitals, pharmacies, and the pharmaceutical industry.


Compounded sterile preparations Real-time measurement Syringe volume Dose accuracy Image analysis Artificial neural networks 

Supplementary material

12247_2018_9358_MOESM1_ESM.docx (25 kb)
ESM 1 (DOCX 25 kb)


  1. 1.
    Hatcher I, Sullivan M, Hutchinson J, Thurman S, Gaffney FA. An intravenous medication safety system: preventing high-risk medication errors at the point of care. J Nurs Adm. 2004;34(10):437–9.CrossRefGoogle Scholar
  2. 2.
    Aspden P, Wolcott JA, Bootman JL, Cronenwett LR. Preventing medication errors. National Acad. Press; 2007.Google Scholar
  3. 3.
    Yin HS, Mendelsohn AL, Wolf MS, Parker RM, Fierman A, van Schaick L, et al. Parents’ medication administration errors: role of dosing instruments and health literacy. Arch Pediatr Adolesc Med. 2010;164(2):181–6.CrossRefGoogle Scholar
  4. 4.
    Kim GR, Chen AR, Arceci RJ, Mitchell SH, Kokoszka KM, Daniel D, et al. Error reduction in pediatric chemotherapy: computerized order entry and failure modes and effects analysis. Arch Pediatr Adolesc Med. 2006;160(5):495–8.CrossRefGoogle Scholar
  5. 5.
    Gudeman J, Jozwiakowski M, Chollet J, Randell M. Potential risks of pharmacy compounding. Drugs in R&d. 2013;13(1):1–8.CrossRefGoogle Scholar
  6. 6.
    Rich D, Fricker M Jr, Cohen M, Levine S. Guidelines for the safe preparation of sterile compounds: results of the ISMP sterile preparation compounding safety summit of October 2011. Hosp Pharm. 2013;48(4):282–94. Scholar
  7. 7.
    Sasich LD, Sukkari SR. Unknown risks of pharmacy-compounded drugs. The Journal of the American Osteopathic Association. 2008;108(2):86-.Google Scholar
  8. 8.
    ISMP list of high-alert medications in acute care settings. Institute for Safe Medication Practices 2014. Accessed 4 Aug 2017.
  9. 9.
    Phillips MS. Standardizing iv infusion concentrations: national survey results. Am J Health Syst Pharm. 2011;68(22):2176–82.CrossRefGoogle Scholar
  10. 10.
    Pedersen CA, Schneider PJ, Scheckelhoff DJ. ASHP national survey of pharmacy practice in hospital settings: dispensing and administration-2011. Am J Health Syst Pharm. 2012;69(9):768–85.CrossRefGoogle Scholar
  11. 11.
    Cantrell SA. Improving the quality of compounded sterile drug products: a historical perspective. Ther Innov Regul Sci. 2016;50(3):266–9.PubMedGoogle Scholar
  12. 12.
    Wilson M. Sterile compounding pharmacies: states that do and do not require compliance with USP< 797> versus FDA 483s. Ther Innov Regul Sci. 2016;50(3):279–303.PubMedGoogle Scholar
  13. 13.
    Forcinio H. Trends and best practices in visual inspection: using best practices for manual or automatic inspection can improve the inspection process. Pharm Technol. 2014.Google Scholar
  14. 14.
    Langille SE. Particulate matter in injectable drug products. PDA J Pharm Sci Technol. 2013;67(3):186–200.CrossRefGoogle Scholar
  15. 15.
    Wichtl M. Herbal drugs and phytopharmaceuticals: a handbook for practice on a scientific basis: CRC press; 2004.Google Scholar
  16. 16.
    Chin RT, Harlow CA. Automated visual inspection: a survey. IEEE Trans Pattern Anal Mach Intell. 1982;6:557–73.CrossRefGoogle Scholar
  17. 17.
    Singh S, Bharti M. Image processing based automatic visual inspection system for PCBs. ISOR J Eng. 2012;2:1451–5.CrossRefGoogle Scholar
  18. 18.
    Gunatilake P, Siegel M, Jordan AG, Podnar GW, editors. Image understanding algorithms for remote visual inspection of aircraft surfaces. Electronic Imaging’97; 1997: International Society for Optics and Photonics.Google Scholar
  19. 19.
    Acquire Images from Webcams. Mathworks, MA, USA. 2016. Accessed 12 Aug 2016.
  20. 20.
    Mohr D, Zachmann G, editors. FAST: Fast Adaptive Silhouette Area based Template Matching. BMVC; 2010.Google Scholar
  21. 21.
    Banharnsakun A, Tanathong S. Object detection based on template matching through use of best-so-far ABC. Comput Intell Neurosci. 2014;2014:7.CrossRefGoogle Scholar
  22. 22.
    Wu Z, Goshtasby A. Adaptive image registration via hierarchical voronoi subdivision. IEEE Trans Image Process. 2012;21(5):2464–73.CrossRefGoogle Scholar
  23. 23.
    Roy S, Rathod D. Real-time object tracking and learning using template matching.Google Scholar
  24. 24.
    Chantara W, Mun J-H, Shin D-W, Ho Y-S. Object tracking using adaptive template matching. IEIE Trans Smart Process Comput. 2015;4(1):1–9.CrossRefGoogle Scholar
  25. 25.
    Sharmila R, Uma R. A new approach to image contrast enhancement using weighted threshold histogram equalization with improved switching median filter. Int J Adv Eng Sci Technol. 2011;7:206–11.Google Scholar
  26. 26.
    Otsu N. A threshold selection method from gray-level histograms. Automatica. 1975;11(285–296):23–7.Google Scholar
  27. 27.
    Cheriet M, Said JN, Suen CY. A recursive thresholding technique for image segmentation. IEEE Trans Image Process. 1998;7(6):918–21.CrossRefGoogle Scholar
  28. 28.
    Yapa RD, Harada K. A connected component labelling algorithm for greyscale mammography image processing as a pre-processing tool. Mach Graph Vision Int J. 2007;16(3):305–27.Google Scholar
  29. 29.
    Walczyk R, Armitage A, Binnie D. Comparative study on connected component labeling algorithms for embedded video processing systems. 2010.Google Scholar
  30. 30.
    Rudrapatna M, Sowmya A, editors. Feature weighted minimum distance classifier with multi-class confidence estimation. Australasian Joint Conference on Artificial Intelligence; 2006: Springer.Google Scholar
  31. 31.
    Booth D, Oldfield R. A comparison of classification algorithms in terms of speed and accuracy after the application of a post-classification modal filter. Remote Sens. 1989;10(7):1271–6.CrossRefGoogle Scholar
  32. 32.
    Gerstner W. Supervised learning for neural networks: a tutorial with Java Exercises. Recurso disponible on-line: 1998.
  33. 33.
    Fine S, Scheinberg K. Efficient SVM training using low-rank kernel representations. J Mach Learn Res. 2001;2(Dec):243–64.Google Scholar
  34. 34.
    Vlacic L. Learning and soft computing, support vector machines, neural networks, and fuzzy logic models. Vojislav Kecman; MIT Press, Cambridge, MA, 2001, ISBN 0-262-11255-8, 2001, pp. 578. Elsevier; 2002.Google Scholar
  35. 35.
    Yu H, Wilamowski BM. Levenberg-Marquardt training. Ind Electron Handb. 2011;5(12):1.Google Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Electrical Engineering and Computer Science Department, College of Engineering, MS 308University of ToledoToledoUSA
  2. 2.Department of Pharmacy Practice, MS 1013, College of Pharmacy and Pharmaceutical SciencesUniversity of Toledo HSCToledoUSA
  3. 3.Department of Anesthesiology, College of Medicine and Life SciencesUniversity of Toledo HSCToledoUSA
  4. 4.Department of Bioengineering, College of Engineering, MS303University of ToledoToledoUSA

Personalised recommendations