import kerasimport matplotlib.pyplot as pltfrom keras.models import Sequentialfrom keras.layers import Dense,Activation,Flatten,Dropout,Convolution2D,MaxPooling2Dfrom keras.utils import np_utilsfrom keras.optimizers import RMSpropfrom skimage import…