Anomaly Detection on NVIDIA RTX 3060 and Jetson AGX Orin

Jill Hsu
3 min readJul 28, 2022

--

Anomaly detection on NVIDIA Jetson AGX Orin. If the bottle contains any defects, the defects annotated on the image and NG shows on the right corner of image.

In smart manufacturing, anomaly detection algorithms can be applied to production line to ensure the quality of the products. According to the knowledge from the experts of the specific domain with image processing technology, AOI (Auto Optical Inspection) is the most commonly used system of anomaly detection. There are some pain points of AOI, the domain knowledge has great difference between each industry, and it’s hard to clearly define the rules for each defects. Thus, the overkill and under-kill problems cause high defect loss and increase the time of manually inspection.

In Recent years, anomaly detection using deep learning rises, integrate AI with AOI or replace the AI with AOI are the solutions to improve the efficient of anomaly detection. However, the vast majority of ML algorithms are data hungry, it’s difficult to collect lots of image of the defects. Thus, supervised learning is not always appropriate to this problem.

Anomaly Detection

There are multiple anomaly detection algorithms, such as FastFlow, PaDiM and PatchCore etc. Different defects are applicable to different algorithms.

There are multiple commonly used anomaly detection algorithms, such as patchcore, fastflow etc. which benchmarking using MVTec public datasets. [1]

We have tested training and inferencing using PyTorch Lightning by providing about 200 normal images and 20 abnormal images for each defects of the product. Trains the model with only normal images and evaluates the AUROC (Area Under the Receiver Operating Characteristic Curve) and F1 Score by few abnormal images.

PaDiM is one of the famous anomaly detection algorithms on the leaderboard, the evaluation shows that PaDim is applicable to both large and small area defects. Let’s try it out on RTX 3060 and AGX Orin to see how it works!

Testing on NVIDIA RTX 3060 and Jetson AGX Orin

Train and inference on Jetson AGX Orin[2], the result shows that Jetson AGX Orin is comparable to the desktop.

We have tested anomaly detection on NVIDIA RTX 3060 and Jetson AGX Orin with following dataset and algorithm information.

  • Dataset: MVTec AD[3]
  • Class: Bottle
  • Training image: 209 normal images, 20 abnormal images of each defect
  • Framework: PyTorch Lightning
  • Algorithm: PaDiM

The training time takes 34 secs and 100 secs on RTX 3060 and AGX Orin respectively. Although it takes longer time to train on AGX Orin, 100 seconds for this quantity of data is still in an acceptable range.

Let’s take a look at the Inference FPS, 2.76 and 2.02 on RTX 3060 and AGX Orin, there’ s just a little difference between RTX 3060 and AGX Orin. The inference speed on AGX Orin is comparable to desktop.

The training time and inference FPS on NVIDIA RTX 3060 and Jetson AGX Orin respectively.

To train on workstation and deploy on edge device is a common practice, the above result of Jetson AGX Orin shows that training and deploying on the edge device is achievable. We are really excited and are eagerly looking forward to more applications on this powerful tiny machine.

--

--