**5. Conclusions**

An electronic eye based on lab-made instrumentation coupled with an image processing stage was developed to build a biologically inspired system capable of distinguishing between different tequila kinds, namely Silver, Aged, and Extra-aged. The system's repeatability was demonstrated by statistical analysis of the captured images using RGB information. Preliminary analysis employing PCA was relevant to observe data behavior and tequila class clustering mainly related to the aging process. LDA classifiers were built to recognize tequilas through the evaluated RGB absorbances using a LOOCV scheme to identify samples correctly.

Successful discrimination between tequilas was achieved by LDA, obtaining an overall classification rate of 90.02% for the three involved tequila classes mainly associated with their aging process. In the same way, the obtained sensitivity averaged was 0.90, whereas specificity was 0.96. Considering that the analyzed tequila samples are grouped in imbalanced classes, the kappa coefficient was calculated to corroborate that the performance measures were not over-optimistic. In this way, the kappa coefficient mean value was 0.87, which implies that models interpret reliable data without privileging any tequila class after adjustment.

These results show that the developed image analysis strategy based on obtained RGB information of compressed *jpeg* images, together with the PCA-LDA modeling stage, did not hamper the identification of tequilas by retaining enough color information of analyzed samples. Another notable point is that the method presented here agrees with the results reported by some previous studies that employ conventional analytical techniques such as UV-Vis and GC-MS combined with non-linear classification methods. In this sense, the developed electronic eye constitutes a reliable and easy-to-use tool that allows a quick and non-destructive analysis of tequilas to authenticate them according to the three main categories. Lastly, further research may be conducted to identifying fake or mixed tequilas applying the currently reported methodology based on color analysis.

**Author Contributions:** Conceptualization: J.M.G.; methodology and formal analysis: A.G.; validation: A.G. and D.B.; investigation: all authors; writing—original draft preparation, A.G.; writing— review and editing: D.B. and J.M.G. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** Authors would like to express their gratitude to the Mexican National Council of Science and Technology (CONACyT) for the financial support and fellowship for Anais Gómez.

**Conflicts of Interest:** The authors declare no conflict of interest.
