Keras-GAN
Keras-GAN copied to clipboard
Image classification problem for acgan
(1)Model trained with mnist dataset. For the generated 1000 images,the classification accuracy is 100% for discriminator. For mnist test images, the classification accuracy is 99% for discriminator. Good classification effect. (2)Model trained with cifar10 dataset. For the generated 1000 images,the classification accuracy is 100% for discriminator. For cifar10 test images, the classification accuracy is 35% for discriminator. Classification effect is poor.
What caused it and how to modify it?
I have trained with mnist dataset for 1000 epochs, take out the discriminator,the classification accuracy is around 95%, But when increase the epochs to 5000,minibatch size to 128 the classification accuracy is terrible , and look at the confusion , it classified most of the image as '8', weird behavior.....
Here is the code to test the accuracy, after training: new_model=acgan.discriminator from keras.datasets import mnist (X_train, y_train), (_, _) = mnist.load_data() X_train = (X_train.astype(np.float32) - 127.5) / 127.5 X_train = np.expand_dims(X_train, axis=3) y_train = y_train.reshape(-1, 1) y_pred=new_model.predict(X_train,batch_size=128) y = np.argmax(y_pred[1], axis=1) from sklearn.metrics import confusion_matrix conf=confusion_matrix(y_train,y)