Edge AI Studio With Radar User Guide
Table of Contents
⚠️ Tools Compatibility
The user guide below is intended for use with Edge AI Studio’s Model Composer. Although the tool is PyTorch based, for direct interaction with training and compilation source files we recommend the use of the Jupyter Notebook version instead. The current example demos are only compatible with the IWRL6432BOOST evaluation module.
Overview
Machine learning (ML) can provide a more reliable and accurate classification for mmWave radar sensors, moving its capability for identification of objects closer to that of more expensive vision systems. This guide demonstrates the use Edge AI Studio in order to import data sets, define and train a model, compile a model optimized for TI mmWave Radar, and visualize the classification inferences in real-time.
This guide will focus on the Surface Classification Model Composer Extension to contextualize Model Composer’s use.
Why Use This Tool
The Model Composer tool can be used via downloading and installing Edge AI Studio, or by usage of Model Composer’s cloud version in TI’s Developer Zone.
The Radar Extension for Model Composer can be broken up into two parts
- The front-end GUI on your local system or cloud server
- The back-end PyTorch engine that handles API calls from the front end
Beginners can use the front-end GUI to familiarize themselves with Radar example projects. This can include Radar dataset visualization, radar model definition, radar model compilation, and more.
Intermediate users comfortable with the Radar and machine learning flow can begin interacting directly with the back-end. The training, compiling, and evaluating steps are not restricted to what is provided, and users can change out each individual step with your own methodology as desired.
With this format, all users can find significant use from this tool. From beginners to the concepts of Radar and machine learning, to the experts at both but need extra automation or integration tips in order to deploy the model to a TI mmWave firmware project.
Software Requirements
Model Composer
This is the list of requirements for working with only the Model Composer GUI, perfect for evaluation with example datasets and models.
| Tool | Version | Details |
|---|---|---|
| TI Radar Toolbox | Latest | Radar toolbox should be downloaded to access the demo’s source code and related collateral. Download Instructions in the readme file. |
| Model Composer | 1.4 | Either Desktop Version or Cloud Version |
| CCSTUDIO | 20.x + | Code Composer Studio Tool Page |
Back End Source
This is the list of requirements for working with the PyTorch backend, allowing every step of the process to be changed as desired.
| Tool | Version | Details |
|---|---|---|
| TI Radar Toolbox | Latest | Radar toolbox should be downloaded to access the demo’s source code and related collateral. Download Instructions in the readme file. |
| Model Composer | 1.4 | Either Desktop Version or Cloud Version |
| CCSTUDIO | 20.x+ | Code Composer Studio Tool Page |
| Python | 3.10.x | Python 3.10.11 Installation Website |
| TI Neural Network Compiler (NNC) | 1.3+ | TI NNC Download Site |
| TI ARM-CGT-CLANG | 2.1.2+ | TI ARM-CGT-CLANG Download Site |
Step-by-step
The following steps are for running the Edge AI Studio with Radar flow via Model Composer GUI
Create a project
Begin by creating a project. For a user’s first time, they should choose an example project to load in predetermined datasets and settings,
Capture Tab
The capture tab is used to import datasets and signify classes. With the Surface Classification Grass vs Not Grass example, the classes will be pre-set. Using CTRL + Left Click on each individual CSV allows for the viewing of the data. This example is expecting Range Profile TLV data (1D FFT averaged across all antennas).
Bring Your Own Data
TLV data can be captured using the mmWave Data Recorder. Once saved as a JSON, you can convert it to a CSV using tools such as Microsoft Excel. The only addition needed then is a column labeled “classification” which should be annotated with a numerical value.
Model Selection Tab
The model selection tab is used to select a model supported by the current example. Currently for surface classification there are two models, a Linear based ANN 3 layer model and a 4 layer model.
Training Tab
The training tab is used to set preprocessing hyper parameters which will then be used for the training loop. Example hyper parameters included are learning rate and batch size. The first and last range bin must be adjusted for the dataset being used. Once parameters are set, the training will begin and loop equal to the number of epochs set. Once finished, the model is exported in .onnx format.
Bring Your Own Data
The example dataset has had its range bins filtered to only the ranges under test prior. When collecting data with the mmWave Data Recorder, the range profile data will include everything the radar senses. Based on the chirp configuration used, only a subsection of ranges are desired to be classified with the rest being too far or too close to be applicable to the use case. With Model Composer, you can upload the unfiltered range profile and try out different range windows to tweak for performance.
Compile Tab
The compile tab is used to compile the ONNX model into C code optimized for the ARM core inside the mmWave Radar Sensor. Once completed the compilation artifacts can be exported and saved locally. The most important files will be the .h header and the .a compiled model.
Compilation Settings
For custom compilation settings, the desktop version of Edge AI Studio allows you to modify model_description.json, found within <MODEL_COMPOSER_DIR>\model-composer-extensions\radar-backend-x.x.x\model_description.json. The TVMC and TI ARM CLANG cross compiler options can be examined and changed under the "compilation" JSON key within "preset_descriptions"
Model Integration
All projects currently need manual integration of updated model files.The steps to model integration will slightly differ based on the example project. Surface classification can be found within the Radar Toolbox directory of RADAR_TOOLBOX_DIR\source\ti\examples\Industrial_and_Personal_Electronics\Robotics\surface_classification_ML_flow_pytorch\src
Instructions on how to import a Code Composer Studio Project
For example projects, all that is needed is the replacement of the existing model files found in the CCS project with the ones created inside Model Composer via copy and paste.
Once the project is compiled it must be flashed onto the device using a tool like Uniflash
Instructions on how to use Uniflash with mmWave
Live Preview Tab
Once the device is flashed, ensure the device has been set back to functional mode
Instructions on EVM Operational Modes
After confirming, begin by clicking the “Options” button near the top, you can choose a serial port. Ensure the serial port chosen is the sensor’s configuration port. You can double check which port this is by going to Device Manager and finding the one labeled XDS110 Class Application/User UART
Hitting “Ok” should now cause the hardware to be connected, and can be verified via ensuring it says Hardware Connected in the bottom left corner of the Model Composer window. Finally, click “Start Preview” and data should begin streaming in.
Need More Help?
- Learn about Radar fundamentals and types of data available using modules found in our Radar Academy
- For more details on the TI’s TVM Compiler, checkout the TI NNC User’s Guide
- Search for your issue or post a new question on the mmWave E2E forum