Prototype Design and Experimental Evaluation e-Healthcare System based on Molecular Analysis Devices

Recently, wireless body area networks (WBANs) and mobile Internet of Things (IoT) have been greatly increased and integrated into a different type of systems such as electronic/mobile-healthcare (e/m-healthcare) systems. In addition, analyzing the composition of drugs or performing the medical rapid tests in the conditions field are the main tasks of the m-healthcare system, in which the traditional laboratory methods of analysis are not suitable. Therefore, in this study, we proposed a novel structure with a distributed e-health system to perform such analysis, where portable infrared micro spectrometers are utilized and then boundary calculations are applied. More specifically, this system is proposed to use a portable infrared micro spectrometer with a specially designed application connected to a public communication network, which can process the results of analysis using boundary calculations. Moreover, it provides remote processing and long-term storage of analysis data using artificial neural networks and cloud technologies. Finally, simulation results show that preprocessing (error checking), data buffering and Edge Computing can significantly reduce the network latency and volume of transferred data. Keywords—Micro spectrometer; molecular analysis; NIR spectroscopy; public communication networks; internet of things; e-health; m-health; edge computing


I. INTRODUCTION
The quality of medical services in the modern world depends very much on several important factors. Firstly, it is the time before medical care is provided, and the shorter the time, the better for the patient. The second factor is the level of automation and informatization of the process of providing medical care, because it eliminates the human factor and improves the quality of medical services. The third factor is to reduce dependence on existing infrastructure and to provide medical care at any time and in any place. This factor significantly depends on the level of technology and telecommunications development [1].
When they talk about the integration of modern technology and medicine, the most commonly considered area of knowledge is e-Health (also written e-health). This is a field of knowledge that studies the tasks of digitalization of medical service delivery, development of new high-precision medical equipment, integration of medical systems with telecommunication technologies, implementation and application of robots and artificial intelligence (AI) in medicine [2,3]. Today most countries in one way or another implement e-health system in everyday medical practice [4,5,6], the level of trust of patients and doctors in such systems is steadily increasing [7].
The concept of mobile e-health (m-health) has emerged due to the fact that tablets or smartphones have become the most common means of communication in today's world. It includes medical practice and public health carried out using mobile devices [8,9]. Mobile e-health is developing very rapidly because it relies on the use of devices and technologies familiar to the average user, such as smartphones, tablets, smart watches, and the Internet. Importantly, m-health technologies allow patients to remain mobile and monitor their health status in their daily lives without significant limitations. On the other hand, m-health uses cloud platforms and Edge Computing [10,11,12] to accumulate data, process and store them, and perform deep analysis using AI. m-Health technologies provide many different services. These include access to public health care sites for appointments or consultations, mobile applications for monitoring medication schedules or adherence to physical activity and daily routines [13], and various applications related to the collection and analysis of data from wearable sensors [14].
Some of the services that m-health provides are various methods for analyzing the composition of food and medicines [15,16], noninvasive blood tests [17,18,19], and other medical tests that are based on the use of infrared spectroscopy [20,21,22].
Until recently, there were no devices whose technical characteristics would allow the use of infrared spectroscopy methods under "field" conditions. Such studies were previously carried out using bulky, expensive and complex equipment exclusively by highly qualified specialists. Fortunately, thanks to rapidly developing technology and an increasing level of production [23], a number of portable wearable spectrometers are now available that allow such analyses to be performed.
The reported study was funded by RFBR, project number 19-37-90140. These spectrometers implement the "Lab-On-A-Chip" (LoC) (or sometimes even "System-On-A-Chip" (SoC)) concept, which involves using a microchip to perform a complete biochemical analysis procedure, allowing one or more processes on one microchip using a minimum number of samples for the study [24].
An important point that determines the possibility of massive use is the cost of such devices. Of course, a device with a very high cost will not be as much in demand and widespread as one with a small cost. Today there are already examples of devices for spectrometric analysis with low cost and small size [25,26].
The main contributions of this study are summarized as follows: • Developed a prototype of the e-healthcare system based on molecular analysis devices for recognizing medicines in case of absence or damage to the labeling on the package.
• Implemented the interception and analysis of network traffic generated during the operation of the system was carried out and its characteristics.
• Proposed an algorithm to minimize network latency and volume of transferred data when using e-healthcare system based on molecular analysis devices.
The rest of the paper is organized as follows. Section 2 the related work. Our proposed a prototype system is presented in Section 3. Then, the Network traffic interception and characterization in Section 4. The proposed algorithm and simulation results in Sections 5 and 6. Finally, Section 7 concludes the paper.

II. RELATED WORK
Here are a few examples of m-health devices or systems that use handheld spectrometers to analyze the composition of various substances.
For example, the authors of one paper describe the development of a smartphone-based system for accurate and reliable assessment of sulfate and chloride levels in the water. The developed system is based on the detection of the transmitted modulated signal (for spectrophotometric study) and the intensity of the scattered signal (for turbid metric study) of the liquid sample. The specially developed application allows to carry out the analysis autonomously and to display the results in a user-friendly format. The system proposed by the authors to study the composition of liquids can become a scalable platform, which after some modernization can be used to monitor other parameters of water or other liquids [27].
Another article presents a miniature and cost-effective spectrophotometer used for real-time biomarker detection. The prototype consists of a highly sensitive spectrometer embedded in a low-cost housing made using 3D printing technologies and a specially designed printed circuit board that provides processing and wireless data transmission. The results show that the portable system developed by the authors can identify the tubulin protein, which is a well-known biomarker used in diagnosing various types of cancer. The developed prototype has a small size and low power consumption [28].
One of the articles describes the using of a portable lowcost spectrophotometer for detecting nitrites in a liquid that simulate the urine of patients. This can be used in medical practice to determine the presence of a bacterial infection in the urinary tract. When developing the spectrophotometer, the authors used an ultraviolet LED of peak emission at 370 nm as a light source. A silicon pin photodiode was used as a detector of the reflected spectrum. A microcontroller was used as a platform for controlling the sensors. This spectrophotometer provides a real-time display of the result. To test the operation of the spectrophotometer, the results of its operation were compared with the results of the study using a dipstick test. In the future, the authors plan to conduct additional studies on real urine samples [29].
In another article, the authors describe a peripheral system based on the Raspberry Pi platform for processing data from the intensive care unit (ICU). The authors propose to process incoming data from medical equipment on the periphery of the network to unload the hospital's cloud platform. Medical data was modeled on the basis of the PhysioNet MIMIC III database and transferred to the edge platform for processing and detecting emergency cases. Then the data was transferred to the cloud level [30].
In another study, the authors developed a machine learning application to estimate the reflected electromagnetic spectrum in infrared spectroscopy. The use of artificial neural networks improved the recognition results compared to the previously used methods [31].
In another article, the authors review existing healthcare solutions and, as a result of their analysis, propose a new architecture for developing a dedicated e-health platform. It is assumed that such a platform will implement the Platform as a Service (PaaS) service delivery model and allow for faster development and implementation of specific medical services [10].

III. DEVELOPING A PROTOTYPE SYSTEM
In this article, several handheld devices designed for infrared myrospectroscopy analysis were studied to develop a prototype m-health system. These devices are on free sale and already have a certain number of users. They are positioned by the developers as general purpose NIR spectrometers. The appearance of these spectrometers is shown in Fig. 1.
These devices are SCiO manufactured by Consumer Physics, LinkSquare manufactured by Stratio, Inc., Tellspec spectrometer manufactured by Tellspec, Inc. and a personal spectrometer developed on the basis of the open source project [26].
The devices interact with a smartphone, tablet or laptop during their operation in order to access the Internet in order to transfer data or to display the results in a user-friendly form. Let's look at the scanning process, which is about the same for these devices. 53 | P a g e www.ijacsa.thesai.org During scanning, the infrared beam of the micro spectrometer falls on the object under study and is reflected. The energy absorption of the beam occurs at wavelengths whose energy corresponds to the excitation energies of the vibrations in the irradiated molecules. The reflected infrared beam with an altered spectrum hits the sensor of the micro spectrometer. Based on the reflected infrared spectrum, which is the wavelength dependence of the radiation intensity, the composition of the scanned substance is evaluated. Next, the data from the micro spectrometer is transmitted to a smartphone or tablet, where it is accumulated and preprocessed. After the preliminary analysis, the data from the user's smartphone is sent to a cloud server for further in-depth processing based on a database of reference spectra. The results of the analysis are transferred to the smartphone and displayed in the application in a user-friendly form.
In order to implement the m-health prototype system, an applet was developed for drug analysis using the LinkSquare NIR micro spectrometer and an AI-enabled cloud platform. The technical characteristics of the LinkSquare spectrometer are presented in Table I. The appearance of the LinkSquare spectrometer is shown in Fig. 2. The developed applet is a software module for the main application. The developed applet should be able to recognize medicines sold in pharmacies without a prescription and issued in the form of tablets. The applet can be used by both ordinary users and medical professionals to recognize medicines in case of missing or damaged markings on the packaging, as well as to recognize counterfeit medicines.
To collect the data needed to train the neural network and create the applet, a specialized LS Collector application was installed on the laptop to collect spectrograms. The data collection in the LS Collector program is shown in Fig. 3. After that, spectrograms for different medicines were collected. The collected data was uploaded to the cloud platform to train the neural network and create an applet. Next the neural network was trained based on the collected spectrograms. The number of training iterations was 10 000.
Next, the developed applet was installed through the platform Google Play on a smart phone running the Android operating system, after which it was tested. The main technical characteristics of the LinkSquare application and the developed applet are presented in Table II.
The test consisted of scanning and recognizing a random sample of the drug. For this purpose, medicines were used in the form of tablets without packaging. The results were repeated many times and statistically processed. The probability of successful recognition was 93 percent. The Fig. 4 shows the result of the analysis and the appearance of the developed applet, as well as a comparison with a similar applet for the SCiO spectrometer.
(1) Developed Applet for LinkSquare, (2) Similar Applet for the SCiO Spectrometer. Testing of the applet to verify its performance was carried out based on the developed m-health prototype system, the structure of which is presented in Fig. 5. The prototype simulates a scenario of micro spectrometer application in everyday life to analyze the composition of medicines.

IV. NETWORK TRAFFIC INTERCEPTION AND CHARACTERIZATION
The developed prototype was used to capture and analyze the IP network traffic generated by the m-health system. The traffic characteristics are presented in Table III.
The presented results were calculated with a confidence probability of 90%. This is to assess traffic characteristics in detail and use them to further model the molecular analysis service delivery process using the m-health system. Such traffic and messaging algorithms may differ from those typical of the Internet [32], and a better understanding of the characteristics of m-health systems will solve existing problems and accelerate the development and diffusion of m-health in the future [33,34]. To capture network traffic, the PCAP Remote mobile app was installed on the smartphone, which was used to capture and store network traffic. The traffic was then transferred to a laptop with WireShark traffic analyzer software for further study and evaluation of its characteristics.
In [12,32], the following sequence of steps was described for an Internet-based real-time NIR spectrometer molecular analysis procedure, which is shown in Fig. 6. Obviously, in order to improve the quality of the m-health service, it is necessary to reduce the latency of the service. However, since we cannot influence the scanning speed of the spectrometer itself, we will further consider the delay associated with the accumulation, processing, transmission and reception of data by the smart phone.

V. PROPOSED ALGORITHM
After a detailed study of the operating principles and traffic analysis of m-health systems that use portable infrared micro spectrometers to analyze the composition of food and medicines, the following improved algorithm for the service was proposed. The algorithm is shown in Fig. 7.
A distinctive feature of this algorithm is the preprocessing of the data received from the spectrometer in order to compare it with a predetermined template. The template is selected depending on the applet used. The preprocessing allows you to discard data resulting from false positives and scanning errors. Thus, erroneous data is not transmitted over the Internet to a remote server for processing, which on the one hand reduces the amount of traffic transmitted, and on the other hand, discarding erroneous data allows the system to free up more quickly for the next scan.
Another distinctive feature is the presence of a buffer that accumulates data until its volume approaches the value of the maximum transmission unit (MTU), which reduces the number of transmitted packets and slightly increases the data transmission delay. 55 | P a g e www.ijacsa.thesai.org We should also consider the possibility of processing data not on a remote cloud server, but using Edge Computing technologies to reduce network latency and provide a higher level of m-health services [35,36].

VI. SIMULATION MODEL
To verify the effectiveness of the above algorithm, a simulation models were developed in AnyLogic software. These models allows the simulation of both the basic scenario of service provision, as well as allows the simulation to take into account the features of the above-proposed algorithm and numerically assess the difference in the distribution of accumulation, processing and data transmission times in the process of providing m-health service using the NIR spectrometer and the volume of data transmitted for different scenarios. These are the basic scenario, the scenario with preprocessing (error checking), the scenario with buffering, and the scenario using Edge Computing.
The graph in Fig. 8 shows the distribution of the delay time associated with the accumulation, processing, transmission and reception of data in the basic scenario. It does not use any improvements, such as preprocessing (error checking) or Edge Computing. The simulation results are quite exactly the same as the results of the created network prototype.
The resulting distribution can be described with sufficient accuracy by an exponential distribution with a probability density where λ is the intensity of service (served attempts). The graph in Fig. 9 shows the distribution of the delay time associated with the accumulation, processing, transmission and reception of data in a scenario with preprocessing (error checking). In this scenario, the delay reduction is achieved through preprocessing, which ensures that false scans are discarded even on the smart phone and the e-healthcare system is quickly released for subsequent work. This distribution is difficult to describe with a single function. We described it as a mixed distribution based on the assumption that this process can be represented as an aggregation of two independent processes. In this case, the probability density can be expressed as the weighted sum of the probability densities of two distributions.
where η 1 and η 2 are weight coefficients, g 1 and g 2 are probability density functions (pdf).
56 | P a g e www.ijacsa.thesai.org The graph in Fig. 10 shows the distribution of the delay time associated with the accumulation, processing, transmission and reception of data in a scenario with preprocessing (error checking), buffering and Edge Computing. In this scenario, the delay reduction is achieved through preprocessing, which ensures that false scans are discarded and the e-healthcare system is quickly released for subsequent work, as well as by processing data not on a remote cloud server, but using Edge Computing. We described this distribution in a similar way using a mixed distribution with the difference that two Gamma distributions were chosen as terms.
where η 1 and η 2 are weight coefficients, g 1 and g 2 are pdf functions.
where g 2 (t) − presents the Gamma distribution.
Generalized results of modeling the distribution of time of service provision are presented in the Table IV. The presented results were calculated with a confidence probability of 90%.
From the simulation results presented in Table IV, the use of preprocessing (error checking), buffering of data received from the spectrometer, and the use of Edge Computing for local data processing can significantly reduce the delay time associated with the accumulation, processing, transmission and reception of data. The graph in Fig. 11 shows the dependence of the amount of data transmitted in megabytes on the number of scans. As can be seen from the graph, the use of preprocessing (error checking) allows you to reduce the amount of data transmitted by discarding the spectra obtained as a result of erroneous or accidental (unintentional) scanning when using the ehealthcare system. Buffering reduces the number of transmitted IP packets, and therefore the amount of service information (headers), which reduces the total number of transmitted data. The resulting dependences can be described quite accurately by straight lines. n a n v i = ) ( (7) where ɑ i − is the corresponding slope ratio.

VII. CONCLUSION
In this paper, analyzes the use of infrared microspectrometers used for e-health and m-health systems and highlights the main promising areas of their use. In particular, m-health applet was developed using a cloud platform and AI, where this applet is designed to be installed on a smart phone or tablet under the Android operating system as part of the main application. Moreover, it is capable of analyzing the composition of medicines in the form of tablets, which can be useful in cases where there is no packaging for the specified drug or the label is damaged, as well as to recognize counterfeit medicines. Further, an efficient m-health prototype system was developed to test the created application, which includes a portable NIR spectrometer, a smartphone, a WiFi router for Internet access and a remote cloud platform for data processing. Afterward, based on the prototype developed, the network traffic generated in the analysis process was intercepted and analyzed to further evaluate its characteristics and develop models for m-health service delivery. At the same 57 | P a g e www.ijacsa.thesai.org time, a group of models was developed to test Quality of Service (QoS) solutions for providing molecular analysis service using NIR spectrometers and the Internet and based on the intercepted traffic. Finally, AnyLogic simulation environment is utilized to perform the simulation, where four different sceneries are implemented, namely basic scenario, the scenario with preprocessing (error checking), the scenario with buffering, and the scenario using Edge Computing. Additionally, the average service time and the amount of data transferred were compared for each scenario. Simulation results show that preprocessing (error checking), data buffering, and Edge Computing can significantly reduce the network latency and volume of transferred data.