Training and Learning Suite (TLS)
TLS Server
The Intel® Training and Learning Suite 2.0 (TLS) enable data scientists to easily annotate images and create AI models in just a few clicks. For more details on using this tool, refer TLS user guide which is available in Edge_Insights_for_Industrial_<version>/training-and-learning-suite/doc/631070_TLS2.0_UserGuide_Rev1.2.pdf.
TLS Remote Agent
This module is a communication agent in EII to interact with Training and Learning Suite (TLS) server, which is another module application as part of EII to provide deep learning model training capability through web user interface. TLS can be setup as deep learning training server, either in a separate system or same local system with EII. Both TLS and EII communicate through RabbitMQ broker using mqtt protocol. To know details of TLS, one can refer to TLS repository, which included the documentation for setup and user guide.
TLS Remote Agent Configuration
Before starting the ia_tls_remoteagent, let’s take a closer look at the TLS Remote Agent configuration in the EII Configuration Manager.
By default, /TLS_RemoteAgent/config in EII Configuration Manager has been configured to run with the pcb_demo sample application and to connect to TLS in localhost.
{ "tls_host": "localhost", "username": "user", "passwd": "password", "user_labels": [{ "VideoAnalytics": { "0": "D_MISSING", "1": "D_SHORT" } }] }
Firstly, update the IP address of the TLS system into tls_host parameter. The default is localhost can be used only if the TLS system is being setup in the same local system with EII. Otherwise, the localhost should be replaced by the IP address of the remote system, where TLS has been setup.
Then, update the username and passwd that will be used for RabbitMQ broker’s authentication. This is the second set of username and password being setup during the ./generateCert.sh execution in TLS setup so RabbitMQ broker can establish a client connection.
User can define the labels for each of the classified results based on the trained model implemented in the classifier. For example, in the default pcb_demo sample application, the SubTopics in docker-compose.yml file is VideoAnalytics/camera1_stream_results, where VideoAnalytics is the AppName and camera1_stream_results is the topic name. In the user_labels parameter, use the AppName and define its labels in json format, as shown above. This will allow the labels to be displayed on TLS web UI based on the classified result.
For another example with multiple VideoAnalytics containers and combination with GVA-plugin used in VideoIngestions, refer to the user-defined labels example below through EII Configuration Manager.
{ "tls_host": "localhost", "username": "user", "passwd": "password", "user_labels": [{ "VideoAnalytics": { "0": "D_MISSING", "1": "D_SHORT" }, "VideoIngestion2": { "1": "safety_helmet", "2": "safety_jacket", "3": "safe", "4": "violation" } }] }
The above example of user labels is based on the assumption of use cases, as below:
VideoAnalytics as first-stream topic with pcb_demo and defect type in the classifier algo parsing object id for label mapping.
VideoIngestion2 as second-stream topic, which used the GVA-plugin that the inferencing happened in VideoIngestion container using GStreamer and no VideoAnalytics is required. Therefore, the AppName being used here is “VideoIngestion” and not “VideoAnalytics”. In this use case, safety_gear_demo and user-defined labels per the EII Configuration Manager are used because the GVA-plugin does not use the classifier algo in VideoAnalytics to parse the defect type.
TLS Remote Agent Setup
Pre-requisite:
TLS has been setup in the same local system with EII, or in a remote system with network connection established to EII system.
TLS has at least one model training completed so it can be configured to setup the connection with EII for trained model deployment.
Setup and Run TLS Remote Agent:
Follow the Configuration section above, configure TLS remote agent accordingly and save the new configuration through EII Configuration Manager web UI.
TLS has been designed to run only secured mode, where security certificates are required that covered in TLS setup guide. For EII running in dev_mode, steps below can be skipped. Otherwise, these steps are required if EII is running in prod_mode.
NOTE:These steps need to be executed again whenever TLS system regenerated the new certificates using the ./generateCert.sh tool.From TLS system, go to /thirdparty/security directory, copy the 3 files below to /build/provision/Certificates/TLSRemoteAgent directory in EII system.
Under security/ca directory, copy ca_certificate.pem file.
Under security directory, copy TLS_rabbitmq_cert.crt and TLS_rabbitmq_key.pem files.
Go to the destination directory /build/provision/Certificates/TLSRemoteAgent in EII system, use below command to change the 3 files onwership.
$ sudo chown eiiuser:eiiuser ca_certificate.pem $ sudo chown eiiuser:eiiuser TLS_rabbitmq_cert.crt $ sudo chown eiiuser:eiiuser TLS_rabbitmq_key.pem
Optional: If the network for TLS and EII system is running behind proxy, add the TLS system IP to the ia_tls_remoteagent docker compose setting, under environment -> no_proxy in the consolidated docker-compose.yml file as below.
environment: no_proxy: ${eii_no_proxy},${ETCD_HOST},
Now, restart the TLS remote agent container by using command below:
$ docker-compose up -d --force-recreate ia_tls_remoteagent
Upon ia_tls_remoteagent started, it will read the SubTopics from ia_tls_remoteagent in the docker-compose.yml file to check how many camera/video stream topic being subscribed. Then it will based on each camera stream to create an unique UUID and display it on the screen. Alternatively, use the command below to view the ia_tls_remoteagent container log at terminal to obtain the UUID.
$ docker logs -f ia_tls_remoteagent
This unique UUID for each stream topic will be needed to add into TLS web UI in order to connect TLS system and EII system. For details, please refer to TLS user guide remote agent section. The naming convention format as following:
systemUUID_streamTopic
With ia_tls_remoteagent up and running, it will allow user to connect with TLS system to:
Deploy TLS trained model from TLS system to EII system. When user deploy TLS trained model from TLS web UI, the model files will be transferred to ia_tls_remoteagent container under common/udfs/model_repo directory. This directory is mounted on EII host system under /opt/intel/eii/model_repo directory as configured in docker-compose.yml file.
View EII classified result through TLS web UI. Each of the classified results stream topic from EII can be streamed back to TLS UI through the UUID setup and it can be controlled by View button on TLS web UI.
By enabling ia_tls_remoteagent module, it establish connection between TLS and EII for end to end deep learning deployment as user can train deep learning model base on own image dataset and deploy the trained model on EII edge inferencing which highly optimized on Intel platform.