Renesas
RZ/V AI

4.00

The best solution for
starting your AI applications.

Provided by Renesas Electronics Corporation




To keep you updated,
Watch our GitHub repository
Watch



This project is maintained by renesas-rz

Hosted on GitHub Pages — Theme by orderedlist

How to Re-train AI model



This page explains how to re-train the AI model of AI Applications using RZ/V AI Transfer Learning Tool.

Supported version: RZ/V AI Applications v4.00


Introduction

RZ/V AI Transfer Learning Tool (TLT) can re-train AI model used in RZ/V AI Applications with different datasets.

RZ/V AI Transfer Learning Tool has 5 Sections.
  • PROJECT DETAILS: Create new project or load an existing project.
  • ANNOTASTION: Create your own training data by labeling images.
  • DATASET: Load the dataset to be used for training.
  • TRAINING: Train the model on the selected dataset.
  • INFERENCE: Test the trained model.




Supported Functions of AI Applications

Function Name of AI Application TLT Project Name AI Model Task Type Download Dataset Name *1 Target product
in AI Application
RZ/V2L RZ/V2H
01_Head_count 01_Head_count_yolov3 YOLOv3 Object detection Head Count(140MB)
02_Line_crossing_object_counting 02_Line_crossing_object_counting_tinyyolov3 TinyYOLOv3 Object detection Line Cross Object Counting(141MB) -
02_Line_crossing_object_counting_yolov3 YOLOv3 Object detection Line Cross Object Counting(141MB) -
04_Safety_helmet_vest_detection 04_Safety_helmet_vest_detection_yolov3 YOLOv3 Object detection Safety Helmet Vest Detection(3.4GB) -
07_Animal_detection 07_Animal_detection_yolov3 YOLOv3 Object detection Animal Detection(1.83GB)
09_Human_gaze_detection 09_Human_gaze_detection_resnet18 ResNet18 Classification Human gaze detection resnet18(17GB)*2
09_Human_gaze_detection_tinyyolov2 TinyYOLOv2 Object detection Human gaze detection(4.43GB)*2
11_Head_count_topview 11_Head_count_topview_yolov3 YOLOV3 Object detection Head Count Topview(1.8GB)
12_Hand_gesture_recognition_v2 12_Hand_gesture_recognition_v2_resnet_18 ResNet18 Classification Hand Gesture Recognition Resnet(21.9GB) -
12_Hand_gesture_recognition_v2_tinyyolov3 TinyYOLOv3 Object detection Hand Gesture Recognition Tiny Yolo(21.9GB) -
12_Hand_gesture_recognition_yolov3 YOLOv3 Object detection Hand gesture recognitionyolov3(160MB) -
13_Car_ahead_departure_detection 13_Car_ahead_departure_detection_tinyyolov3 TinyYOLOv3 Object detection Coco -
Q01_footfall_counter Q01_footfall_counter_tinyyolov3 TinyYOLOv3 Object detection Coco -
Q01_footfall_counter_yolov3 YOLOV3 Object detection Coco -
Q03_smart_parking Q03_smart_parking Custom model Classification Smart Parking(414MB) -
Q04_fish_classification Q04_fish_classification_resnet34 ResNet34 Classification Fish Classification(1.57GB) -
Q06_expiry_date_detection Q06_expiry_date_detection_tinyyolov3 TinyYOLOv3 Object detection Expiry Date Detection(1.32GB) -
Q06_expiry_date_detection_yolov3 YOLOv3 Object detection Expiry Date Detection(1.32GB) -
Q07_plant_disease_classification Q07_plant_disease_classification_resnet34 ResNet34 Classification Plant Disease(1.34GB) -
Q08_object_counter Q08_object_counter_animal_tinyyolov3 TinyYOLOv3 Object detection Object Counter Animal(6.97GB) -
Q08_object_counter_animal_yolov3 YOLOv3 Object detection Object Counter Animal(6.97GB) -
Q08_object_counter_coco_tinyyolov3 TinyYOLOv3 Object detection Coco -
Q08_object_counter_coco_yolov3 YOLOv3 Object detection Coco -
Q08_object_counter_vehicle_tinyyolov3 TinyYOLOv3 Object detection Object Counter Vehicle(1.5GB) -
Q08_object_counter_vehicle_yolov3 YOLOv3 Object detection Object Counter Vehicle(1.5GB) -
Q09_crack_segmentation Q09_crack_segmentation_unet UNet Segmentation Crack Segmentation(0.99GB)
Q10_suspicious_person_detection Q10_suspicious_person_detection_tinyyolov3 TinyYOLOv3 Object detection Suspicious Person Detection(1.57GB) -
Q10_suspicious_person_detection_yolov3 YOLOv3 Object detection Suspicious Person Detection(1.57GB) -
Q11_fish_detection Q11_fish_detection_tinyyolov3 TinyYOLOv3 Object detection Fish Detection(700MB) -
Q11_fish_detection_yolov3 YOLOv3 Object detection Fish Detection(700MB) -
*1: Datasets will be downloaded automatically as needed.
*2: This file is temporarily unavailable for automatic download. To obtain the file, please contact Renesas Technical Support.

Unsupported Functions of AI Applications

The following Functions of AI Applications are NOT supported.
  • 03_Elderly_fall_detection
  • 05_Age_gender_detection
  • 06_Face_recognition_spoof_detection
  • 08_Hand_gesture_recognition
  • 10_Driver_monitoring_system
  • Q02_face_authentication
  • Q05_suspicious_activity


Installation

To start using RZ/V AI Transfer Learning Tool, PC that can display the desktop with the following environment is recommended.

Hardware

Description Specification
Linux OS Ubuntu 20.04 and above.
Processor Intel(R) Xeon(R) and above.
GPU Any GPU with CUDA.
Storage At least 100GB of free space is necessary.

Software

Description Specification
Python 3.10.5
Docker 27.0.3
Other software not listed above will be installed automatically when you install the tool.


Installation procedures

This chapter describes the installation procedure when using RZ/V AI Transfer Learning Tool alone.

Note If you use AI Navigator of e2 studio, the installation procedure is different, so please refer to AI Navigator Quick Start Guide.
  1. If you have not yet obtained RZ/V AI Transfer Learning Tool v4.00, click on the link below to download it.

    Download Link

  2. Put the downloaded tar file into a Linux PC and extract it using the following command in a terminal.
    tar -xzvf RTK0EF0178Z04000SJ_rzv-ai-tlt.tar.gz

    Make sure the following folders and files are generated after extracting the tar file.
    Tool File Structure
    Folder or File Name Description
    rzv_ai_tlt_v4.00/ Working directory.
    docs/ User's Manual.
  3. Change to tlt_backend directory and install the tool.
    cd RTK0EF0178Z04000SJ_rzv-ai-tlt/rzv_ai_tlt_v4.00/tlt_backend
    ./install_docker.sh

  4. Build the docker image and start the docker container.
    ./launch_tlt_service.sh

  5. Change to rzv_ai_tlt_v4.00 directory and launch the tool.
    cd ../
    ./start_rzv_ai_tlt_gui.sh

    RZ/V TLT Launch

    If the popup is "Docker container is up and running", click "OK" to start.
    Note If the docker container is not running, close the GUI and start the docker container with the following command.
    sudo docker restart tltdoc
    Once the container is started, please start again from step 4.


Re-train the AI model

Once the installation is complete, you can retrain the model.

Step 1: Create the TLT project

  1. Select PROJECT DETAILS.

    RZ/V TLT Project Details

  2. After selecting UPLOAD, upload the YAML file in UPLAOD YAML.
    The YAML files for existing projects are located at rzv_ai_tlt_v4.00/tlt_backend/assets/(any YAML file of TLT project)/config.yaml.
    This time, we uploaded rzv_ai_tlt_v4.00/tlt_backend/assets/Q03_smart_parking/config.yaml.

    RZ/V TLT Project Upload

  3. Set the project name and click SUBMIT SELECTION.
    (The project name must be different from any existing project.)
    If successful, Successfully created the task!! will be displayed.

    RZ/V TLT Project Loaded


Step 2: Create the custom dataset

In ANNOTATION, you can create custom datasets only for object detection.

RZ/V TLT Project Loaded

This time, since Q03_smart_parking is a classification model, we will skip ANNOTATION.
Please refer to the user's manual for how to use ANNOTATION.


Step 3: Load the dataset

  1. Select DATASET.

    RZ/V TLT Project Loaded

  2. Click Download Dataset and Select a dataset from the list.
    This time, we use Smart Parking.

    RZ/V TLT Project Loaded

  3. Click the Download button to download the dataset.
    (After it reaches 100%, it will take some time to unpack the downloaded file, depending on the size of the dataset.)

    RZ/V TLT Project Loaded

  4. Click SELECT DIRECTORY to select the dataset directory, and click NEXT.
    The downloaded dataset is located at rzv_ai_tlt_v4.00/tlt_backend/datasets/.
    This time, we use rzv_ai_tlt_v4.00/tlt_backend/datasets/Q03_smart_parking/.

    RZ/V TLT Project Loaded

  5. Set the image size to input to the model and select Augmentation.
    This time, leave the defaults and click NEXT.

    RZ/V TLT Project Loaded

  6. Set the dataloader parameters according to your PC environment.
    This time, leave the defaults and click FINISH.

    RZ/V TLT Project Loaded

  7. After confirming the settings, click SUBMIT SELECTION.
    If the load is successful, the dataset configuration will be displayed.

    RZ/V TLT Project Loaded


Step 4: Re-train the model

  1. Select TRAINING.

    RZ/V TLT Project Loaded

  2. Check the model and set the optimizer parameters.
    Click SUBMIT SELECTION and the learning log will be displayed.
    This time, leave everything as default.

    RZ/V TLT Project Loaded

  3. When Training Completed!!! pop-up appears, click OK to complete the training.

    RZ/V TLT Project Loaded

    The trained model is stored in the following directory.
    rzv_ai_tlt_v4.00/tlt_backend/assets/(Your TLT prject name).


Step 5: Test the trained model

  1. Select INFERENCE

    RZ/V TLT Project Loaded

  2. Click UPLOAD IMAGE to select a test image.
    This time, we use rzv_ai_tlt_v4.00/tlt_backend/datasets/Q03_smart_parking/valid/occupied/0.jpg.

    RZ/V TLT Project Loaded

  3. Click PREDICT to test.
    Since Q03_smart_parking is a classification that predicts whether it is "occupied" or "empty", the result is displayed as a string.

    RZ/V TLT Project Loaded


Tips

Next steps

Once the model has been trained, the next step is to convert it for DRP-AI using DRP-AI TVM.
For instructions on how to use DRP-AI TVM, please see DRP-AI TVM GitHub.
If you use DRP-AI TVM with AI Navigator, sample code for DRP-AI TVM conversion scripts for each model is provided.


Uninstallation

For instructions on how to uninstall TLT, please refer to the user's manual.