I am doing anomaly detection using machine learning. i have tried different models like isolation forest, SVM and KNN. The maximum accuracy that I can get from each of them is $80\%$ accordind to my dataset which contains $5$ features and $4000$ data samples, $18\%$ of them are anomalous. When I use autoencoder and I adjust the proper reconstruction loss threshold I can get $92\%$ accuracy but the hidden layers setup of the autoencoder does not seems right despite the accuracy I get. As I said, I have only $5$ features and the setup as follows
self.encoder = tf.keras.Sequential([ layers.Dense(64, activation="relu"), layers.Dense(32, activation="relu"), layers.Dense(16, activation="relu")]) self.decoder = tf.keras.Sequential([ layers.Dense(32, activation="relu"), layers.Dense(64, activation="relu"), layers.Dense(5, activation="sigmoid")])
Is this reasonable? because it looks like an encoder upsampling then downsampling that I did not see before which makes me missing something here.