Deep Learning for content-based image retrieval with TensorFlow and Keras
usage: python retrieval.py -h
skimage and keras are required in this file. The following transformations are included:
- adjust brightness
- shit, rotate, flip, zoom
- dilation, erosion
- add oblique line
- add salt noise
LeNet-5 is a classical CNN model proposed by Yann LeCun.
See Gradient-based learning applied to document recognition for more details.
ReLu is used as the activate function for convlayer and fclayer. Drop-out layer is added before softmax in this implementation.
Train lenet-5 on MNIST.
Extract features of query image and all retrieval images from fully-connected layer.
Perform feature similarity computation for retrieval task. Cosine similarity is adopted in this implementation.
Example of using images stored on disk as tf inputs.
utils : Image preprocessing.
funcs : Image retrieval function.
lenet5 : Implementation of Lenet-5 with keras.