SPRADB0 may   2023 AM62A3 , AM62A3-Q1 , AM62A7 , AM62A7-Q1 , AM68A , AM69A

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 Intended Audience
    2. 1.2 Host Machine Information
  5. 2Creating the Dataset
    1. 2.1 Collecting Images
    2. 2.2 Labelling Images
    3. 2.3 Augmenting the Dataset (Optional)
  6. 3Selecting a Model
  7. 4Training the Model
    1. 4.1 Input Optimization (Optional)
  8. 5Compiling the Model
  9. 6Using the Model
  10. 7Building the End Application
    1. 7.1 Optimizing the Application With TI’s Gstreamer Plugins
    2. 7.2 Using a Raw MIPI-CSI2 Camera
  11. 8Summary
  12. 9References

Selecting a Model

Model selection can happen in parallel with creating a dataset. To get the most performance out of TI’s C7xMMA deep learning accelerator, every layer within the network must be supported on the C7xMMA. Non-supported layers will still work, but may require the CPU runs those layers, which reduces performance.

Models from the TI Model-Zoo all consist of supported layers. TI uses many industry standard and state-of-the-art architectures. In some cases, these architectures are slightly modified to be friendlier to acceleration; these models are referred to as ‘lite’ or ‘ti-lite’ models. Note that at this time of this writing, some otherwise-supported layers (for example, Exponential Linear Unit or ELU) were not supported on the AM62A given its recent launch. This means some models within the model-zoo were not yet supported on the AM62A for acceleration.

TI's Edge AI Cloud "Model Analyzer" is a useful tool for selecting a model. This provides a view of model performance so that developers can select a model or architecture based on metrics like performance (for example, inference speed, memory usage) and accuracy (on a standard dataset like COCO). The performance of a model is independent of the dataset it was trained on, but accuracy of a model is related to the dataset it was trained. When comparing accuracy between models, developers should make sure to only compare accuracy between models trained on the same dataset.

For the food-recognition model built for the retail-scanner demo, mobilenetv2SSD was selected. A pretrained model from TI’s model zoo was used as a starting point for transfer learning. This starting model is named “od-8020_onnxrt_coco_edgeai-mmdet_ssd_mobilenetv2_lite_512x512_20201214_model_onnx” within TI tools. There is plenty of information within the model name:

  • od: Object Detection neural network
  • "8020": a unique number to distinguish models for faster reference when working with many.
  • onnxrt: ONNX runtime is the runtime/API to use for this model
  • coco: The original version was trained on the COCO dataset, which contains 80+ everyday objects like people, automobiles, bananas(!), home appliances, and so forth.
  • edgeai-mmdet: The training framework was edgeai-mmdet, which is TI’s fork of the open source mmdetection tool from OpenMMLab
  • ssd: The head or task-specific portion of this network, which is used for object detection, is SSD or Single Shot Detection.
  • mobilenetv2: The model architecture is uses MobilenetV2 for feature extraction extraction in the initial set of layers in this model. In machine learning jargon, this is the spine of the network.
  • lite: This model was slightly modified from the original architecture to be friendlier to TI's C7xMMA architecture
  • 512x512: Input images are 512x512 resolution
  • 2020214: When this model was originally trained on the dataset (COCO). Not all model names include a date string