Objective.In recent years, wearable devices such as smartwatches and smart patches have revolutionized biosignal acquisition and analysis, particularly for monitoring electrocardiography (ECG). However, the limited power supply of these devices often precludes real-time data analysis on the patch itself.Approach.This paper introduces a novel Python package, tinyHLS (High Level Synthesis), designed to address these challenges by converting Python-based AI models into platform-independent hardware description language code accelerators. Specifically designed for convolutional neural networks, tinyHLS seamlessly integrates into the AI developer's workflow in Python TensorFlow Keras. Our methodology leverages a template-based hardware compiler that ensures flexibility, efficiency, and ease of use. In this work, tinyHLS is first-published featuring templates for several layers of neural networks, such as dense, convolution, max and global average pooling. In the first version, rectified linear unit is supported as activation. It targets one-dimensional data, with a particular focus on time series data.Main results.The generated accelerators are validated in detecting atrial fibrillation on ECG data, demonstrating significant improvements in processing speed (62-fold) and energy efficiency (4.5-fold). Quality of code and synthesizability are ensured by validating the outputs with commercial ASIC design tools.Significance.Importantly, tinyHLS is open-source and does not rely on commercial tools, making it a versatile solution for both academic and commercial applications. The paper also discusses the integration with an open-source RISC-V and potential for future enhancements of tinyHLS, including its application in edge servers and cloud computing. The source code is available on GitHub:https://github.com/Fraunhofer-IMS/tinyHLS.
Read full abstract