*From Sophisticated Analysis to Colorimetric Determination: Smartphone Spectrometers… DOI: http://dx.doi.org/10.5772/intechopen.82227*

analytes in the samples. Colorimetric Test Reader app was presented in [52], which determines pH, protein, and glucose values in the assay.

Solmaz et al. [28] developed ChemTrainer app which quantifies the peroxide content running machine learning algorithm on the remote server as shown in **Figure 6a**. After capturing a photograph of colorimetric test strips, the app sends mean RGB values for a region of interest to the remoter server as machine learning algorithm needs only mean values for the classification. A message queue service was employed to enable multiple users to reach the server simultaneously.

Screenshots of the ChemTrainer are given in **Figure 6b**. In the opening page, there are two options for the user: either capturing a new image with "Experiment" button or using existing image from the phone with the "Load From Gallery" button. After an image is captured or loaded from the gallery, the user may proceed or retake a new image. Next, a region of interest needs to be cropped with adjustable crop box. The app calculates the average red, green, and blue values of the cropped image and sends to the server, which runs a classification algorithm that decides the class of image. In the meantime, the app displays a progress animation until the result comes back from the server.

The ChemTrainer app was further improved to be able to work with singleimage reference (SIR) and named as ChemTrainerSIR [45]. In addition, it gained additional features like saving location and time data for the previous experiments, which help the user to analyze the past results when needed. The ChemTrainerSIR app is described in **Figure 7** with screenshots. There are "train" and "experiment" options on the home page as shown in **Figure 7a**. Training steps are introduced in **Figure 7** from b to g (top row), while testing steps are described at the bottom row from h to m. If the user selects the train option, some initial information needs to be entered such as the name of the chemical compound as the name of the model (e.g., phosphate), the units of measurement (e.g., ppm), and the number of samples with known concentration levels. The user either captures an image of samples or loads from the gallery. Then, the user enters the reference values for each sample which will be used later in the testing phase. All these information are stored in a designated folder in internal storage. In the testing phase, the user first selects the model, which was used in training. Then, a new image is taken to quantify the concentration value based on comparison with the reference model.

## **Figure 6.**

*The communication between the smartphone and a remote server is illustrated in (a) and the developed ChemTrainer app is presented in (b).*

*Color Detection*

**Figure 5.**

*Experimental setup proposed in [45].*

replacement of the strips were used to train the machine learning algorithm which was designed to quantify the pH values accurately. Since the training set was enriched with the images captured in various and complicated scenarios, it was

One possible drawback of the colorimetry method in [41] is its computational cost due to its large training dataset. To address this issue, single-image referenced colorimeter was proposed in [45]. The system was simplified in the sense of both hardware and software design. Instead of using machine learning algorithm which needs a large dataset, it used local dataset created by a user with a single reference image. In addition, images from the local dataset were compared with test images using color-matching algorithms computationally cheaper than machine learning algorithms. The hardware design was also simplified into a cardboard box as shown in **Figure 5**. It was painted white, and white light-emitting diodes were mounted to the box ceiling to minimize the ambient illumination effects. A holder platform with the same height as the camera was placed for the assays to maintain the same distance for imaging. The system was tested on four different (nitrite, phosphate, chromium, and phenol) assays, and it was reported that the performance accuracy

The previous section described the hardware designs for smartphone-based spectrometry and colorimetry. This section presents mobile applications and

Software applications are necessary tools due to complementary characteristics for the hardware designs of spectrometer and colorimetry. Mobile apps were therefore developed to make the overall system user-friendly [14, 15, 25, 28, 36, 45,

Albumin Tester [14] application was developed for Android phones to let the user determine the albumin concentration in the urine sample. To test alcohol in saliva, SPAQ [15, 25] application was developed which estimated the alcohol level based on the histogram distribution. Colorimetric Plate Reader app [36] was proposed for qualitative and quantitative ELISA test. PhotoMetrix [46] application was introduced, which runs the univariate and multivariate analyses to quantify the

reported that pH values were detected with 100% accuracy.

was between 76 and 100% depending on the assay types.

**3. Software designs**

**3.1 Mobile apps**

46, 52].

algorithms proposed for these designs.

**72**

**Figure 7.**

*Opening page of the ChemTrainerSIR app is given in (a). The top row (b–g) shows training steps, while the bottom row (h–m) presents the implementation of the app on the sample.*
