How to use Autoencoders for outlier detection on images I have a bunch of images taken from a camera showing a pipe and would like to detect if the pipe is leaking or not. There are very few examples of leaking pipe in the data set. So considering this problem as a supervised learning problem, I think that it may not give us good result due to imbalanced data. I'm thinking of using autoencoder and considering it as an outlier detection problem. 

I'm new to deep learning so I'd like to know how the architecture of my neural network should look like. Should I have some convolutional layers first and then an autoencoder or I should only have autoencoder? What would be the best DL library for such a use case? I also thinking of using only the photos which do not have any leak for the training phase, is that OK?
If you use supervised learning you need to weighted you labels (here). 

Otherwise I strongly recommend to exclude every leaking image for a training dataset for an CAE. If you have the anomaly in your trainign dataset, your CAE will learn it as normal. This is actually an active research field, and not trivial for real datsets, but if you have a static image of the pipe, it should be easy. I would suggest that you use traditional CV for it and not an DL model, because you can interpret and fine tune the result.