Inteligência artificial embarcada
experimentos com utilização de KNN em FPGAs
DOI:
https://doi.org/10.47734/rce.v5iFC.2687Palavras-chave:
aprendizado de máquina, inteligência artificial, sistemas embarcados, FPGAResumo
Este artigo explora a viabilidade de implementar o algoritmo K-Vizinhos Mais Próximos (KNN) em circuitos integrados do tipo FPGA. A metodologia adotada compreendeu o desenvolvimento inicial do algoritmo em linguagem Python e C, seguido pela implementação em linguagem VHDL para hardware FPGA. Foram realizados experimentos utilizando os conjuntos de dados Iris, Wine e Digitos, com variações nos parâmetros para avaliar o desempenho e a precisão. A implementação do KNN em FPGA, embora tenha demonstrado uma acurácia ligeiramente inferior à das versões em software, confirmou a viabilidade e a eficiência desta abordagem. A diferença na acurácia é atribuída à utilização de números de ponto fixo, que oferecem precisão limitada em comparação aos números de ponto flutuante usados em software. A análise do uso dos recursos dos sistemas sintetizados mostrou que a implementação em FPGA é viável e eficiente, sugerindo que dispositivos de hardware programável são uma opção promissora para o uso de algoritmos de aprendizado de máquina. Esses resultados indicam um caminho claro para futuras otimizações e a potencial implementação de algoritmos de aprendizado de máquina mais complexos em FPGAs, expandindo o escopo de aplicações avançadas.
Referências
AFIFI, S.; GHOLAMHOSSEINI, H.; SINHA, R. FPGA implementations of SVM classifiers: A review. SN computer science, v. 1, n. 3, 2020.
ALDAIR, A. A.; WANG, W. FPGA based adaptive neuro fuzzy inference controller for full vehicle nonlinear active suspension systems. International Journal of Artificial Intelligence & Applications, v. 1, n. 4, p. 1–15, 2010.
ALPHONSUS, E. R.; ABDULLAH, M. O. A review on the applications of programmable logic controllers (PLCs). Renewable and Sustainable Energy Reviews, v. 60, p. 1185–1205, 2016.
ALVES, T. et. al. OpenPLC: An open source alternative to automation. IEEE Global Humanitarian Technology Conference (GHTC 2014). Anais...IEEE, 2014.
ANDINA, J. J.; VALDES-PENA, M. D.; MOURE, M. J. Advanced features and industrial applications of FPGAs—A review. IEEE transactions on industrial informatics, v. 11, n. 4, p. 853–864, 2015.
ASANO, S.; MARUYAMA, T.; YAMAGUCHI, Y. Performance comparison of FPGA, GPU and CPU in image processing. 2009 International Conference on Field Programmable Logic and Applications. Anais...IEEE, 2009.
BADE, S. L.; HUTCHINGS, B. L. FPGA-based stochastic neural networks-implementation. Proceedings of IEEE Workshop on FPGA’s for Custom Computing Machines. Anais...IEEE Comput. Soc. Press, 2002.
BERTSIMAS, D.; KALLUS, N.; HUSSAIN, A. Inventory management in the era of big data. Production and operations management, v. 25, n. 12, p. 2006–2009, 2016.
BROWN S. et. al. Field-programmable gate arrays. 1992. ed. Nova Iorque, NY, USA: Springer, 1992.
CARDOZO, G. Inteligência artificial aplicada a sistemas supervisórios de automação residencial com internet das coisas. São Paulo - SP Brasil: Universidade Presbiteriana Mackenzie, 2021.
CHEN, C.; LIN, M..; LIU, C.. Edge computing gateway of the industrial internet of things using multiple collaborative microcontrollers. IEEE network, v. 32, n. 1, p. 24–32, 2018.
CHEN, R. et. al. MLoF: Machine Learning accelerators for the low-cost FPGA platforms. Applied sciences (Basel, Switzerland), v. 12, n. 1, p. 89, 2021.
CHOMBOOM, K. et. al. An empirical study of distance metrics for k-nearest neighbor algorithm. The Proceedings of the 2nd International Conference on Industrial Application Engineering 2015. Anais...The Institute of Industrial Applications Engineers, 2015.
COX, C. E.; BLANZ, W. E. GANGLION-a fast field-programmable gate array implementation of a connectionist classifier. IEEE journal of solid-state circuits, v. 27, n. 3, p. 288–299, 1992.]
DA COSTA, C.; MESQUITA, L.; PINHEIRO, E. Elemento De Logica Programavel Com VHDL E DSP. Teoria & Prática. [s.l.] Érica, 1 janeiro 2011.
DALZOCHIO, J. et. al. Machine learning and reasoning for predictive maintenance in Industry 4.0: Current status and challenges. Computers in industry, v. 123, n. 103298, p. 103298, 2020.
D’AMORE, R. VHDL - DESCRIÇÃO E SÍNTESE DE CIRCUITOS DIGITAIS. 2. ed. [s.l.] Ltc, 2012.
DRIESSENS, K.; DŽEROSKI, S. Combining model-based and instance-based learning for first order regression. Proceedings of the 22nd international conference on Machine learning - ICML ’05. Anais...New York, New York, USA: ACM Press, 2005.
DUTTA, D. L.; BHARALI, S. TinyML meets IoT: A comprehensive survey. Internet of Things, v. 16, n. 100461, p. 100461, 2021.
E. ALPAYDIN, C. K. Optical recognition of handwritten digits. UCI Machine Learning Repository, , 1998.
FISHER, R. A. Iris. UCI Machine Learning Repository, , 1936.
FIX, E.; HODGES, J. L. Discriminatory analysis. Nonparametric discrimination: Consistency properties. Revue internationale de statistique [International statistical review], v. 57, n. 3, p. 238, 1989.
FORINA, S. A. M. Wine. UCI Machine Learning Repository, , 1992. Disponível em: <http://dx.doi.org/10.24432/C5PC7J>
FREY, G.; LITZ, L. Formal methods in PLC programming. SMC 2000 Conference Proceedings. 2000 IEEE International Conference on Systems, Man and Cybernetics. “Cybernetics Evolving to Systems, Humans, Organizations, and their Complex Interactions” (Cat. No.00CH37166). Anais...IEEE, 2002.
FPGAKEY. How Does Configurable Logic Work? Disponível em: <https://www.fpgakey.com/tutorial/section67>. Acesso em: 27 maio. 2024.
GHOBAKHLOO, M. Industry 4.0, digitization, and opportunities for sustainability. Journal of cleaner production, v. 252, n. 119869, p. 119869, 2020.
GIANNOCCARO, I.; PONTRANDOLFO, P. Inventory management in supply chains: a reinforcement learning approach. International journal of production economics, v. 78, n. 2, p. 153–161, 2002.
GROLEAT, T.; ARZEL, M.; VATON, S. Stretching the edges of SVM traffic classification with FPGA acceleration. IEEE transactions on network and service management, v. 11, n. 3, p. 278–291, 2014.
HAMET, P.; TREMBLAY, J. Artificial intelligence in medicine. Metabolism: clinical and experimental, v. 69, p. S36–S40, 2017.
KIM, S. K. et. al. A highly scalable Restricted Boltzmann Machine FPGA implementation. 2009 International Conference on Field Programmable Logic and Applications. Anais...IEEE, 2009.
KORMANYOS, C. Fixed-Point Mathematics. Em: Real-time C++: Efficient object-oriented and template microcontroller programming. Berlin, Heidelberg: Springer Berlin Heidelberg, 2021. p. 329–351.
KULAGA, R., GORGÓN, M. FPGA implementation of decision trees and tree ensembles for character recognition in vivado hls. Image Processing & Communications, v. 19, n. 2–3, p. 71–82, 2014.
IEEE Standard for Verilog Hardware Description Language. Piscataway, NJ, USA: IEEE, 7 abr. 2008.
IEEE Standard for VHDL Language Reference Manual. Piscataway, NJ, USA: IEEE, 23 dez. 2019.
INTEL. DE10 Lite User Manual. Disponível em: <https://ftp.intel.com/Public/Pub/fpgaup/pub/Intel_Material/Boards/DE10-Lite/DE10_Lite_User_Manual.pdf>. Acesso em: 01 ago. 2024
INTEL. Intel Quartus Prime Standard Edition User Guides. Disponível em:<https://www.intel.com/programmable/technical-pdfs/qps-ugs.pdf>. Acesso em: 01 ago. 2024.
LEE, W. J. et. al. Predictive maintenance of machine tool systems using artificial intelligence techniques applied to machine condition data. Procedia CIRP, v. 80, p. 506–511, 2019.
LI, B. et. al. FTRANS: Energy-efficient acceleration of transformers using FPGA. Proceedings of the ACM/IEEE International Symposium on Low Power Electronics and Design. Anais...New York, NY, USA: ACM, 2020.
LI, J.-H. Cyber security meets artificial intelligence: a survey. Frontiers of Information Technology & Electronic Engineering, v. 19, n. 12, p. 1462–1474, 2018.
LI, Q. et. al. Implementing neural machine translation with bi-directional GRU and attention mechanism on FPGAs using HLS. Proceedings of the 24th Asia and South Pacific Design Automation Conference. Anais...New York, NY, USA: ACM, 2019.
MALKAUTHEKAR, M. D. (2013). Analysis of euclidean distance and manhattan distance measure in face recognition. Third International Conference on Computational Intelligence and Information Technology (CIIT 2013).
MOHRI, M.; ROSTAMIZADEH, A.; TALWALKAR, A. Foundations of machine learning. 2. ed. Londres, England: MIT Press, 2018.
MURPHY, R. R. Introduction to AI Robotics. 2. ed. Londres, England: MIT Press, 2019.
NAKAHARA, H. et. al. A lightweight YOLOv2: A binarized CNN with A parallel support vector regression for an FPGA. Proceedings of the 2018 ACM/SIGDA International Symposium on Field-Programmable Gate Arrays. Anais...New York, NY, USA: ACM, 2018.
O’DONOVAN, P. et. al. A fog computing industrial cyber-physical system for embedded low-latency machine learning Industry 4.0 applications. Manufacturing letters, v. 15, p. 139–142, 2018.
OKUBO, I. et. al. A lightweight transformer model using neural ODE for FPGAs. 2023 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW). Anais. IEEE, 2023.
OWAIDA, M.; ALONSO, G. Application partitioning on FPGA clusters: Inference over decision tree ensembles. 2018 28th International Conference on Field Programmable Logic and Applications (FPL). Anais...IEEE, 2018.
PARNELL, B. K.; BRYNER, R. Comparing and contrasting FPGA and microprocessor system design and development. Disponível em: <https://application-notes.digchip.com/077/77-43447.pdf>. Acesso em: 30 abr. 2024.
PEDREGOSA, F. et. al. Scikit-learn: Machine Learning in Python. 2012. Disponível em: <http://arxiv.org/abs/1201.0490>.
POURNADER, M. et. al. Artificial intelligence applications in supply chain management. International journal of production economics, v. 241, n. 108250, p. 108250, 2021.
RAY, P. P. A review on TinyML: State-of-the-art and prospects. Journal of King Saud University - Computer and Information Sciences, v. 34, n. 4, p. 1595–1623, 2022.
RICE, K. L. et. al. FPGA implementation of Izhikevich spiking neural networks for character recognition. 2009 International Conference on Reconfigurable Computing and FPGAs. Anais...IEEE, 2009.
ROSE, J. et. al. Architecture of field-programmable gate arrays: the effect of logic block functionality on area efficiency. IEEE journal of solid-state circuits, v. 25, n. 5, p. 1217–1225, 1990.
ROSE, J.; EL GAMAL, A.; Sangiovanni-Vincentelli, A. Architecture of field-programmable gate arrays. Proceedings of the IEEE. Institute of Electrical and Electronics Engineers, v. 81, n. 7, p. 1013–1029, 1993.
ROY, H. L. L.; Lecam, L.; Neyman, J. Proceedings of the fifth Berkeley symposium on mathematical statistics and probability; Vol. IV. Revue de l’Institut international de statistique, v. 37, n. 2, p. 230, 1969.
ROY, H. L. L.; LECAM, L.; NEYMAN, J. Proceedings of the fifth Berkeley symposium on mathematical statistics and probability; Vol. IV. Revue de l’Institut international de statistique, v. 37, n. 2, p. 230, 1969.
SAKURAI, R.; ZUCHI, J. D. AS REVOLUÇÕES INDUSTRIAIS ATÉ A INDÚSTRIA 4.0. Revista Interface Tecnológica, v. 15, n. 2, p. 480–491, 30 dez. 2018.
SAQIB, F. et. al. Pipelined Decision Tree Classification Accelerator Implementation in FPGA (DT-CAIF). IEEE transactions on computers. Institute of Electrical and Electronics Engineers, v. 64, n. 1, p. 280–285, 2015.
SARKER, I. H. Machine learning: Algorithms, real-world applications and research directions. SN computer science, v. 2, n. 3, 2021.
SCHWAB, K. A Quarta Revolução Industrial. São Paulo - SP: Edipro, 2018.
SHAVLIK, J.; DIETTERICH, T. (eds.). Readings in Machine Learning. [s.l.] Morgan Kaufmann, 1990.
TRIMBERGER, S. M. (Ed.). Field-programmable gate array technology. Nova Iorque, NY, USA: Springer, 2012.
VASWANI, A. et. al. Attention is all you need. 2017. Disponível em: <http://arxiv.org/abs/1706.03762>. Acesso em: 9 maio. 2024.
VENIERIS, S. I.; BOUGANIS, C.-S. FpgaConvNet: A framework for mapping convolutional neural networks on FPGAs. 2016 IEEE 24th Annual International Symposium on Field-Programmable Custom Computing Machines (FCCM). Anais...IEEE, 2016.
YATES, R. Fixed-Point Arithmetic: An Introduction. 23 ago. 2007.
YUEH, H.-P.; CHIANG, F.-K. AI and robotics in reshaping the dynamics of learning. British journal of educational technology: journal of the Council for Educational Technology, v. 51, n. 5, p. 1804–1807, 2020.
ZAMORANO, F. O. et. al. Efficient implementation of the backpropagation algorithm in FPGAs and microcontrollers. IEEE transactions on neural networks and learning systems, v. 27, n. 9, p. 1840–1850, 2016.
ZONTA, T. et. al. Predictive maintenance in the Industry 4.0: A systematic literature review. Computers & industrial engineering, v. 150, n. 106889, p. 106889, 2020.
Downloads
Publicado
Como Citar
Edição
Seção
Categorias
Licença
Copyright (c) 2025 Luís Otávio Amorim, Dr. Ricardo Pires, Gustavo Lucente

Este trabalho está licenciado sob uma licença Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Sob a égide da Lei º 9.610/1998 que altera, atualiza e consolida a legislação sobre direitos autorais no Brasil, a Revista Ciência em Evidência (RcE) ressalta a natureza de acesso livre da revista e exige que o(s) autor(es) que submetem manuscritos científicos a este periódico observe(m) princípios éticos e respeite(m) o direito de propriedade intelectual sobre a obra em tela.
Portanto, o(s) autor(es) declara(m)-se titular(es) da propriedade dos direitos autorais do manuscrito submetido e, por conseguinte, não infringe(m) direitos autorais, de imagem e outros direitos de propriedade de terceiros. Logo, assume(m) integral responsabilidade moral ou patrimonial, pelo seu conteúdo, perante terceiros.
Desse modo, o(s) autor(es) autoriza(m), cede(m) e transfere(m) à Revista Ciência em Evidência (RcE) o direito de edição, de publicação, de tradução para outro idioma e de reprodução por qualquer processo ou técnica do manuscrito submetido sem direito à exigência de qualquer tipo de remuneração.