KichangKim / DeepDanbooru

AI based multi-label girl image classification system, implemented by using TensorFlow.
MIT License
2.65k stars 260 forks source link

Can this model be used to extract features of anime pictures? #23

Closed OysterQAQ closed 4 years ago

OysterQAQ commented 4 years ago

first, thx for your awesome project. Can this model be used to extract features of anime pictures? If it can, I would like to use it to extract image features and build reverse image search system.

KichangKim commented 4 years ago

DeepDanbooru model returns 8k of (0.0~1.0) scores, so you can use this vector as feature vector. But it may be noisy and has too high dimension, so you may need something post-processing like PCA.

OysterQAQ commented 4 years ago

Yes, I noticed that it seems to output features vector of 7722 dimensions. Will there be any problems if i use keras vgg16(imagenet) model(Exclude fc layer) to extract the features of anime pictures? It will output 512 dimensions feature but it seems that the imagenet dataset only contains real photos

KichangKim commented 4 years ago

It doesn't matter what model you use, but I recommend to try DeepDanbooru model (resnet based) first because it is already trained and released so you can freely use it. Also DeepDanbooru is trained by using anime-pictures, unlike popular real-photo based models.

OysterQAQ commented 4 years ago

Thanks for your answer. I prefer to use the DeepDanbooru model, but I understand that dimensionality reduction methods such as pca need to load the entire matrix, it is expensive. Is there some better dimensionality reduction method? The pre-trained VGG16 model still needs dimensionality reduction, because it is expensive to calculate the similarity of 512-dimensional vectors in tens of millions of pictures.

KichangKim commented 4 years ago

Autoencoder may be the answer I think. https://www.tensorflow.org/tutorials/generative/autoencoder#first_example_basic_autoencoder

OysterQAQ commented 4 years ago

Thank you for your help. I will research it, Forgive me I am not good at deep learning