PhotoMetrix UVC: A New Smartphone-Based Device for Digital Image Colorimetric Analysis Using PLS Regression

A novel free PhotoMetrix UVC is proposed for both the operation of a universal serial bus video camera (UVC) and multivariate image analysis, allowing a full solution for point-of-use analysis. A UVC was placed in an open-source 3D-printed chamber illuminated by a white light-emitting diode (LED) with controlled intensity of light. The digital images captured were converted into red, green, and blue (RGB) histograms, and regression models were used within the app. As a proof-of-concept, four adulterants in raw milk samples were determined. The coefficient of determination (RCal) for all models was higher than 0.99, and no significant differences (p < 0.05) between the measured and predicted values were identified. The root mean square error of calibration (RMSEC) and root mean square error of cross validation (RMSECV) were satisfactory, with values less than 0.1 and 0.7 g L, respectively. The recoveries ranged from 90 to 120% in spiked milk samples, and partial least square (PLS) models showed root mean square error of prediction (RMSEP) of 0.28, 0.33, 0.48 and 0.39 g L for chloride, hypochlorite, hydrogen peroxide and starch, respectively. The PhotoMetrix UVC app was feasible for the colorimetric chemical analysis using a smartphone improving the applicability, mobility, and usability.


Introduction
Color changes recorded with imaging devices are gaining increasing interest in chemical analysis due to their simplicity of use and easy adaption to portable devices. In this way, out-of-lab applications for in situ and real-time monitoring have become feasible. Widely distributed and low-priced imaging devices (e.g., webcams, 1,2 scanners, 3,4 and smartphones) 5 have been used instead classical analytical instruments (e.g., spectrophotometers), even though their original development was not focused on analytical applications. In this way, classical methods (e.g., those based on spectrophotometry in the visible range or fluorescence) or even reactions proposed for qualitative analysis in the field could be used in a novel and easy-to-use way. 6 Smartphones have gained interest as analytical devices because they are fully available at a reasonable cost and they allow data acquisition, storage, and processing in the same device. In addition, they allow real-time wireless communication (e.g., through Wi-Fi, Bluetooth, or near field communication) with host computers or other devices to obtain information in situ. 6,7 Therefore, several analytical operations could be performed using smartphones; this turns them into a suitable tool for point-of-use analysis. Colorimetry is by far the most widely used approach in smartphone-based chemical analysis with widespread applications such as for beer, 8 natural and drinking water, 9,10 raw milk, 11 sugarcane spirit, 12 urine, 13 and biological macromolecules. 14,15 The devices for smartphone-based chemical analysis can be constructed in-house with customization (e.g., using three-dimensional printers (3D printers)) to fulfill the requirements of each application. 2,11,16 Therefore, adaptations could be easily produced for dedicated applications. This is a feature in common with the equipment commonly available on the analytical instrumentation market, which are dependent on the consumables provided by manufacturers.
Despite the features of smartphone-based analytical methods, some hardware limitations have impaired the quality and the dissemination of analytical methods developed. In general, the lamp and detector used in these devices are the same as available on the smartphone. 5,6,13 Therefore, special devices should be manufactured in order to allow such an adaptation. Nevertheless, the differences among smartphone models and manufacturers has led to the construction of customized devices, because standardization of a chamber, illumination, and image capture condition is difficult from one smartphone to another. 12 Therefore, the direct transfer of an analytical method developed for one device to another device is troublesome and could impair the widespread use of a smartphone-based analytical method. Another important characteristic is related to operation in the field. If a device should be attached directly to a smartphone, the practicality of analytical steps or even the use of the smartphone screen is sometimes difficult. Lastly, in some methods proposed in the literature, 5,10,11 the smartphone is directly exposed to the reagents or solvent vapors, which could reduce the lifetime of the equipment.
The use of an external camera connected to a smartphone via a universal serial bus (USB) connection allows the construction of a device that could overcome these limitations. The USB connection is feasible for all smartphones and it is suitable to operate cheap, fully available and miniaturized devices as endoscopic cameras. These kinds of cameras are commercially available and at low cost. In Brazilian stores or international online stores, endoscopic cameras can cost between $7.27 and $16.49 USD, respectively.
They are often used for domestic and automotive applications. Thus, they can be positioned in small environments to take pictures because in general their diameter ranges from 4 to 8 mm. Different cable sizes and angles of view are available allowing their use for different applications.
Therefore, the construction of an open-sourced compact chamber suitable for point-of-use analysis is proposed. A universal serial bus video camera (UVC) camera was attached in an open-source 3D-printed chamber illuminated by a white light-emitting diode (LED). The intensity of light could be adjusted to allow the capture of suitable images. A hole was designed to allow the introduction of disposable closed vials or even disposable cuvettes (the same as used in spectrophotometry).
The image processing also presented limitations for smartphone-based point-of-use analysis. In general, calibration is performed using only one-color scale, greatly limiting its application in colorimetric methods with different scales of color. Recently, a free software app was proposed by our group for smartphone-based applications (PhotoMetrix Pro). 5,11,12 In this app, multivariate analysis (e.g., partial least squares, PLS) could be performed to improve the applicability of colorimetry through different color systems as RGB (red, green and blue), HSV (hue, saturation and value), HSI (hue, saturation and intensity) and HSL (hue, saturation and lightness). The RBG color model is based on theory of color perception by the human eye, which have different sensitivity peaks situated around red, green and blue. The HSV, HIS and HSL models are generated from RGB model. In this paper, the novel PhotoMetrix UVC version free Android app is proposed for both operation of a UVC and image processing, allowing a full solution for point-of-use analysis. As a proof-ofconcept, some forbidden adulterants (chloride, hydrogen peroxide, hypochlorite, starch) of raw milk samples were determined, thus transforming reactions commonly used in visual qualitative tests into quantitative ones.

Instrumentation
The system developed for colorimetric analysis with a universal serial bus video camera is shown in Figure 1. The camera (SmartCam, model Intelligent Endoscope, 7 mm, complementary metal-oxide semiconductor (CMOS), waterproof, with resolution of 640 × 480 pixels) was connect to the smartphone (LG, model Nexus 5, USA) through the USB connection and positioned laterally within the chamber (Figure 1a). A LED lamp of 6 W was connected to a modulator of power supplied from the battery to control the intensity of light emitted. A hole in the center of the piece was used for introduction of a transparent polypropylene vial (Eppendorf-type round bottom vessels, 2.9 mL, Cralplast, Brazil), as shown in Figure 1b. After capturing the image, the application PhotoMetrix UVC, builds and analyzes the color histograms on the RGB scales. This application performs the processing and presentation of results using univariate or multivariate analysis methods. The chamber was designed using Solidworks ® 3D computer-aided design software 17 and printed on a fused deposition material printer (Cliever Tecnologia, CL2 Pro+, Brazil) using 1.75 mm polylactic acid (PLA) thermoplastic filament (Cliever Tecnologia, Brazil). The PhotoMetrix UVC was developed for the Android platform, which is freely available in the Google Play Store.

Reagents
For the determination of starch in milk, iodine (Neon, Suzano, Brazil) and potassium iodide (Vetec, São Paulo, Brazil) were used to prepare the reagent solution (lugol). Starch (Vetec, São Paulo, Brazil) was used for the preparation of reference solutions and for fraud simulation. Sodium chloride (Dinâmica, Indaiatuba, Brazil) was used to prepare reference solutions for the determination of chloride in milk using potassium chromate (Vetec, São Paulo, Brazil) and silver nitrate (Vetec, São Paulo, Brazil) for color generation. Hydrogen peroxide (30%, Alphatec, Santana, Brazil), vanadium pentoxide (Merck, Rio de Janeiro, Brazil), and sulfuric acid (Vetec, São Paulo, Brazil) were used for hydrogen peroxide determination in milk samples. Sodium hypochlorite (10 to 12%, Alphatec, Santana, Brazil) and potassium iodide (Vetec, São Paulo, Brazil) were used for hypochlorite determination. Distilled water was further purified in a Milli-Q system (Direct-Q 3 UV, 18.2 MΩ cm, Millipore Corp., Bedford, MA, USA), and it was used to prepare all solutions and reagents. All reference solutions used for the construction of calibration curves were previously standardized. 10 Determination of adulterants in raw milk samples Samples of raw milk from Holstein cows were obtained from five different animals from the region of Santa Maria, RS, Brazil. Proximate compositions of milk samples were determined in triplicate (n = 3, see Table S1 in Supplementary Information section). The methods of the Association of Official Analytical Chemistry (AOAC) 11 were used to determine moisture, ash, and protein content in raw milk samples. The lipid content was determined according to Bligh and Dyer. 18 Quantitative analysis regarding the presence of milk adulterants was performed based on the qualitative visual tests recommended in Brazilian official methods. 19 Substances used to avoid microbiological growth (e.g., hydrogen peroxide and sodium hypochlorite) and reconstitution compounds used to mask cryoscopic analysis (e.g., starch and sodium chloride) were determined using the proposed device. Analytes were added directly to each milk sample for construction of calibration curves.
Chloride was determined using 775 µL of milk, 775 µL of reference solution or water (blank) and 450 µL of 0.1 mol L -1 silver nitrate and 70 µL of potassium chromate (5%, m/v) solutions in the vial. The calibration curve was constructed ranging from 0.1 to 3.5 g L -1 of chloride. Hydrogen peroxide determination was performed using 1000 µL of milk, 1000 µL of reference solution or water (blank), and 200 µL of the vanadium pentoxide solution (1% m/v prepared with 6% sulfuric acid) added into the vial. The calibration curve was constructed in the range of 0.5 to 3.0 g L -1 of hydrogen peroxide. For the determination of hypochlorite, 1000 µL of milk, 900 µL of water, and 100 µL of potassium iodide solution (7.5%, m/v) were added into the vial. The calibration curve was constructed in the range of 0.5 to 3.5 g L -1 of hypochlorite. Starch stock solution (10 g L -1 ) was prepared previously under heating. Afterwards, it was added to the milk to reach a final concentration ranging from 0.5 to 3.0 g L -1 of starch. For preparation of the calibration curve, 1000 µL aliquots of both reference solutions (or water for blank) and milk were added into the vial followed by addition of 60 µL of lugol solution. For all experiments, the solutions were mixed and measured immediately.
Images with 64 × 64 pixels in the region of interest (ROI) were captured after the colorimetric reaction (n = 3) and processed in the smartphone with the PhotoMetrix UVC app, version 1.0.4. The PLS model was selected in the software using RGB histogram values. The graphic interface of the PhotoMetrix UVC app for multivariate analysis by the PLS calibration model is demonstrated in Figure 2. In this example, for determination of hydrogen peroxide, the ROI of the image in the RGB channel was captured and stored in a histogram comma-separated values (CSV) format. Each channel generates 256 variables, so a complete RGB histogram presents 768 variables per sample image. In order to demonstrate the ease of acquiring analytical information, 30 images were acquired to develop each calibration model.
After construction of calibration curves, a recovery test was performed using raw milk samples spiked with chloride, hydrogen peroxide, hypochlorite, and starch with a final concentration of 2 g L -1 . Analyses were performed with fifteen true replicates (n = 15) for calibration and in true triplicate (n = 3) for samples from five different cows. As the samples were analyzed without any pretreatment, a larger number of replicates were used to overcome the inhomogeneities problems of raw milk samples. Blanks were prepared in the same way as reference solutions, but without the addition of the analytes.

Statistical evaluation
The PLS regression results were evaluated according coefficients of determination (R 2 ), slope, offset, root mean squared error of calibration (RMSEC), root mean squared error of cross validation (RMSECV), and root mean squared error of prediction (RMSEP). These parameters were obtained directly from the app. The limit of detection (LOD, 3σ/slope) was calculated considering the average and standard deviation (σ) of 10 blank measuring, using an electronic spreadsheet program. 20

General aspects of the proposed device and calibration
The association of a UVC with 3D-printed chamber for performing colorimetry directly in disposable vials presented features relating to practicality and the possibility for use in field analysis. No electrical connection was required and all analytical operations could be performed in the same vessel. The software was user-friendly and a high throughput (hundreds of samples per hour) could be reached. A small amount of reagents (200-1000 µL) and samples (775-1000 µL) were needed, and the vessels could be safely capped and stored for further residue disposal.
The performance of the PLS models to determine adulterants of raw milk (chloride, hydrogen peroxide, hypochlorite and starch) is summarized in Table 1. The regression models were developed using 22 to 32 calibration samples. The best results to RMSECV were obtained with 8, 7, 11 and 11 latent variables (factors), for determination of chloride, hydrogen peroxide, hypochlorite and starch, respectively. Figure 3 shows the correlation between the measured values and predicted values for each adulterant of the milk samples used in the development of the calibration model. The coefficient of determination (R 2 Cal ) for all models showed good linearity with values higher than 0.99, and no significant differences (p < 0.05) among the measured values and predicted values were observed. The RMSEC  and RMSECV were very satisfactory, presenting values lower than 0.1 and 0.7 g L -1 , respectively. PLS models gave RMSEP of 0.28, 0.33, 0.48, and 0.39 g L -1 for chloride, hypochlorite, hydrogen peroxide and starch, respectively.
It is important to comment that although the quality of the USB camera is more poor to the original smartphone camera, the results were adequate for the determination of chloride, hypochlorite, hydrogen peroxide and starch. In addition, the development of other methodologies, if necessary, higher resolution cameras can be used in the PhotoMetrix UVC app.

Adulterant determination using the proposed method
After completing the calibration models, they were saved in the app and used for the determination of adulterants in five raw milk samples from different cows. Samples were tested in triplicate (n = 3). In order to demonstrate the accuracy of the proposed method, a recovery study was performed using 2 g L -1 of adulterants in raw milk, as presented in Figure 4. Good recoveries in spiked raw milk were obtained using the proposed method. Recoveries ranged from 98 to 120%, 90 to 108%, 90 to 100%, and 90 to 103% for chloride, hydrogen peroxide, hypochlorite, and starch, respectively. The results demonstrated that direct determination of the adulterants in raw milk can be performed using only a few microliters of sample (≤ 1000 µL) and reagents (≤ 1000 µL) for each run, thus reducing the volume of sample up to 14 times in comparison with the official visual qualitative method. It is important to mention that no sample preparation or pretreatment was used, as ease of use is an important aspect, considering the potential of the proposed method for field analysis. Therefore, some inhomogeneities can be expected for some samples and can influence the deviations among measurements.
According to the Brazilian official method, the detection of starch, chloride, hydrogen peroxide, and hypochlorite in milk can be performed using a simple method with a positive and a negative control. 19 Furthermore, some adulterants in low concentration may not be visually identified or generate false positive results. This was observed in chloride determination using the Brazilian official method. 19,21 A brick red color was observed for blanks after the addition of silver nitrate, but after agitation the color disappeared. The same behavior was reported by Gondim et al. 22 This occurs because silver chromate has a solubility product constant lower than silver chloride, but its solubility is approximately five times higher. Therefore, in milk samples with a low chloride concentration, the silver chromate can be solubilized after shaking, making it difficult to visualize the brick red color of silver chromate and then providing false positive results. 22,23 Other analytical methods has been applied for determination these adulterants, using flow injection analysis (dichromate, hydrogen peroxide, salicylic acid and starch), 24 infrared spectroscopy (dextrin, starch, melamine, urea and ammonium nitrate), 25 conductimetric sequential injection (chloride), 26 high performance liquid chromatography (hydrogen peroxide), 27 and fluorimetry (hydrogen peroxide). 28 In spite of the reliable results and low LOD (in the µg kg -1 range) obtained with these methods, they are more expensive, demand specialized analysts and instrumentation, and they are less feasible for field analysis than classical colorimetric methods. In this way, colorimetric reactions remained as feasible alternatives for the determination of adulterants in raw milk in the field.
Therefore, monitoring milk quality through the analysis of digital images combined with chemometric methods can be a promising alternative for the detection of milk adulterations. This method does not require laborious sample pretreatment and the detection is performed quickly. 11 In order to evaluate the results for the LOD obtained with the proposed method, they were compared with other methods proposed in literature for the determination of the same analytes in milk with portable devices ( Table 2). The LOD was determined using 10 raw milk samples from different cows and without any pretreatment. Therefore, contributing to the increase the deviation among the blank measurements, and resulting in higher LOD values, however more realistic for a field analysis. Even so, the LODs reached with the proposed method were satisfactory, with values similar to those found in the literature.

Conclusions
The PhotoMetrix UVC application allows a significant improvement in the development of analytical platforms based on portable smartphones, allowed the connection of the USB devices for images capture, which offer greater usability and speed for analytical procedures.
The proposed 3D-printed chamber for performing colorimetry directly in disposable vials, using a USB video camera, also reduce interference due to variations in ambient lighting and the distance between the camera and the sample surface.
Furthermore, the proposed procedure allowed a reliable determination of adulterants in milk, can be particularly suitable for a first inspection by the farmers (point-of-use), and samples with suspicious results can be analyzed in the field without a specialized laboratory, and at a low-cost.

Supplementary Information
Supplementary data (proximate compositions of milk samples) are available free of charge at http://jbcs.sbq.org.br as PDF file.