1:1
ratio with an original size of 2992 x 2992 pixels, is resized to 1024 x 1024 pixels using mogrify command from ImageMagick. It saves computing resources for both the training process and the inference endpoint:
Edge Impulse conversion
)
First, start by importing the Edge Impulse Python SDK. Then load your project’s API KEY.
chmod +x baseline.eim
. And you’re all set! Create an inference function to use it with this model:
student
and teacher
are trained on the same data. The teacher model guides the student model by providing a loss function which helps the student to improve their performance in detecting anomalies.
Anomaly detection during testing is measurable when the student model fails to predict the characteristics of an image. EfficientAD introduces an autoencoder that gives a broader view of the image, improving the overall performance of the detection in addition to the Student-Teacher method.
We’re going to reuse some of the code from nelson1425/EfficientAD and update it to suit our needs. You can find the updated code here.
--artifacts-destination
argument to specify where to store our models. You can omit this argument if you’re not using a S3 bucket on AWS, and it will default to storing the models on the disk.
In your code, you define an experiment like this:
g4dn.xlarge
. To get access to this instance, you need to create a support ticket requesting access to the type G instance type in your region. It will cost us 0.526 USD per hour and we plan to use it for approximately 3h.
For our setup, we’ll use a pre-configured AMI with PyTorch named Deep Learning OSS Nvidia Driver AMI GPU PyTorch 2.2.0
.
early stopping
based on the F1 score from the evaluation dataset. Modify this for your needs.
We use the same config for training datasets one and two.
Here’s an example of the inference results with EfficientAD. It localizes the anomaly within the image through a heatmap.
Find the best Visual AD Model
using our dataset. All you need to do is provide the dataset and run the pipeline. After that, you’ll have the optimal model set up in your project, and you can find the best threshold to use in the logs (Refer to the Option 2
section in the notebook for more details).
/api*
),Launch in browser
feature that lets you test your model in real-time.
Mobile Client compressed version detail
section.
deploy:website
.
The website is hosted on AWS within an S3 bucket and is behind a Cloudfront distribution.