728x90 반응형 SMALL Grad-CAM2 [eXplainable AI] Grad-CAM with MNIST Create pipeline to train model with MNIST dataset # Import tensorflow and matplot lib from tensorflow.keras.datasets.mnist import load_data from matplotlib import pyplot as plt import tensorflow as tf # load MNIST dataset (trainX, trainy), (testX, testy) = load_data() # Plot example images for i in range(36): # Defining subplots for multiple images plt.subplot(6, 6, i+1) # plot raw pixel data pl.. 2022. 2. 10. [eXplainable AI] XAI method : Grad-CAM CAM (Class Activation Mapping) CAM (Class Activation Map)은 CNN을 하는데 있어 이미지의 어떤 부분이 결정에 가장 큰 영향을 주는지에 대해 분석하는 목적으로 시작되었다. 대부분의 Image Classification 모델들은 여러 층의 Convolutional layer을 걸친 뒤 Fully-Connected Layer를 통해서 Classification을 진행하게 된다. 하지만 Convolutional layer는 layer를 거친 뒤에서 spatial information을 보존하지만 Fully-Connected Layer는 flatten 과정을 거치게 되면 spatial information의 손실이 발생하게 된다. 그래서 CAM은 Convolution.. 2022. 2. 10. 이전 1 다음 728x90 반응형 LIST