Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image classification problem for acgan #242

Open
basailuonaaa opened this issue Nov 17, 2020 · 2 comments
Open

Image classification problem for acgan #242

basailuonaaa opened this issue Nov 17, 2020 · 2 comments

Comments

@basailuonaaa
Copy link

(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?

@fdgvdfgtrvgtrvg
Copy link

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.....

@fdgvdfgtrvgtrvg
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants