Ragdoll_X_Furry
Ragdoll_X_Furry t1_j2fv0sd wrote
Reply to comment by kunkkatechies in [R] 2022 Top Papers in AI — A Year of Generative Models by designer1one
Funny how we went from ever-smaller EfficientNets to ever-larger diffusion and transformer models.
Ragdoll_X_Furry t1_j1vgnhv wrote
Reply to comment by Dicitur in [P] Can you distinguish AI-generated content from real art or literature? I made a little test! by Dicitur
Only did paintings.
Ragdoll_X_Furry t1_j1vgg7y wrote
Reply to [P] Can you distinguish AI-generated content from real art or literature? I made a little test! by Dicitur
16/20. Not bad I guess.
Ragdoll_X_Furry t1_iwcxiv6 wrote
Reply to comment by Tiny-Mud6713 in [P] Need help with this CNN transfer learning problem by Tiny-Mud6713
Adam is usually more likely to overfit, so using SGD with Nesterov momentum might help a bit. I'd also recommend augmenting contrast, brightness, saturation and hue if those options are available for the ImageDataGenerator class.
Also does the rotation in the ImageDataGenerator fill the background with black pixels or is there the option to extend/reflect the image? In my experience simply filling the background with black after rotation tends to hinder the accuracy.
One trick that might also help is to extract the outputs not only from the last layer of the pretrained network but also from earlier layers to feed into your network. In my experience this can help improve the accuracy. I've done this with the EfficientNet B0, so I've pasted some example code here to help you out, though if you don't want to use an EfficientNet I'm sure this can be adapted to the DenseNet201 too.
Of course, sometimes transfer learning just doesn't help really, so if nothing else helps you push the accuracy above 90% it might be best to just build and train your own model from scratch to better suit your needs.
Ragdoll_X_Furry t1_iwc23i9 wrote
A few more details about your implementation would be useful for us to help you.
-
How many images are you using for validation?
-
What batch size and optimizer are you using during training?
-
What's the dropout rate in the Dropout layers?
-
How are you preprocessing the images before feeding them to your model? Are you using the
tf.keras.applications.densenet.preprocess_input
function as suggested in the Keras documentation?
You should try increasing the batch size if you can, and use data augmentation as others have already suggested.
You can also try other networks besides DenseNet, like one of the ResNet or EfficientNet models, and you can replace the Flatten layer by a GlobalAvgPool2D or GlobalMaxPool2D layer to reduce parameter size (in my experience the former gives better results). Also that resizing layer might not necessary to improve accuracy.
Ragdoll_X_Furry t1_j2fv6mo wrote
Reply to comment by designer1one in [R] 2022 Top Papers in AI — A Year of Generative Models by designer1one
I'd like to see GANs and VAEs get another chance at image-generation.