iPill: An iOS Mobile Application for Automatic Pill Identification Based on Image Processing Technique and Eigenface Algorithm Ornicha Choungaramvong, Supangkana Tongsuk, Surasak Srilamlert and Supphachai Thaicharoen Department of Computer Science, Faculty of Science, Srinakharinwirot University 114 Sukhumvit 23, North Klongtoey Subdistrict, Wattana District, Bangkok 10110, Thailand. Abstract: Consumable medical drugs are currently available in a variety of forms such as liquid, capsule, and tablet. For the tablet/pill form, many of them are manufactured in very similar appearances, which could lead to incorrect medical consumption, particularly for elderly and visually-impaired people. For the past several years, a number of software applications have been developed by both academic and business sectors to facilitate pill identification. These tools are ranged from Web-based applications, desktop applications, and to mobile applications. The key approach used by most of these tools is using image processing techniques to extract pill characteristics from a pill’s image, converting these features into some numerical forms such as a vector model, and comparing the features with those stored in the database using some similarity or distance measures to determine a matched pill. Rather than using direct pixel-based characteristics and vector model for pill comparisons, an investigation of bringing in a face recognition algorithm to assist pill identification is presented in this paper. The proposed method exploits a commonly-known face recognition algorithm, known as Eigenface algorithm, to mathematically derive features from pills’ images. These acquired features are used for determining the pill’s shape, which are then combined with pill’s color as criteria for the overall process of pill identification. In addition, the proposed technique is implemented as an iOS mobile application, named iPill, for an automatic pill identification. A preliminary result using 320 pill images from 20 types of pills with 9 different shapes and 10 dissimilar colors shows that iPill mobile application gives a satisfactory performance on the accuracy for automatic pill identifications. Keywords: Eigenface algorithm, image processing, mobile application, pill identification 1. Introduction Consumable medical drugs are presently manufactured in a variety of forms such as liquid, capsule, and tablet. For the tablet or pill form, many of them are produced in similar appearances, which could lead to incorrect consumption, particularly for elderly and visually-impaired people. According to our study, software applications developed for facilitating pill identification could be categorized into three main categories based on their application platforms: (i) mobile application [3, 4, 7, 8], (ii) desktop application [1, 2, 11, 13, 16, 18], and (iii) Web application [5, 6, 9, 14, 17]. The key principle that most of these applications used for distinguishing pills is the use of physical characteristics of the pills such as color, shape, dimension, texture, score, and/or imprint, provided by the user or extracted by some image processing techniques. Subsequently, these physical appearances may be combined with other techniques such as constructing feature vector spaces for similarity or distance measures to find the matched pills in databases. For instances, in the mobile application platform, Cunha and his research team proposed a mobile application for pill identification based on shape, dimension, and color of the pills [4]. In their method, shape is determined using shape-matching function, dimension is calculated using the minimum bounding box of the pill, and color is identified using pixel-by-pixel comparisons. According to their evaluation results, the pill matching process works well only when there is a small set of pills stored in the database. Another research study in pill identification from images is proposed by Caban and team, which could be categorized as a desktop application. In their study, the modified shape distribution model was used for constructing a combined feature vector of colour, shape, and imprint. Then, the combined feature vector model is used to classify and identify the prescription drugs [1]. Their experimental results show a good accuracy for determining the top 5 of the matched pills. Nevertheless, the technique has not been implemented for practical uses or automatic identification. For International Conference on Computer, Electrical & Electronics Engineering (CEEE’17) Jan. 18-19, 2017 Phuket (Thailand) 47