Python algorithm for Calculation of Total Phenolic Compounds in Vegetable Oils with Smartphone Image analysis | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Python algorithm for Calculation of Total Phenolic Compounds in Vegetable Oils with Smartphone Image analysis Sanita Vucane, Ingmars Cinkmanis, Martins Sabovics This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-3946138/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract In this research, a Python algorithm was developed that calculated one of the total concentrations of phenol in vegetable oils using the RGB colour system. The algorithm converts data obtained in the RGB colour system into absorbance values using NumPy, Pandas, Matplotlib and SciPy libraries. It allows for complex data calculations and analyses that are particularly accurate and more efficient than traditional methods such as MS Excel. Algorithm development is divided into six stages: library import, user data input and processing, absorbance calculations, linear regression and calibration curve drawing, data analysis and saving results in Excel format. The algorithm offers flexible use in both local Python development environments and online platforms such as Kaggle ( https://www.kaggle.com/ ). It can also be used in the analyses of other plant extracts or chemical substances, where interpretations of RGB colour system data are used as a basis. This algorithm opens up new possibilities in scientific data analysis by taking advantage of modern technology and programming language. Python algorithm RGB colour system Total phenols Vegetable oils Figures Figure 1 Figure 2 Figure 3 Introduction Today, analytical equipment is being developed more and more accurate, detecting substances with very low concentrations down to picograms [ 1 , 2 ], however, their costs are significantly high, additional equipment, specialized laboratory facilities and trained personnel are required. Thus, the development of information and nanoparticle technologies has created new opportunities for research to use more uncomplicated methods for determining the quality of food products [ 3 ]. For example, the smartphone and its available functions, as an alternative to classical optical methods [ 4 ]. Smartphones can be used to perform light absorption and emission measurements and to determine biologically active substances in food products [ 5 ]. These methods are effective because they allow analyses to be performed regardless of place and time and do not require special equipment and expert assistance [ 6 , 7 ]. The latest generation of smartphones are equipped with high-resolution cameras and optical sensors that allow high-quality images and light absorption measurements. These technologies allow smartphones to compete with classical optical methods, thus making them a more accessible and efficient solution for the determination of biologically active substances in food products [ 8 , 9 ]. Smartphone cameras can reach 48 megapixels and higher, image quality, and use ultra-high ISO 409600 for accurate light absorption measurements [ 10 ]. This ISO standard refers to the sensitivity of a digital camera's image sensor to light. A higher ISO setting means that the sensor is more sensitive to light, allowing low-light images to be captured without flash or longer exposure times [ 5 ]. Colourimetry is the simplest of the applied methods used in the detection of chemical substances and its basic principle is based on the analysis of images obtained on a smartphone using application software in the RGB colour system [ 11 ]. Eleven studies are available in the literature on the use of smartphone images in the determination of antioxidant properties. In these scientific studies, it was found that different types of smartphones can be used for the determination of antioxidant properties, regardless of their existing camera resolutions. In studies, they ranged from 5 MP to 49 MP. The studies used both smartphones and office scanner capable of obtaining colourful images and were used to determine the antioxidant properties. Most of the mentioned studies used the RGB colour system as the basis for the analyses for the determination of antioxidant properties, however, Ledesma and Apichai used only the R or red colour spectrum for the determination of total phenols, justifying it with a very high detection coefficient R 2 = 0.9995, unlike G – green and B – blue lights. It was concluded that the coefficient of determination of the gallic acid calibration curve of the reference method using a spectrophotometer was slightly lower R 2 = 0.998 (p > 0.05) [ 12 , 13 ]. Only two of the eleven available studies were related to the determination of DPPH, where each of the researchers used drastically different systems. Autor Apichai used CMYK to characterize DPPH, while Nguyen used the RGB colour system, where both studies have concluded that there is no significant difference with the proposed smartphone and commercial UV-VIS spectrophotometer [ 13 , 14 ]. One of the eleven studies explored vegetable oil - olive oil with a 3D printer system, a smartphone’s CMOS camera, and using as a basis for detection antioxidant-induced formation of gold nanoparticles under fluorescent light, which resulting images were converted from RGB to the HSV colour system [ 15 ]. All studies concluded that non-traditional methods can ensure the determination of total phenols, antioxidant properties - ABTS and DPPH, and the results obtained are comparable to classical methods, just as accurate, cheaper, more uncomplicated and smaller in size, making them usable in any environment and situation. Despite the good results, it is important to note that sometimes the limits of detection (LOD) and quantification (LOQ) of the performed analyses differed, which ranged from LOD = 0.03 mg GAE L − 1 to 6.4 mg GAE L − 1 and LOQ = 0.11 mg GAE L − 1 to 21.6 mg GAE L − 1 (Table 1.3). Such differences could be due not only to the smartphones, the light and distance used, but also to the different systems that were used to perform the analysis. The systems differ mainly in their construction: boxes made of wood with a white or black coating, polystyrene foam or ethylene vinyl acetate were used as a basis, as well as portable photo studios and systems obtained by a 3D printer. Smartphones and the colour spectra obtained from them are used not only in the study of antioxidant substances, but also in the measurement and chemical analysis of other parameters [ 16 ]. Counterfeiting of high-quality vegetable oils is a common problem, because from the consumer's point of view, it is not always possible to distinguish fakes from the original. For example, a smartphone video can be used to detect the adulteration of olive oils, where a sequence of lights with different colours is generated on the screen and used to illuminate the oil samples. Videos are recorded to capture colour changes on the sample surface and then analysed in the RGB colour system [ 17 ]. In the research of Hakonen and Beves, it was established that 405 nm LED light can be used to identify vegetable oils and the images taken on a smartphone can be converted into HSV in the RGB colour system in order to detect the fluorescent compounds characteristic of oils, such as chlorophyll and polyphenols [ 18 ]. A similar solution is offered by de Melo Milanez and Pontes in analysing the differences and shelf life control of sunflower, soybean and rapeseed oils using a fluorescent lamp and a Microsoft World Wide Web (Web) camera with HD resolution 1280 x 720, where the obtained images analysed in the RGB colour system and converted to HSV colour system histograms [ 19 ]. A Brazilian study provides an analysis of solutions for vegetable oils, which often have similar properties and can be difficult to distinguish based on colour, smell or taste alone. LED fluorescent lighting, charge coupled matrix (CCD) and artificial neural network (ANN) are used to classify oils such as canola, sunflower, corn and soybean using diluted oil samples. Previously, this type of research was based on more time-consuming analytical chemistry and mathematical method [ 20 , 21 , 22 , 23 ], applying principal component analysis (PCA), principal component regression (PCR), partial least squares regression analysis (PLS) and artificial neural networks (ANN) [ 24 ]. Smartphone-based image analysis can be applied to determine the iodine value of vegetable oils using Wijs reagent (a solution of iodine monochloride in glacial acetic acid) and a starch solution. Obtaining the solution in blue, image analysis is performed in the RGB sharp system and compared with the classical titration method [ 25 ]. Unfortunately, there is not much data available in the literature related to the use of smartphone for the determination of vegetable oils, thus more research in food chemistry is needed. In order to better automate and obtain data from the RGB colour system, an algorithm is needed to facilitate the input and processing of the obtained data. As one of such solutions, as well as the goals of this research, is to create an algorithm in the Python programming language that can be integrated into various applications. Materials and methods Python Algorithm development method based on the data, from our other research scientific paper on the determination of total phenols in 11 vegetable oil (Linseed, Hemp, Sea buckthorn, Grape seed, Corn, Sunflower, Milk thistle, Rapeseed, Rice bran, Olive, Macadamia nut samples using the analysis of smartphone images in the RGB colour system, where Agilent Cary 60 UV/VIS spectrophotometer (Agilent Technologies, Inc., USA) was used for comparison with measurements obtained by a Huawei P30 Lite smartphone (Huawei Technologies Co., Ltd., China) [ 26 ]. Principle of colorimetric image acquisition: A Huawei P30 Lite smartphone was placed horizontally in front of the open-side case at a distance of 12 cm from PS 2.5 mL disposable macro cuvettes (BrandTech Scientific, Inc., US) with 96% ethanol (compare oils), vegetable oil samples, and Folin - Ciocalteu phenol reagent. Colorimetric analysis was taken using a smartphone colorimetric application with RGB colour system according to Fig. 1 illustration. Analysis of acquired images and calculations: Total phenolic content was calculated using a gallic acid calibration curve and the results were expressed as the equivalent of gallic acid mg kg − 1 (mg GAE kg − 1 ). 1) colour values were calculated for the images obtained from the smartphone application "Colour Picker" using the RGB colour system according to the equation described by Jansons and Meija [ 27 ]. The equation used was modified by fitting it to the obtained average colour values for the following colours: red (Ravg), green (Gavg) and blue (Bavg) according to equations 1, 2 and 3. \({\text{R}}_{\text{a}\text{v}\text{g}} = \frac{{\sum }_{\text{i}=1}^{\text{n}}{\text{R}}_{\text{i}}}{\text{n}}\) (1) \({\text{G}}_{\text{a}\text{v}\text{g}} = \frac{{\sum }_{\text{i}=1}^{\text{n}}{\text{G}}_{\text{i}}}{\text{n}}\) (2) \({\text{B}}_{\text{a}\text{v}\text{g}} = \frac{{\sum }_{\text{i}=1}^{\text{n}}{\text{B}}_{\text{i}}}{\text{n}}\) (3) 2) The average colour value of Ravg, Gavg and Bavg was converted to absorbance using the modified Baer-Lambert Eq. 4 [ 3 ]. $$\text{A}\text{b}\text{s}= -\text{log}\left(\frac{\text{I}}{{\text{I}}_{0}}\right)$$ 4 where: I –averaged value of R avg , G avg or B avg I 0 –average value of RGB colour module of 96% ethanol solution 3) Total phenolic content (TPC) concentration calculation from light intensity of red colour model (CR(TPC)), Eq. 5. \({\text{C}}_{\text{R}\left(\text{T}\text{P}\text{C}\right)}= \frac{{(\text{A}\text{b}\text{s}}_{\text{R}}-0.0038)}{0.0056} =\) (mg GAE kg -1 oil)(5) The basis of the software development is the use of the Python programming language, so that the RGB colour module data obtained on the smartphone can be entered and processed in Microsoft Windows 10, 11 and web browser environments. Equipment used: The portable computer Huawei MateBook D 15 (2019 model, Huawei Technologies Co. Ltd., China) was used for the development of the Python programming language with the following specification: 1. Processor: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx 2.10 GHz 2. Random access memory (RAM) : 8.00 GB 3. Graphics card: AMD Radeon(TM) Vega 8 Graphics 4. Hard disk: Samsung MZVLB256HBHQ-00000 5. Operating system: 64-bit Windows 10 Home, Windows Pack 120.2212.4190.0 Web browser used: free open-source web browser Mozilla Firefox ver. 116.0.2 (64-bit) 2023 (Mozilla Foundation, Mountain View, California). Kaggle web app that allows you to explore and build Phyton models in a web environment ( https://www.kaggle.com ). The complete code of the Python program for the analysis of smartphone images for the determination of total phenols is available in GitHub - https://github.com/ (Project name: Analysis of smartphone images for the determination of total phenols). Results and discussion The developed algorithm allows image data obtained on a smartphone to be converted into absorption in the RGB colour system, to obtain calibration curves (for the determination of total phenols) and to calculate the concentration of total phenolic substances of the analysed vegetable oil samples. Such an open-source program can be used with the Python Integrated Development Environment (IDLE (Python 3.11)) installed on a computer, or with the web-based online programming tool Kaggle ( https://www.kaggle.com ). The advantage of programming in the Kaggle environment is that there is no need for Python software on Windows, iOS, Linux or any other operating system, and compared to MS Excel, the Python programming language has several advantages, as it allows for more complex calculations, offers a wide range of specialized libraries that directly designed for complex algorithms, calculations and analyses of scientific data, such as NumPy, SciPy, Pandas, etc., larger data volume support, higher reproducibility allowing to automate calculation processes, and can also be integrated into other programming environments, such as C++, Java, HTML and others, or integrate into Android and iOS apps. If the user does not have the possibility to insert the mentioned Python algorithm code into the Python development environment (IDLE (Python 3.11)), then it is possible to insert the complete full algorithm code from GitHub into the environment of the online programming tool Kaggle ( https://www.kaggle.com ), according to Fig. 2 . In the analysis of images obtained on a smartphone, the following steps of the Python code algorithm structure are used for the determination of total phenols in vegetable oils in the RGB colour system with the analysis of images obtained on a smartphone (Fig. 3 .). The developed Python algorithm can be divided into 6 stages: 1. required libraries, 2. input and processing of user data, 3. absorption calculations, 4. linear regression and drawing calibration curves 5. data analysis of the vegetable oil samples to be analysed, related to the determination of total phenols and 5. saving the obtained result data in MS Excel file format. The following NumPy (numpy), Pandas (pandas), Matplotlib (matplotlib.pyplot) and SciPy (scipy.stats.linregress) libraries were used for the Python algorithm code obtained in the research. In order to provide access to the mentioned Python libraries and the resulting algorithm to work without errors, the following code given in Table 1 should be specified. If the mentioned Python libraries are not installed in the operating system, it is necessary to install them by specifying the code in Terminal: pip or pip3 install numpy pandas matplotlib scipy. Table 1 Libraries required for developing Python code algorithm # Required Libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.stats import linregress For the development of the code, it is necessary to include the mentioned libraries, because the data of the RGB colour system data, obtained using a smartphone, needs to be mathematically processed. One of Python scientific programming library is NumPy (numpy). NumPy-developed algorithm code provides the efficient mathematical operations needed to convert user-derived and input RGB and concentration data into arrays, thus facilitating subsequent absorption calculations. Using Pandas (pandas) data is processed and analysed, thereby manipulating DataFrame objects that facilitate data storage, access and analysis in a structured way. In this algorithm, pandas is used to store results such as R 2 values and linear regression equations and concentrations of vegetable oil samples to be analysed. To obtain data visualization, as a third library, Matplotlib (matplotlib.pyplot) is needed, which displays the resulting calibration curves for individual R, G, B and RGB, RG, RB, GB colour systems, as well as relationships of visually evaluated data. The last used library is SciPy (scipy.stats), which provides the linregress function for linear regression analysis, which allows calculation of the slope and the coefficient of determination (R 2 ). In order to perform a full-fledged operation of the algorithm, the input function is required in the code, which allows you to enter data, store them in lists and turn them into NumPy arrays in the subsequent operation (Table 2 ). The "input" function shown in the Table 2 at the beginning of the code requires the user to enter the required used concentration, which in the determination of total phenols is expressed as mg GAE L − 1 , thereby ensuring that all obtained results in the subsequent output of the algorithm would be indicated correctly, comprehensibly and accordingly interpretable. This input stage is designed so that the user can also enter other desired concentrations for analysis. As, for example, when other phenolic compounds are used to determine total phenols as Gallic acid equivalents. After obtaining the measurement unit, it is important to enter Io, or the value of the RGB colour system of the comparison solution, and the number of points required to obtain the calibration curve. After entering the number of calibration points, it is essential to create empty lists for the entered concentrations and the values of the RGB or red (R), green (G) and blue (B) colour system in order to be able to perform further calculations and analyses related to the creation of the calibration curve. In addition, the RGB colour system is created in the algorithm code in such a way that the values of each colour system can be entered separately. Inputs are converted to NumPy arrays, which requires the np.array() function, which accepts existing lists and transforms them. Each list is given a new name corresponding to the corresponding data type (concentrations, R, G and B). In the Table 2 the list "concentration" is converted to a NumPy array named "concentration". This activity for the determination of total phenols in vegetable oils is necessary to perform mathematical calculations on the data using the speed of the NumPy library. Transforming the data into these arrays improves the efficiency and accuracy of data processing, especially when it is necessary to calculate absorbance calculations that involve mathematical manipulations of the data. This ensures in action that the data is prepared and ready for further processing and interpretation. Taking into account the RGB and I0 values entered by the user, the "-np.log()" function is used to calculate the absorption (Table 3 ). In order to calculate the absorption values for each channel of the colour system (R, G and B), they are divided by the I0 value of the comparison solution by performing a logarithmic calculation according to the Beer-Lambert law. "print()" function is used to output the obtained data to the screen. Such a function is necessary so that the user can see how the calculated absorbance values change depending on the entered concentrations and check that the data looks correct before further analysis. It is essential not only to obtain the absorbances obtained for each red (R), green (G) or blue (B) colour, but also to use the values obtained from the previous code to obtain all possible data for the combined colour channels, as red-green-blue (RGB ), red-green (RG), red-blue (RB) and green-blue (GB) (Table 3 ). The calibration data used in the algorithm consists of the concentration and their corresponding absorption values in each of the RGB colour channels, therefore, using these data, the algorithm performs a linear regression analysis in accordance with the code given in the Table 4 . To perform linear regression analysis, linregress from the SciPy library is a function that provides the calculation of slope, intercept and coefficient of determination (R 2 ). For each colour channel, the following calculation is performed, which determines a linear model for the relationship between concentration and absorbance. The data obtained after linear regression requires a part of the algorithm code (Table 5 ), which helps visually perceive and display the data, after which the accuracy of the method for determining total phenols in vegetable oil can be assessed and possible data anomalies identified. To implement this part of the code, we need the "plot_calibration_curve" function of the Matplotlib library, which allows visual representation of data and analytical results. In this case 'plt' is used to plot calibration curves where absorbance values are plotted against concentration. A separate calibration curve is created for each R, G, B and combined RGB, RG, RB, and GB colour system channels, their distinct colours, and the name of the resulting graph is created. After the obtained visualization, it is necessary to create a data structure (Table 6 ), which includes the values obtained in the calculation of the coefficient of determination (R 2 ) and linear regression equations for each colour (R, G, B) and combined colour systems (RGB, RG, RB and GB) channels. The "pandas.DataFrame" function is used in the algorithm code, which allows you to organize and store data in the system by creating a table-like structure with several rows and columns, as well as the obtained table structure and data are output with the help of "print". When all the steps related to the creation of the calibration curve and the values obtained in the calculation of the coefficient of determination (R 2 ) and the linear regression equations are completed, it is necessary to supplement the algorithm code with an important part of the second condition, which refers to the analysis of the RGB colour system of the obtained images of the sample or vegetable oils and total phenols calculations. In order to ensure this part of the code, it is necessary to create such input conditions where it is possible to enter the number of samples to be analysed and choose which colour channel to perform concentration calculations (Table 7 ). In this part of the algorithm code, the user is required to enter numerical values indicating how many vegetable oil samples will be analysed and to choose which colour (R, G, B) and combined colour (RGB, RG, RB and GB) system channels to perform concentration calculations. The "n_unknow_samples" and "channels" part of the "input" function help to implement this step. Entering the number of vegetable oil samples is necessary so that the algorithm knows how many sample data to process, as well as how many times to repeat the concentration calculations. On the other hand, when choosing a channel of the colour system or their combined channels, the user is offered the option to perform concentration calculations according to which channel of the colour system, indicating the relevant letters or their combinations - R, G, B, RGB, RG, RB or GB. This choice is mostly related to previously obtained values obtained in the calculation of the coefficient of determination (R 2 ) and linear regression equations. The user makes this choice by evaluating which RGB channel of the colour system or their combinations has the highest accuracy, tending closer to the value 1. An input is added to an existing operation to assign a name to each entered auge oil analysable sample, after which to perform further recognition during data processing. A fragment of the input code is given in Table 7 . When choosing the number of entered analysed sample, RGB channel of the colour system or their combination and assigning a name, the algorithm needs to know their values by requesting them to be entered by calling the "input" function in accordance with Table 8 . In accordance with the Table 8 , and in order to obtain the data of the calibration curves, it is necessary to calculate the absorption values of the analysed vegetable oil samples. An algorithm that uses the obtaining absorbance value and the calibration curve to calculate the total phenolic concentrations of the analysed vegetable oil samples. As the last final stage for the creation of the algorithm, the output of the obtained analysed data indicating the used concentrations, as well as the input of the document name, saving the data if needed in Microsoft Excel format (Table 9 ). After the algorithm has calculated the concentration of total phenols for each vegetable oil sample to be analysed, the results are output to the user, which include the name of the sample, the corresponding concentration values and information about the unit of measurement – mg GAE L−1 . When using Pandas "DataFrame", a data structure is created in which the results are stored, numbering according to the style of the table, so that the numbering starts from 1. The created list of results is saved in the table in Microsoft Excel document format using the Pandas function "to_excel". When entering the document name, an indication is added that the existing data will be saved in “.xlsx” format, thus allowing the user to use the data on operating systems that do not have the ability to run Python software code. The developed Python software language code algorithm can be used not only for the determination of total phenols in vegetable oils by smartphone image analysis, but also for the analysis of other plants or chemicals that use light-sensitive sensors capable of detecting the RGB colour system. Conclusions The developed algorithm offers a method for determining the concentration of total phenols in vegetable oil samples using data obtained in the RGB colour system from smartphone images. This approach combines modern technology with scientific methods using popular programming languages and tools such as Python, NumPy, Pandas, Matplotlib and SciPy. The algorithm can be used both locally in a Python development environment (e.g. IDLE Python 3.11) and in online programming platforms such as Kaggle ( https://www.kaggle.com/ ). It provides more accessibility and flexibility for different users, regardless of their operating system type. Compared to other data processing tools such as MS Excel, Python offers more sophisticated data processing and analysis capabilities, support for larger data volumes, and higher reproducibility. The algorithm is structured in six basic stages, starting with importing the necessary libraries (NumPy, Pandas, Matplotlib and SciPy), entering and processing user data, absorbance calculations, drawing linear regression and calibration curves, processing the data to be analysed, and ending with saving the data in MS Excel format. This algorithm can be adapted and used in a wider context, such as in the analysis of other plant extracts or chemicals that use light-sensitive sensors capable of detecting the RGB colour system. If necessary, it can also be applied and transformed into another colour system, CMYK, or by performing other chemical analyses based on a spectrophotometer or a colorimeter, such as for the determination of antiradical activity with DPPH and others. This opens up opportunities for wider research and data analysis methods in various in scientific fields. Declarations Availability and requirements Project name: Analysis of smartphone images for the determination of total phenols in Vegetable oils · Project home page: https://github.com/SanitaVucane/Analysis-of-Smartphone-images-in-RGB-colour-system · Operating system(s): e.g. Platform independent · Programming language: e.g. Python · Other requirements: e.g. NumPy, Pandas, Matplotlib and SciPy · License: e.g. GNU GPL version 3. Any restrictions to use by non-academics: e.g. licence needed Ethics approval and consent to participate Not applicable. Consent for publication Not applicable. Availability of data and materials The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request. Python script can be found at https://github.com/SanitaVucane/Analysis-of-Smartphone-images-in-RGB-colour-system. Competing interests The authors declare that they have no competing interests. Funding Not applicable. Authors' contributions I.C. - author of the idea and project manager, developed the research concept and managed the development of Python algorithms. S.V. - performed data collection and processing, experimental measurements and analysis, repeated algorithm testing. M.S. - performed the literature review, development of the methodology and creation of the final version of the manuscript. Acknowledgements Not applicable. References Matter L (2008) Food and Environmental Analysis by Capillary Gas Chromatography: Hints for Practical Use. Wiley, Hüthing Verlag, Heidelberg. Skoog DA, Holler FJ, Crouch SR (2018) Principles of Instrumental Analysis. 7th ed. Cengage Learning, Boston. Bonner PLR, Hargreaves AJ (2022) Basic Bioscience Laboratory Techniques. A Pocket Guide. Wiley, Oxford. Masawat P, Harfield A, Namwong A. (2015). An iPhone-based digital image colorimeter for detecting tetracycline in milk. Food Chemistry 184:23–29. https://doi.org/10.1016/j.foodchem.2015.03.089 Roda A, Michelini E, Zangheri M, Di Fusco M, Calabria D, Simoni P (2016). Smartphone-based biosensors: A critical review and perspectives. TrAC Trends in Analytical Chemistry 79:317–325. https://doi.org/10.1016/j.trac.2015.10.019 Levin S, Krishnan S, Rajkumar S, Halery N, Balkunde P (2016) Monitoring of fluoride in water samples using a smartphone. Science of The Total Environment 551–552:101–107. https://doi.org/10.1016/j.scitotenv.2016.01.156 Song W, Song Z, Vincent J, Wang H, Wang Z (2020) Quantification of extra virgin olive oil adulteration using smartphone videos. Talanta 216:120920. https://doi.org/10.1016/j.talanta.2020.120920 Das AJ, Wahi A, Kothari I, Raskar R (2016) Ultra-portable, wireless smartphone spectrometer for rapid, non-destructive testing of fruit ripeness. Scientific Reports 6: 32504. https://doi.org/10.1038/srep32504 Franca AS, Oliveira LS (2021) Applications of smartphones in food analysis. In: Smartphone-Based Detection Devices. Elsevier, Amsterdam, pp 249-268. Rhyne TM (2017) Applying Color Theory to Digital Media and Visualization. CRC Press, NewYork. Bueno L, Meloni GN, Reddy SM, Paixão TRLC (2015) Use of plastic-based analytical device, smartphone and chemometric tools to discriminate amines. RSC Advances 26(5):20148–20154. https://doi.org/10.1039/C5RA01822F Ledesma CM, Krepsky LM, Borges EM (2019) Using a Flatbed Scanner and Automated Digital Image Analysis To Determine the Total Phenolic Content in Beer. Journal of Chemical Education 96(10):2315–2321. https://doi.org/10.1021/acs.jchemed.8b01037 Apichai S, Thajee K, Pattananandecha T, Saenjum C, Grudpan K (2021) A Simple Minimized System Based on Moving Drops for Antioxidant Analysis Using a Smartphone. Molecules 22:26(19):5744. https://doi.org/10.3390/molecules26195744 Nguyen HV, Jakmunee J, Youngvises N, Preechaburana P (2022) Determination of Both Total Phenolic Compound and Antioxidant Capacity of Herbal Teas Using Smartphone Digital Imaging. Chiang Mai Journal of Science 49(2):420-433. https://doi.org/10.12982/CMJS.2022.030 Calabria D, Guardigli M, Severi P, Trozzi I, Pace A, Cinti S, Zangheri M, Mirasoli MA (2021) Smartphone-Based Chemosensor to Evaluate Antioxidants in Agri-Food Matrices by In Situ AuNP Formation. Sensors 21(16):5432. https://doi.org/10.3390/s21165432 Zhu H, Yaglidere O, Su T, Tseng D, Ozcan A (2011). Cost-effective and compact wide-field fluorescent imaging on cell phone. Lab Chip 11(2):315-322. https://doi.org/10.1039/c0lc00358a Tena N, Garcia-Gonzalez DL, Aparicio R (2009) Evaluation of Virgin Olive Oil Thermal Deterioration by Fluorescence Spectroscopy. Journal of Agricultural and Food Chemistry 57(22):10505–10511. https://doi.org/10.1021/jf902009b Hakonen A, Beves JE (2018) Hue Parameter Fluorescence Identification of Edible Oils with a Smartphone. ACS sensors 3(10):2061-2065. https://doi.org/10.1021/acssensors.8b00409 Milanez KDTM, Pontes MJC (2014) Classification of edible vegetable oil using digital image and pattern recognition techniques. Microchemical Journal 113:10-16. https://doi.org/10.1016/j.microc.2013.10.011 Nikolova K, Zlatanov M, Eftimov T, Brabant D, Yosifova S, Halil E, Antova G, Angelova M (2014) Fluoresence Spectra From Vegetable Oils Using Violet And Blue Ld/Led Exitation And An Optical Fiber Spectrometer. International Journal of Food Properties 17(6):1211-1223. https://doi.org/10.1080/10942912.2012.700536 Ramadan MF (2019) Fruit Oils: Chemistry and Functionality. Springer, Cham. Zeb A (2021) Phenolic Antioxidants in Foods: Chemistry, Biochemistry and Analysis. Springer, Cham. Hassanien, M.F.R. (2023) Bioactive Phytochemicals from Vegetable Oil and Oilseed Processing By-products. Springer, Cham. Da Silva LAL, Soares BRPL (2015) Spectrophotometric determination of the total flavonoid content in Ocimum basilicum L. (Lamiaceae) leaves. Pharmacognosy Magazine 11(41):96-101. https://doi.org/10.1080/10.4103/0973-1296.149721 Peamaroon N, Jakmunee J, Moonrungsee N (2021) A Simple Colorimetric Procedure for the Determination of Iodine Value of Vegetable Oils Using a Smartphone Camera. Journal of Analysis and Testing 5:379-386. https://doi.org/10.1007/s41664-021-00168-x Vucane S, Cinkmanis I, Sabovics M (2022) Determination of total phenolic content in vegetable oils by smartphone-based image analysis. Journal of Hygienic Engineering and Design 38:199-203. Jansons E, Meija J (2002). Kļūdas kvantitatīvajās noteikšanās (in Latvian) (Errors of quantitative determinations) Rasa ABC, Rīga. Table 2 To 9 Table 2 To 9 are available in the Supplementary Files section. Additional Declarations No competing interests reported. Supplementary Files Tables2To9.docx Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-3946138","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":272829522,"identity":"ee1fabcf-c3d9-4aab-8b06-7d44b0072845","order_by":0,"name":"Sanita Vucane","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA5UlEQVRIiWNgGAWjYJCCA3DWBwOGBCDFeACHSoQWmArGGRAtSIYQsoaZh4EILfLtZw8e/lBzOLEfyHhsU3Anj18igeEwDx4tBmfyEg4cOHY4ccaZvGTjHINnxZI9BwhoYcgxOHCALS1xA0OOmXSOweHEDccbGA7OwOew/jdALf+AWvjfmP+2AGk5zIBfC8MNoC0H22wSN0jkmDEzQG058AGfw24AbTnbZ2M848YbY8keg8NAvxxswKtFvj/H+EPFNwnZ/v4cww8//hwGhljywQcJ+ByGBTA2kKhhFIyCUTAKRgE6AABca1ptzXpFEQAAAABJRU5ErkJggg==","orcid":"","institution":"Latvia University of Life Sciences and Technologies","correspondingAuthor":true,"prefix":"","firstName":"Sanita","middleName":"","lastName":"Vucane","suffix":""},{"id":272829523,"identity":"cdff0a72-7e4b-419c-bbec-7989d8e40aea","order_by":1,"name":"Ingmars Cinkmanis","email":"","orcid":"","institution":"Latvia University of Life Sciences and Technologies","correspondingAuthor":false,"prefix":"","firstName":"Ingmars","middleName":"","lastName":"Cinkmanis","suffix":""},{"id":272829524,"identity":"a6bcd71f-25c5-4428-ac4b-9b0cc93a566a","order_by":2,"name":"Martins Sabovics","email":"","orcid":"","institution":"Latvia University of Life Sciences and Technologies","correspondingAuthor":false,"prefix":"","firstName":"Martins","middleName":"","lastName":"Sabovics","suffix":""}],"badges":[],"createdAt":"2024-02-10 14:48:34","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-3946138/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-3946138/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":51236722,"identity":"7dd8d52b-e790-4185-8361-e2e4c39184ca","added_by":"auto","created_at":"2024-02-16 16:42:30","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":61668,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cstrong\u003eIllustration of photo studio and smartphone placement for colorimetric imaging\u003c/strong\u003e\u003c/p\u003e","description":"","filename":"1.png","url":"https://assets-eu.researchsquare.com/files/rs-3946138/v1/d4abd61de82ec22c1e6c23d5.png"},{"id":51236719,"identity":"ce9ebf32-2a83-483f-8816-d0f149eec5b9","added_by":"auto","created_at":"2024-02-16 16:42:29","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":562832,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cem\u003e\u003cstrong\u003ePython algorithm input Kaggle web environment for determination of total phenolics in vegetable oils by smartphone image analysis\u003c/strong\u003e\u003c/em\u003e\u003c/p\u003e","description":"","filename":"2.png","url":"https://assets-eu.researchsquare.com/files/rs-3946138/v1/7f9fa8670de4fd042098bd69.png"},{"id":51236720,"identity":"f04ec9ca-1823-4e55-ad95-65f701df4723","added_by":"auto","created_at":"2024-02-16 16:42:29","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":26709,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cem\u003e\u003cstrong\u003eAlgorithm structure of Python code for determination of total phenols in vegetable oil\u003c/strong\u003e\u003c/em\u003e\u003c/p\u003e","description":"","filename":"3.png","url":"https://assets-eu.researchsquare.com/files/rs-3946138/v1/8416bc40ab5fdb125696130b.png"},{"id":51271440,"identity":"3fc99836-2249-44b3-ac2a-8ddfe6a79611","added_by":"auto","created_at":"2024-02-17 17:42:52","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":743033,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-3946138/v1/87dc8da3-ae9c-412e-9841-cc054f865b0a.pdf"},{"id":51236718,"identity":"07cbdd26-1223-4fdb-a09f-d047ef518171","added_by":"auto","created_at":"2024-02-16 16:42:29","extension":"docx","order_by":1,"title":"","display":"","copyAsset":false,"role":"supplement","size":719130,"visible":true,"origin":"","legend":"","description":"","filename":"Tables2To9.docx","url":"https://assets-eu.researchsquare.com/files/rs-3946138/v1/099812f04f2d829c9c845fca.docx"}],"financialInterests":"No competing interests reported.","formattedTitle":"Python algorithm for Calculation of Total Phenolic Compounds in Vegetable Oils with Smartphone Image analysis","fulltext":[{"header":"Introduction","content":"\u003cp\u003eToday, analytical equipment is being developed more and more accurate, detecting substances with very low concentrations down to picograms [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e, \u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e], however, their costs are significantly high, additional equipment, specialized laboratory facilities and trained personnel are required. Thus, the development of information and nanoparticle technologies has created new opportunities for research to use more uncomplicated methods for determining the quality of food products [\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e]. For example, the smartphone and its available functions, as an alternative to classical optical methods [\u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e]. Smartphones can be used to perform light absorption and emission measurements and to determine biologically active substances in food products [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e]. These methods are effective because they allow analyses to be performed regardless of place and time and do not require special equipment and expert assistance [\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e, \u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eThe latest generation of smartphones are equipped with high-resolution cameras and optical sensors that allow high-quality images and light absorption measurements. These technologies allow smartphones to compete with classical optical methods, thus making them a more accessible and efficient solution for the determination of biologically active substances in food products [\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e, \u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eSmartphone cameras can reach 48 megapixels and higher, image quality, and use ultra-high ISO 409600 for accurate light absorption measurements [\u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e10\u003c/span\u003e]. This ISO standard refers to the sensitivity of a digital camera's image sensor to light. A higher ISO setting means that the sensor is more sensitive to light, allowing low-light images to be captured without flash or longer exposure times [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eColourimetry is the simplest of the applied methods used in the detection of chemical substances and its basic principle is based on the analysis of images obtained on a smartphone using application software in the RGB colour system [\u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e11\u003c/span\u003e]. Eleven studies are available in the literature on the use of smartphone images in the determination of antioxidant properties.\u003c/p\u003e \u003cp\u003eIn these scientific studies, it was found that different types of smartphones can be used for the determination of antioxidant properties, regardless of their existing camera resolutions. In studies, they ranged from 5 MP to 49 MP. The studies used both smartphones and office scanner capable of obtaining colourful images and were used to determine the antioxidant properties.\u003c/p\u003e \u003cp\u003eMost of the mentioned studies used the RGB colour system as the basis for the analyses for the determination of antioxidant properties, however, Ledesma and Apichai used only the R or red colour spectrum for the determination of total phenols, justifying it with a very high detection coefficient R\u003csup\u003e2\u003c/sup\u003e\u0026thinsp;=\u0026thinsp;0.9995, unlike G \u0026ndash; green and B \u0026ndash; blue lights. It was concluded that the coefficient of determination of the gallic acid calibration curve of the reference method using a spectrophotometer was slightly lower R\u003csup\u003e2\u003c/sup\u003e\u0026thinsp;=\u0026thinsp;0.998 (p\u0026thinsp;\u0026gt;\u0026thinsp;0.05) [\u003cspan citationid=\"CR12\" class=\"CitationRef\"\u003e12\u003c/span\u003e, \u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e13\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eOnly two of the eleven available studies were related to the determination of DPPH, where each of the researchers used drastically different systems. Autor Apichai used CMYK to characterize DPPH, while \u003cem\u003eNguyen\u003c/em\u003e used the RGB colour system, where both studies have concluded that there is no significant difference with the proposed smartphone and commercial UV-VIS spectrophotometer [\u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e13\u003c/span\u003e, \u003cspan citationid=\"CR14\" class=\"CitationRef\"\u003e14\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eOne of the eleven studies explored vegetable oil - olive oil with a 3D printer system, a smartphone\u0026rsquo;s CMOS camera, and using as a basis for detection antioxidant-induced formation of gold nanoparticles under fluorescent light, which resulting images were converted from RGB to the HSV colour system [\u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e15\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eAll studies concluded that non-traditional methods can ensure the determination of total phenols, antioxidant properties - ABTS and DPPH, and the results obtained are comparable to classical methods, just as accurate, cheaper, more uncomplicated and smaller in size, making them usable in any environment and situation.\u003c/p\u003e \u003cp\u003eDespite the good results, it is important to note that sometimes the limits of detection (LOD) and quantification (LOQ) of the performed analyses differed, which ranged from LOD\u0026thinsp;=\u0026thinsp;0.03 mg GAE L\u003csup\u003e\u0026minus;\u0026thinsp;1\u003c/sup\u003e to 6.4 mg GAE L\u003csup\u003e\u0026minus;\u0026thinsp;1\u003c/sup\u003e and LOQ\u0026thinsp;=\u0026thinsp;0.11 mg GAE L\u003csup\u003e\u0026minus;\u0026thinsp;1\u003c/sup\u003e to 21.6 mg GAE L\u003csup\u003e\u0026minus;\u0026thinsp;1\u003c/sup\u003e (Table\u0026nbsp;1.3). Such differences could be due not only to the smartphones, the light and distance used, but also to the different systems that were used to perform the analysis. The systems differ mainly in their construction: boxes made of wood with a white or black coating, polystyrene foam or ethylene vinyl acetate were used as a basis, as well as portable photo studios and systems obtained by a 3D printer.\u003c/p\u003e \u003cp\u003eSmartphones and the colour spectra obtained from them are used not only in the study of antioxidant substances, but also in the measurement and chemical analysis of other parameters [\u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e16\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eCounterfeiting of high-quality vegetable oils is a common problem, because from the consumer's point of view, it is not always possible to distinguish fakes from the original. For example, a smartphone video can be used to detect the adulteration of olive oils, where a sequence of lights with different colours is generated on the screen and used to illuminate the oil samples. Videos are recorded to capture colour changes on the sample surface and then analysed in the RGB colour system [\u003cspan citationid=\"CR17\" class=\"CitationRef\"\u003e17\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eIn the research of Hakonen and Beves, it was established that 405 nm LED light can be used to identify vegetable oils and the images taken on a smartphone can be converted into HSV in the RGB colour system in order to detect the fluorescent compounds characteristic of oils, such as chlorophyll and polyphenols [\u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e18\u003c/span\u003e]. A similar solution is offered by de Melo Milanez and Pontes in analysing the differences and shelf life control of sunflower, soybean and rapeseed oils using a fluorescent lamp and a Microsoft World Wide Web (Web) camera with HD resolution 1280 x 720, where the obtained images analysed in the RGB colour system and converted to HSV colour system histograms [\u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e19\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eA Brazilian study provides an analysis of solutions for vegetable oils, which often have similar properties and can be difficult to distinguish based on colour, smell or taste alone. LED fluorescent lighting, charge coupled matrix (CCD) and artificial neural network (ANN) are used to classify oils such as canola, sunflower, corn and soybean using diluted oil samples. Previously, this type of research was based on more time-consuming analytical chemistry and mathematical method [\u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e20\u003c/span\u003e, \u003cspan citationid=\"CR21\" class=\"CitationRef\"\u003e21\u003c/span\u003e, \u003cspan citationid=\"CR22\" class=\"CitationRef\"\u003e22\u003c/span\u003e, \u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e23\u003c/span\u003e], applying principal component analysis (PCA), principal component regression (PCR), partial least squares regression analysis (PLS) and artificial neural networks (ANN) [\u003cspan citationid=\"CR24\" class=\"CitationRef\"\u003e24\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eSmartphone-based image analysis can be applied to determine the iodine value of vegetable oils using Wijs reagent (a solution of iodine monochloride in glacial acetic acid) and a starch solution. Obtaining the solution in blue, image analysis is performed in the RGB sharp system and compared with the classical titration method [\u003cspan citationid=\"CR25\" class=\"CitationRef\"\u003e25\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eUnfortunately, there is not much data available in the literature related to the use of smartphone for the determination of vegetable oils, thus more research in food chemistry is needed.\u003c/p\u003e \u003cp\u003eIn order to better automate and obtain data from the RGB colour system, an algorithm is needed to facilitate the input and processing of the obtained data. As one of such solutions, as well as the goals of this research, is to create an algorithm in the Python programming language that can be integrated into various applications.\u003c/p\u003e"},{"header":"Materials and methods","content":"\u003cp\u003ePython Algorithm development method based on the data, from our other research scientific paper on the determination of total phenols in 11 vegetable oil (Linseed, Hemp, Sea buckthorn, Grape seed, Corn, Sunflower, Milk thistle, Rapeseed, Rice bran, Olive, Macadamia nut samples using the analysis of smartphone images in the RGB colour system, where Agilent Cary 60 UV/VIS spectrophotometer (Agilent Technologies, Inc., USA) was used for comparison with measurements obtained by a Huawei P30 Lite smartphone (Huawei Technologies Co., Ltd., China) [\u003cspan\u003e26\u003c/span\u003e].\u003c/p\u003e\n\u003cp\u003ePrinciple of colorimetric image acquisition: A Huawei P30 Lite smartphone was placed horizontally in front of the open-side case at a distance of 12 cm from PS 2.5 mL disposable macro cuvettes (BrandTech Scientific, Inc., US) with 96% ethanol (compare oils), vegetable oil samples, and Folin - Ciocalteu phenol reagent. Colorimetric analysis was taken using a smartphone colorimetric application with RGB colour system according to Fig.\u0026nbsp;\u003cspan\u003e1\u003c/span\u003e illustration.\u003c/p\u003e\n\u003cp\u003eAnalysis of acquired images and calculations: Total phenolic content was calculated using a gallic acid calibration curve and the results were expressed as the equivalent of gallic acid mg kg\u003csup\u003e\u0026minus;\u0026thinsp;1\u003c/sup\u003e (mg GAE kg\u003csup\u003e\u0026minus;\u0026thinsp;1\u003c/sup\u003e).\u003c/p\u003e\n\u003cp\u003e1) colour values were calculated for the images obtained from the smartphone application \u0026quot;Colour Picker\u0026quot; using the RGB colour system according to the equation described by Jansons and Meija [\u003cspan\u003e27\u003c/span\u003e]. The equation used was modified by fitting it to the obtained average colour values for the following colours: red (Ravg), green (Gavg) and blue (Bavg) according to equations 1, 2 and 3.\u003c/p\u003e\n\u003cdiv\u003e\n \u003ctable id=\"Taba\" border=\"1\"\u003e\n \u003ccolgroup cols=\"2\"\u003e\u003c/colgroup\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003e\u003cspan\u003e\u003cspan\u003e\\({\\text{R}}_{\\text{a}\\text{v}\\text{g}} = \\frac{{\\sum }_{\\text{i}=1}^{\\text{n}}{\\text{R}}_{\\text{i}}}{\\text{n}}\\)\u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003e(1)\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cspan\u003e\u003cspan\u003e\\({\\text{G}}_{\\text{a}\\text{v}\\text{g}} = \\frac{{\\sum }_{\\text{i}=1}^{\\text{n}}{\\text{G}}_{\\text{i}}}{\\text{n}}\\)\u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e(2)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cspan\u003e\u003cspan\u003e\\({\\text{B}}_{\\text{a}\\text{v}\\text{g}} = \\frac{{\\sum }_{\\text{i}=1}^{\\text{n}}{\\text{B}}_{\\text{i}}}{\\text{n}}\\)\u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e(3)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n\u003c/div\u003e\n\u003cp\u003e2) The average colour value of Ravg, Gavg and Bavg was converted to absorbance using the modified Baer-Lambert Eq.\u0026nbsp;\u003cspan\u003e4\u003c/span\u003e [\u003cspan\u003e3\u003c/span\u003e].\u003c/p\u003e\n\u003cdiv id=\"Equ1\"\u003e\n \u003cdiv id=\"FileID_Equ1\" name=\"EquationSource\"\u003e$$\\text{A}\\text{b}\\text{s}= -\\text{log}\\left(\\frac{\\text{I}}{{\\text{I}}_{0}}\\right)$$\u003c/div\u003e\n \u003cdiv\u003e4\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003ewhere:\u003c/p\u003e\n\u003cp\u003eI \u0026ndash;averaged value of R\u003csub\u003eavg\u003c/sub\u003e, G\u003csub\u003eavg\u003c/sub\u003e or B\u003csub\u003eavg\u003c/sub\u003e\u003c/p\u003e\n\u003cp\u003eI\u003csub\u003e0\u003c/sub\u003e \u0026ndash;average value of RGB colour module of 96% ethanol solution\u003c/p\u003e\n\u003cp\u003e3) Total phenolic content (TPC) concentration calculation from light intensity of red colour model (CR(TPC)), Eq.\u0026nbsp;5.\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003e\u0026nbsp;\u003cspan\u003e\\({\\text{C}}_{\\text{R}\\left(\\text{T}\\text{P}\\text{C}\\right)}= \\frac{{(\\text{A}\\text{b}\\text{s}}_{\\text{R}}-0.0038)}{0.0056} =\\)\u003c/span\u003e\u0026nbsp;\u003c/span\u003e(mg GAE kg\u003csup\u003e-1\u003c/sup\u003e oil)(5)\u003c/p\u003e\n\u003cp\u003eThe basis of the software development is the use of the Python programming language, so that the RGB colour module data obtained on the smartphone can be entered and processed in Microsoft Windows 10, 11 and web browser environments.\u003c/p\u003e\n\u003cp\u003eEquipment used: The portable computer Huawei MateBook D 15 (2019 model, Huawei Technologies Co. Ltd., China) was used for the development of the Python programming language with the following specification:\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003e1. Processor: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx 2.10 GHz\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e2. Random access memory (RAM) : 8.00 GB\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e3. Graphics card: AMD Radeon(TM) Vega 8 Graphics\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e4. Hard disk: Samsung MZVLB256HBHQ-00000\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e5. Operating system: 64-bit Windows 10 Home, Windows Pack 120.2212.4190.0\u003cbr\u003e\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003eWeb browser used: free open-source web browser Mozilla Firefox ver. 116.0.2 (64-bit) 2023 (Mozilla Foundation, Mountain View, California).\u003c/p\u003e\n\u003cp\u003eKaggle web app that allows you to explore and build Phyton models in a web environment (\u003cspan\u003e\u003cspan\u003ehttps://www.kaggle.com\u003c/span\u003e\u003c/span\u003e).\u003c/p\u003e\n\u003cp\u003eThe complete code of the Python program for the analysis of smartphone images for the determination of total phenols is available in GitHub - \u003cspan\u003e\u003cspan\u003ehttps://github.com/\u003c/span\u003e\u003c/span\u003e (Project name: Analysis of smartphone images for the determination of total phenols).\u003c/p\u003e"},{"header":"Results and discussion","content":"\u003cp\u003eThe developed algorithm allows image data obtained on a smartphone to be converted into absorption in the RGB colour system, to obtain calibration curves (for the determination of total phenols) and to calculate the concentration of total phenolic substances of the analysed vegetable oil samples. Such an open-source program can be used with the Python Integrated Development Environment (IDLE (Python 3.11)) installed on a computer, or with the web-based online programming tool Kaggle (\u003cspan\u003e\u003cspan\u003ehttps://www.kaggle.com\u003c/span\u003e\u003c/span\u003e). The advantage of programming in the Kaggle environment is that there is no need for Python software on Windows, iOS, Linux or any other operating system, and compared to MS Excel, the Python programming language has several advantages, as it allows for more complex calculations, offers a wide range of specialized libraries that directly designed for complex algorithms, calculations and analyses of scientific data, such as NumPy, SciPy, Pandas, etc., larger data volume support, higher reproducibility allowing to automate calculation processes, and can also be integrated into other programming environments, such as C++, Java, HTML and others, or integrate into Android and iOS apps.\u003c/p\u003e\n\u003cp\u003eIf the user does not have the possibility to insert the mentioned Python algorithm code into the Python development environment (IDLE (Python 3.11)), then it is possible to insert the complete full algorithm code from GitHub into the environment of the online programming tool Kaggle (\u003cspan\u003e\u003cspan\u003ehttps://www.kaggle.com\u003c/span\u003e\u003c/span\u003e), according to Fig. \u003cspan\u003e2\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eIn the analysis of images obtained on a smartphone, the following steps of the Python code algorithm structure are used for the determination of total phenols in vegetable oils in the RGB colour system with the analysis of images obtained on a smartphone (Fig. \u003cspan\u003e3\u003c/span\u003e.).\u003c/p\u003e\n\u003cp\u003eThe developed Python algorithm can be divided into 6 stages: 1. required libraries, 2. input and processing of user data, 3. absorption calculations, 4. linear regression and drawing calibration curves 5. data analysis of the vegetable oil samples to be analysed, related to the determination of total phenols and 5. saving the obtained result data in MS Excel file format.\u003c/p\u003e\n\u003cp\u003eThe following NumPy (numpy), Pandas (pandas), Matplotlib (matplotlib.pyplot) and SciPy (scipy.stats.linregress) libraries were used for the Python algorithm code obtained in the research. In order to provide access to the mentioned Python libraries and the resulting algorithm to work without errors, the following code given in Table \u003cspan\u003e1\u003c/span\u003e should be specified. If the mentioned Python libraries are not installed in the operating system, it is necessary to install them by specifying the code in Terminal: pip or pip3 install numpy pandas matplotlib scipy.\u003c/p\u003e\n\u003cdiv\u003e\u0026nbsp;\u003ctable id=\"Tab1\" border=\"1\"\u003e\n \u003ccaption language=\"En\"\u003e\n \u003cdiv\u003eTable 1\u003c/div\u003e\n \u003cdiv\u003e\n \u003cp\u003e\u003cstrong\u003eLibraries required for developing Python code algorithm\u003c/strong\u003e\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cem\u003e# Required Libraries\u003c/em\u003e\u003c/p\u003e\n \u003cp\u003eimport numpy as np\u003c/p\u003e\n \u003cp\u003eimport pandas as pd\u003c/p\u003e\n \u003cp\u003eimport matplotlib.pyplot as plt\u003c/p\u003e\n \u003cp\u003efrom scipy.stats import linregress\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n\u003c/div\u003e\n\u003cp\u003eFor the development of the code, it is necessary to include the mentioned libraries, because the data of the RGB colour system data, obtained using a smartphone, needs to be mathematically processed. One of Python scientific programming library is NumPy (numpy). NumPy-developed algorithm code provides the efficient mathematical operations needed to convert user-derived and input RGB and concentration data into arrays, thus facilitating subsequent absorption calculations. Using Pandas (pandas) data is processed and analysed, thereby manipulating DataFrame objects that facilitate data storage, access and analysis in a structured way. In this algorithm, pandas is used to store results such as R\u003csup\u003e2\u003c/sup\u003e values and linear regression equations and concentrations of vegetable oil samples to be analysed. To obtain data visualization, as a third library, Matplotlib (matplotlib.pyplot) is needed, which displays the resulting calibration curves for individual R, G, B and RGB, RG, RB, GB colour systems, as well as relationships of visually evaluated data. The last used library is SciPy (scipy.stats), which provides the linregress function for linear regression analysis, which allows calculation of the slope and the coefficient of determination (R\u003csup\u003e2\u003c/sup\u003e).\u003c/p\u003e\n\u003cp\u003eIn order to perform a full-fledged operation of the algorithm, the input function is required in the code, which allows you to enter data, store them in lists and turn them into NumPy arrays in the subsequent operation (Table \u003cspan\u003e2\u003c/span\u003e).\u003c/p\u003e\n\u003cp\u003eThe \u0026quot;input\u0026quot; function shown in the Table \u003cspan\u003e2\u003c/span\u003e at the beginning of the code requires the user to enter the required used concentration, which in the determination of total phenols is expressed as mg GAE L\u003csup\u003e\u0026minus;\u0026thinsp;1\u003c/sup\u003e, thereby ensuring that all obtained results in the subsequent output of the algorithm would be indicated correctly, comprehensibly and accordingly interpretable. This input stage is designed so that the user can also enter other desired concentrations for analysis. As, for example, when other phenolic compounds are used to determine total phenols as Gallic acid equivalents. After obtaining the measurement unit, it is important to enter Io, or the value of the RGB colour system of the comparison solution, and the number of points required to obtain the calibration curve. After entering the number of calibration points, it is essential to create empty lists for the entered concentrations and the values of the RGB or red (R), green (G) and blue (B) colour system in order to be able to perform further calculations and analyses related to the creation of the calibration curve.\u003c/p\u003e\n\u003cp\u003eIn addition, the RGB colour system is created in the algorithm code in such a way that the values of each colour system can be entered separately. Inputs are converted to NumPy arrays, which requires the np.array() function, which accepts existing lists and transforms them. Each list is given a new name corresponding to the corresponding data type (concentrations, R, G and B). In the Table \u003cspan\u003e2\u003c/span\u003e the list \u0026quot;concentration\u0026quot; is converted to a NumPy array named \u0026quot;concentration\u0026quot;. This activity for the determination of total phenols in vegetable oils is necessary to perform mathematical calculations on the data using the speed of the NumPy library. Transforming the data into these arrays improves the efficiency and accuracy of data processing, especially when it is necessary to calculate absorbance calculations that involve mathematical manipulations of the data. This ensures in action that the data is prepared and ready for further processing and interpretation.\u003c/p\u003e\n\u003cp\u003eTaking into account the RGB and I0 values entered by the user, the \u0026quot;-np.log()\u0026quot; function is used to calculate the absorption (Table \u003cspan\u003e3\u003c/span\u003e).\u003c/p\u003e\n\u003cdiv\u003eIn order to calculate the absorption values for each channel of the colour system (R, G and B), they are divided by the I0 value of the comparison solution by performing a logarithmic calculation according to the Beer-Lambert law. \u0026quot;print()\u0026quot; function is used to output the obtained data to the screen. Such a function is necessary so that the user can see how the calculated absorbance values change depending on the entered concentrations and check that the data looks correct before further analysis.\u003c/div\u003e\n\u003cp\u003eIt is essential not only to obtain the absorbances obtained for each red (R), green (G) or blue (B) colour, but also to use the values obtained from the previous code to obtain all possible data for the combined colour channels, as red-green-blue (RGB ), red-green (RG), red-blue (RB) and green-blue (GB) (Table \u003cspan\u003e3\u003c/span\u003e).\u003c/p\u003e\n\u003cp\u003eThe calibration data used in the algorithm consists of the concentration and their corresponding absorption values in each of the RGB colour channels, therefore, using these data, the algorithm performs a linear regression analysis in accordance with the code given in the Table \u003cspan\u003e4\u003c/span\u003e.\u003c/p\u003e\n\u003cdiv\u003eTo perform linear regression analysis, linregress from the SciPy library is a function that provides the calculation of slope, intercept and coefficient of determination (R\u003csup\u003e2\u003c/sup\u003e). For each colour channel, the following calculation is performed, which determines a linear model for the relationship between concentration and absorbance.\u003c/div\u003e\n\u003cp\u003eThe data obtained after linear regression requires a part of the algorithm code (Table \u003cspan\u003e5\u003c/span\u003e), which helps visually perceive and display the data, after which the accuracy of the method for determining total phenols in vegetable oil can be assessed and possible data anomalies identified.\u003c/p\u003e\n\u003cdiv\u003eTo implement this part of the code, we need the \u0026quot;plot_calibration_curve\u0026quot; function of the Matplotlib library, which allows visual representation of data and analytical results. In this case \u0026apos;plt\u0026apos; is used to plot calibration curves where absorbance values are plotted against concentration. A separate calibration curve is created for each R, G, B and combined RGB, RG, RB, and GB colour system channels, their distinct colours, and the name of the resulting graph is created.\u003c/div\u003e\n\u003cp\u003eAfter the obtained visualization, it is necessary to create a data structure (Table \u003cspan\u003e6\u003c/span\u003e), which includes the values obtained in the calculation of the coefficient of determination (R\u003csup\u003e2\u003c/sup\u003e) and linear regression equations for each colour (R, G, B) and combined colour systems (RGB, RG, RB and GB) channels.\u003c/p\u003e\n\u003cdiv\u003eThe \u0026quot;pandas.DataFrame\u0026quot; function is used in the algorithm code, which allows you to organize and store data in the system by creating a table-like structure with several rows and columns, as well as the obtained table structure and data are output with the help of \u0026quot;print\u0026quot;.\u003c/div\u003e\n\u003cp\u003eWhen all the steps related to the creation of the calibration curve and the values obtained in the calculation of the coefficient of determination (R\u003csup\u003e2\u003c/sup\u003e) and the linear regression equations are completed, it is necessary to supplement the algorithm code with an important part of the second condition, which refers to the analysis of the RGB colour system of the obtained images of the sample or vegetable oils and total phenols calculations. In order to ensure this part of the code, it is necessary to create such input conditions where it is possible to enter the number of samples to be analysed and choose which colour channel to perform concentration calculations (Table \u003cspan\u003e7\u003c/span\u003e).\u003c/p\u003e\n\u003cdiv\u003eIn this part of the algorithm code, the user is required to enter numerical values indicating how many vegetable oil samples will be analysed and to choose which colour (R, G, B) and combined colour (RGB, RG, RB and GB) system channels to perform concentration calculations. The \u0026quot;n_unknow_samples\u0026quot; and \u0026quot;channels\u0026quot; part of the \u0026quot;input\u0026quot; function help to implement this step.\u003c/div\u003e\n\u003cp\u003eEntering the number of vegetable oil samples is necessary so that the algorithm knows how many sample data to process, as well as how many times to repeat the concentration calculations. On the other hand, when choosing a channel of the colour system or their combined channels, the user is offered the option to perform concentration calculations according to which channel of the colour system, indicating the relevant letters or their combinations - R, G, B, RGB, RG, RB or GB. This choice is mostly related to previously obtained values obtained in the calculation of the coefficient of determination (R\u003csup\u003e2\u003c/sup\u003e) and linear regression equations. The user makes this choice by evaluating which RGB channel of the colour system or their combinations has the highest accuracy, tending closer to the value 1. An input is added to an existing operation to assign a name to each entered auge oil analysable sample, after which to perform further recognition during data processing. A fragment of the input code is given in Table \u003cspan\u003e7\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eWhen choosing the number of entered analysed sample, RGB channel of the colour system or their combination and assigning a name, the algorithm needs to know their values by requesting them to be entered by calling the \u0026quot;input\u0026quot; function in accordance with Table \u003cspan\u003e8\u003c/span\u003e.\u003c/p\u003e\n\u003cdiv\u003eIn accordance with the Table \u003cspan\u003e8\u003c/span\u003e, and in order to obtain the data of the calibration curves, it is necessary to calculate the absorption values of the analysed vegetable oil samples. An algorithm that uses the obtaining absorbance value and the calibration curve to calculate the total phenolic concentrations of the analysed vegetable oil samples.\u003c/div\u003e\n\u003cp\u003eAs the last final stage for the creation of the algorithm, the output of the obtained analysed data indicating the used concentrations, as well as the input of the document name, saving the data if needed in Microsoft Excel format (Table \u003cspan\u003e9\u003c/span\u003e).\u003c/p\u003e\n\u003cdiv\u003eAfter the algorithm has calculated the concentration of total phenols for each vegetable oil sample to be analysed, the results are output to the user, which include the name of the sample, the corresponding concentration values and information about the unit of measurement \u0026ndash; mg GAE \u003csup\u003eL\u0026minus;1\u003c/sup\u003e. When using Pandas \u0026quot;DataFrame\u0026quot;, a data structure is created in which the results are stored, numbering according to the style of the table, so that the numbering starts from 1. The created list of results is saved in the table in Microsoft Excel document format using the Pandas function \u0026quot;to_excel\u0026quot;. When entering the document name, an indication is added that the existing data will be saved in \u0026ldquo;.xlsx\u0026rdquo; format, thus allowing the user to use the data on operating systems that do not have the ability to run Python software code.\u003c/div\u003e\n\u003cp\u003eThe developed Python software language code algorithm can be used not only for the determination of total phenols in vegetable oils by smartphone image analysis, but also for the analysis of other plants or chemicals that use light-sensitive sensors capable of detecting the RGB colour system.\u003c/p\u003e"},{"header":"Conclusions","content":"\u003cp\u003eThe developed algorithm offers a method for determining the concentration of total phenols in vegetable oil samples using data obtained in the RGB colour system from smartphone images. This approach combines modern technology with scientific methods using popular programming languages and tools such as Python, NumPy, Pandas, Matplotlib and SciPy. The algorithm can be used both locally in a Python development environment (e.g. IDLE Python 3.11) and in online programming platforms such as Kaggle (\u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://www.kaggle.com/\u003c/span\u003e\u003c/span\u003e). It provides more accessibility and flexibility for different users, regardless of their operating system type. Compared to other data processing tools such as MS Excel, Python offers more sophisticated data processing and analysis capabilities, support for larger data volumes, and higher reproducibility.\u003c/p\u003e\n\u003cp\u003eThe algorithm is structured in six basic stages, starting with importing the necessary libraries (NumPy, Pandas, Matplotlib and SciPy), entering and processing user data, absorbance calculations, drawing linear regression and calibration curves, processing the data to be analysed, and ending with saving the data in MS Excel format.\u003c/p\u003e\n\u003cp\u003eThis algorithm can be adapted and used in a wider context, such as in the analysis of other plant extracts or chemicals that use light-sensitive sensors capable of detecting the RGB colour system. If necessary, it can also be applied and transformed into another colour system, CMYK, or by performing other chemical analyses based on a spectrophotometer or a colorimeter, such as for the determination of antiradical activity with DPPH and others. This opens up opportunities for wider research and data analysis methods in various in scientific fields.\u003c/p\u003e"},{"header":"Declarations","content":"\u003cp\u003e\u003cstrong\u003eAvailability and requirements\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eProject name:\u0026nbsp;Analysis of smartphone images for the determination of total phenols in Vegetable oils\u003c/p\u003e\n\u003cp\u003e\u0026middot; \u0026nbsp; \u0026nbsp; \u0026nbsp; Project home page: https://github.com/SanitaVucane/Analysis-of-Smartphone-images-in-RGB-colour-system\u003c/p\u003e\n\u003cp\u003e\u0026middot; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;Operating system(s): e.g. Platform independent\u003c/p\u003e\n\u003cp\u003e\u0026middot; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;Programming language: e.g. Python\u003c/p\u003e\n\u003cp\u003e\u0026middot; \u0026nbsp; \u0026nbsp; \u0026nbsp; Other requirements: e.g. NumPy, \u0026nbsp;Pandas, \u0026nbsp;Matplotlib and \u0026nbsp;SciPy\u003c/p\u003e\n\u003cp\u003e\u0026middot; \u0026nbsp; \u0026nbsp; \u0026nbsp; License: e.g. GNU GPL version 3.\u003c/p\u003e\n\u003cp\u003eAny restrictions to use by non-academics: e.g. licence needed\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eEthics approval and consent to participate\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eNot applicable.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eConsent for publication\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eNot applicable.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAvailability of data and materials\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe datasets used and/or analysed during the current study are available from the corresponding author on reasonable request. Python script can be found at https://github.com/SanitaVucane/Analysis-of-Smartphone-images-in-RGB-colour-system.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCompeting interests\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe authors declare that they have no competing interests.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFunding\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eNot applicable.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAuthors\u0026apos; contributions\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eI.C. - \u0026nbsp;author of the idea and project manager, developed the research concept and managed the development of Python algorithms.\u003c/p\u003e\n\u003cp\u003eS.V. - performed data collection and processing, experimental measurements and analysis, repeated algorithm testing.\u003c/p\u003e\n\u003cp\u003eM.S. - performed the literature review, development of the methodology and creation of the final version of the manuscript.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAcknowledgements\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eNot applicable.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n\u003cli\u003eMatter L (2008) Food and Environmental Analysis by Capillary Gas Chromatography: Hints for Practical Use. Wiley, H\u0026uuml;thing Verlag, Heidelberg.\u003c/li\u003e\n\u003cli\u003eSkoog DA, Holler FJ, Crouch SR (2018) Principles of Instrumental Analysis. 7th ed. Cengage Learning, Boston.\u003c/li\u003e\n\u003cli\u003eBonner PLR, Hargreaves AJ (2022) Basic Bioscience Laboratory Techniques. A Pocket Guide. Wiley, Oxford.\u003c/li\u003e\n\u003cli\u003eMasawat P, Harfield A, Namwong A. (2015). An iPhone-based digital image colorimeter for detecting tetracycline in milk. Food Chemistry 184:23\u0026ndash;29. https://doi.org/10.1016/j.foodchem.2015.03.089\u003c/li\u003e\n\u003cli\u003eRoda A, Michelini E, Zangheri M, Di Fusco M, Calabria D, Simoni P (2016). Smartphone-based biosensors: A critical review and perspectives. TrAC Trends in Analytical Chemistry 79:317\u0026ndash;325. https://doi.org/10.1016/j.trac.2015.10.019\u003c/li\u003e\n\u003cli\u003eLevin S, Krishnan S, Rajkumar S, Halery N, Balkunde P (2016) Monitoring of fluoride in water samples using a smartphone. Science of The Total Environment 551\u0026ndash;552:101\u0026ndash;107. https://doi.org/10.1016/j.scitotenv.2016.01.156\u003c/li\u003e\n\u003cli\u003eSong W, Song Z, Vincent J, Wang H, Wang Z (2020) Quantification of extra virgin olive oil adulteration using smartphone videos. Talanta 216:120920. https://doi.org/10.1016/j.talanta.2020.120920\u003c/li\u003e\n\u003cli\u003eDas AJ, Wahi A, Kothari I, Raskar R (2016) Ultra-portable, wireless smartphone spectrometer for rapid, non-destructive testing of fruit ripeness. Scientific Reports 6: 32504. https://doi.org/10.1038/srep32504 \u003c/li\u003e\n\u003cli\u003eFranca AS, Oliveira LS (2021) Applications of smartphones in food analysis. In: Smartphone-Based Detection Devices. Elsevier, Amsterdam, pp 249-268.\u003c/li\u003e\n\u003cli\u003eRhyne TM (2017) Applying Color Theory to Digital Media and Visualization. CRC Press, NewYork.\u003c/li\u003e\n\u003cli\u003eBueno L, Meloni GN, Reddy SM, Paix\u0026atilde;o TRLC (2015) Use of plastic-based analytical device, smartphone and chemometric tools to discriminate amines. RSC Advances 26(5):20148\u0026ndash;20154. https://doi.org/10.1039/C5RA01822F\u003c/li\u003e\n\u003cli\u003eLedesma CM, Krepsky LM, Borges EM (2019) Using a Flatbed Scanner and Automated Digital Image Analysis To Determine the Total Phenolic Content in Beer. Journal of Chemical Education 96(10):2315\u0026ndash;2321. https://doi.org/10.1021/acs.jchemed.8b01037\u003c/li\u003e\n\u003cli\u003eApichai S, Thajee K, Pattananandecha T, Saenjum C, Grudpan K (2021) A Simple Minimized System Based on Moving Drops for Antioxidant Analysis Using a Smartphone. Molecules 22:26(19):5744. https://doi.org/10.3390/molecules26195744 \u003c/li\u003e\n\u003cli\u003eNguyen HV, Jakmunee J, Youngvises N, Preechaburana P (2022) Determination of Both Total Phenolic Compound and Antioxidant Capacity of Herbal Teas Using Smartphone Digital Imaging. Chiang Mai Journal of Science 49(2):420-433. https://doi.org/10.12982/CMJS.2022.030 \u003c/li\u003e\n\u003cli\u003eCalabria D, Guardigli M, Severi P, Trozzi I, Pace A, Cinti S, Zangheri M, Mirasoli MA (2021) Smartphone-Based Chemosensor to Evaluate Antioxidants in Agri-Food Matrices by In Situ AuNP Formation. Sensors 21(16):5432. https://doi.org/10.3390/s21165432 \u003c/li\u003e\n\u003cli\u003eZhu H, Yaglidere O, Su T, Tseng D, Ozcan A (2011). Cost-effective and compact wide-field fluorescent imaging on cell phone. Lab Chip 11(2):315-322. https://doi.org/10.1039/c0lc00358a \u003c/li\u003e\n\u003cli\u003eTena N, Garcia-Gonzalez DL, Aparicio R (2009) Evaluation of Virgin Olive Oil Thermal Deterioration by Fluorescence Spectroscopy. Journal of Agricultural and Food Chemistry 57(22):10505\u0026ndash;10511. https://doi.org/10.1021/jf902009b \u003c/li\u003e\n\u003cli\u003eHakonen A, Beves JE (2018) Hue Parameter Fluorescence Identification of Edible Oils with a Smartphone. ACS sensors 3(10):2061-2065. https://doi.org/10.1021/acssensors.8b00409 \u003c/li\u003e\n\u003cli\u003eMilanez KDTM, Pontes MJC (2014) Classification of edible vegetable oil using digital image and pattern recognition techniques. Microchemical Journal 113:10-16. https://doi.org/10.1016/j.microc.2013.10.011\u003c/li\u003e\n\u003cli\u003eNikolova K, Zlatanov M, Eftimov T, Brabant D, Yosifova S, Halil E, Antova G, Angelova M (2014) Fluoresence Spectra From Vegetable Oils Using Violet And Blue Ld/Led Exitation And An Optical Fiber Spectrometer. International Journal of Food Properties 17(6):1211-1223. https://doi.org/10.1080/10942912.2012.700536 \u003c/li\u003e\n\u003cli\u003eRamadan MF (2019) Fruit Oils: Chemistry and Functionality. Springer, Cham. \u003c/li\u003e\n\u003cli\u003eZeb A (2021) Phenolic Antioxidants in Foods: Chemistry, Biochemistry and Analysis. Springer, Cham.\u003c/li\u003e\n\u003cli\u003eHassanien, M.F.R. (2023) Bioactive Phytochemicals from Vegetable Oil and Oilseed Processing By-products. Springer, Cham.\u003c/li\u003e\n\u003cli\u003eDa Silva LAL, Soares BRPL (2015) Spectrophotometric determination of the total flavonoid content in Ocimum basilicum L. (Lamiaceae) leaves. Pharmacognosy Magazine 11(41):96-101. https://doi.org/10.1080/10.4103/0973-1296.149721 \u003c/li\u003e\n\u003cli\u003ePeamaroon N, Jakmunee J, Moonrungsee N (2021) A Simple Colorimetric Procedure for the Determination of Iodine Value of Vegetable Oils Using a Smartphone Camera. Journal of Analysis and Testing 5:379-386. https://doi.org/10.1007/s41664-021-00168-x \u003c/li\u003e\n\u003cli\u003eVucane S, Cinkmanis I, Sabovics M (2022) Determination of total phenolic content in vegetable oils by smartphone-based image analysis. Journal of Hygienic Engineering and Design 38:199-203. \u003c/li\u003e\n\u003cli\u003eJansons E, Meija J (2002). Kļūdas kvantitatīvajās noteik\u0026scaron;anās (in Latvian) (Errors of quantitative determinations) Rasa ABC, Rīga.\u003c/li\u003e\n\u003c/ol\u003e"},{"header":"Table 2 To 9","content":"\u003cp\u003eTable 2 To 9 are available in the Supplementary Files section.\u003c/p\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Python algorithm, RGB colour system, Total phenols, Vegetable oils","lastPublishedDoi":"10.21203/rs.3.rs-3946138/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-3946138/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eIn this research, a Python algorithm was developed that calculated one of the total concentrations of phenol in vegetable oils using the RGB colour system. The algorithm converts data obtained in the RGB colour system into absorbance values using NumPy, Pandas, Matplotlib and SciPy libraries. It allows for complex data calculations and analyses that are particularly accurate and more efficient than traditional methods such as MS Excel.\u003c/p\u003e \u003cp\u003eAlgorithm development is divided into six stages: library import, user data input and processing, absorbance calculations, linear regression and calibration curve drawing, data analysis and saving results in Excel format. The algorithm offers flexible use in both local Python development environments and online platforms such as Kaggle (\u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://www.kaggle.com/\u003c/span\u003e\u003cspan address=\"https://www.kaggle.com/\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e).\u003c/p\u003e \u003cp\u003eIt can also be used in the analyses of other plant extracts or chemical substances, where interpretations of RGB colour system data are used as a basis. This algorithm opens up new possibilities in scientific data analysis by taking advantage of modern technology and programming language.\u003c/p\u003e","manuscriptTitle":"Python algorithm for Calculation of Total Phenolic Compounds in Vegetable Oils with Smartphone Image analysis","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2024-02-16 16:42:24","doi":"10.21203/rs.3.rs-3946138/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"d40e02dc-7b03-4b4a-89cf-0d4d23f5b1ca","owner":[],"postedDate":"February 16th, 2024","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2024-02-17T17:34:44+00:00","versionOfRecord":[],"versionCreatedAt":"2024-02-16 16:42:24","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-3946138","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-3946138","identity":"rs-3946138","version":["v1"]},"buildId":"qtupq5eGEP_6zYnWcrvyt","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.