Hello,
I'm currently trying to classify images with LeNet after training it with my own database (9000 images for training, 2000 images for testing, digits (0 to 9), grayscale, 50x100). I converted all the images to two lmdb database (train and test) with the convert_imageset.
After the training, i got an accuracy of 99%. But when i try to test single images manually with classification.bin, it goes wrong 90% of the time.
For exemple, a pretty clear image of a 5 is predicted at 100% as a 4.
---------- Prediction for ../DB/DBtest/image_test.bmp ----------
1.0000 - "Four"
0.0000 - "One"
0.0000 - "Three"
0.0000 - "Zero"
0.0000 - "Two"
Here come the questions :
1) With the LeNet_train_test.prototxt, the input data (train and test) is scaled with a factor of 0.00390625 in order to change the range from [0;255] to [0;1]. Have i to scale my .bmp image like this when i test them with classification.bin ?
My first layer in lenet_deploy.prototxt is an Input type layer. And i can't find a way to apply the scale factor with this layer (transform_param does not exist with Input type layer). Have i to manually rescale every single .bmp i want to test between 0 and 1 ? If yes, how ?
2) classification.bin need a txt file with all label possible. So i wrote a txt file with a label on each line. But i wonder how can he know which output neuron is asociated with which label. Is the first output neuron associated with 0 and the last to 9 ? There is apparently no reason to that during the learning process. How can i know which output give the probability of which label after the last softmax layer ?
3) I also generated a mean_file of my database (the training one, not the testing one) with the compute_image_mean tool of Caffe. But i wonder why is this needed for classification.bin, and what mean is it exactly. The mean has to be a number between 0 and 255 or between 0 and 1 ? Did i need to rescale this too ? And if yes, how ?
Thanks,