AE outlier detection on CIFAR10
Method
Dataset
import logging
import matplotlib.pyplot as plt
import numpy as np
import os
import tensorflow as tf
tf.keras.backend.clear_session()
from tensorflow.keras.layers import Conv2D, Conv2DTranspose, \
Dense, Layer, Reshape, InputLayer, Flatten
from tqdm import tqdm
from alibi_detect.od import OutlierAE
from alibi_detect.utils.fetching import fetch_detector
from alibi_detect.utils.perturbation import apply_mask
from alibi_detect.saving import save_detector, load_detector
from alibi_detect.utils.visualize import plot_instance_score, plot_feature_outlier_image
logger = tf.get_logger()
logger.setLevel(logging.ERROR)Load CIFAR10 data
Load or define outlier detector
Check quality AE model
Check outliers on original CIFAR images
Plot instance level outlier scores
Visualize predictions
Predict outliers on perturbed CIFAR images
Visualize outlier scores vs. mask sizes
Investigate instance level outlier
Predict outliers on a subset of features
Infer outlier threshold value
Last updated
Was this helpful?

