Answers.Body: <p>It sounds like you only have &quot;normal&quot; examples with which to train your model, so this makes the problem feel like an application for outlier detection algorithms. There are a variety of approaches here. You could indeed take an autoencoder approach and then use the reconstruction error to determine if a new image is normal or not, on the presumption that normal images will have lower error. You could also take the activations from the bottleneck layer and build an explicit outlier model using an algorithm like isolation forest. And you are not limited to just autoencoders if you take the latter approach -- other models pretrained for other tasks like image net classification could also provide good features for outlier detection.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-01T09:38:50.880Z
Answers.LastActivityDate: 2021-05-01T09:38:50.880Z
Answers.UserDisplayName: Mike NZ
Body: <p>I want to train a model with python over the images, and these images are for a metal product.
  my aim is to detect the defects, to notice if a product is a failure.</p>
  <p>what kind of architecture do you suggest? should I train over the class? or should I use an autoencoder?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-01T14:44:36.350Z
Comments.Text: Have look into the literature: https://paperswithcode.com/sota/anomaly-detection-on-mvtec-ad
Comments.UserDisplayName: carlo__
Tags: <convolutional-neural-networks><autoencoders><anomaly-detection>
Title: How to train a model for 1 image class to detect anomaly?
UserDisplayName: Sina M
ThreadText: # How to train a model for 1 image class to detect anomaly?
  
  (Asked by: username_0 on 2021-05-01)
  
  I want to train a model with python over the images, and these images are for a metal product.
  my aim is to detect the defects, to notice if a product is a failure.
  
  what kind of architecture do you suggest? should I train over the class? or should I use an autoencoder?
  
  **Tags:** convolutional-neural-networks, autoencoders, anomaly-detection
  > **Comments:**
  > **username_1**: Have look into the literature: https://paperswithcode.com/sota/anomaly-detection-on-mvtec-ad  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-05-01. Score: 1
  
  It sounds like you only have "normal" examples with which to train your model, so this makes the problem feel like an application for outlier detection algorithms. There are a variety of approaches here. You could indeed take an autoencoder approach and then use the reconstruction error to determine if a new image is normal or not, on the presumption that normal images will have lower error. You could also take the activations from the bottleneck layer and build an explicit outlier model using an algorithm like isolation forest. And you are not limited to just autoencoders if you take the latter approach -- other models pretrained for other tasks like image net classification could also provide good features for outlier detection.
  
  
  ---
  
  