File Description:
1. Caffe Run Example Cifar10
2. Analyzing the data collection model structure of CIFAR10
3. Give the Ciffar10 operation steps
Operating Environment:
Windows7 X86 + Caffe + VS2013
Resources:
1. http://blog.csdn.net/maweifei/article/details/52981425
2. http://www.cs.toronto.edu/~kriz/cifar.html (binary database)
3. Http://groups.csail.mit.edu/vision/TinyImages (Image database)
4. Http://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf
5. http://blog.csdn.net/zb1165048017/article/details/51476516
(i) Introduction to the CIFAR_10 data set
1. CIFAR-10 (DataSet) dataset contains 60000 photos
Picture Size:32pixel * 32pixel Image depth: Three channels RGB color image All images are divided into 10 classes of 50000 training samples 10000 test samples
(ii) convolutional neural network model used by CIFAR-10 for CNN
The model in the Caffe configuration file is: Cifar10_quick_train_test.prototxt The cnn_net is mainly composed of convolution layer, pool layer, nonlinear change layer, local contrast normalized linear classifier.
(c) The specific steps are as follows: Step 1: Download binary datasets download address: CIFAR-10 binary version (suitable for C programs)
Step 2: Create the Input_folder folder and the Output_folders folder in the data directory and move the downloaded files to the Input_folder folder with the following directory structure: D:\Caffe\caffe-master\data\ Cifar10\input_folder D:\Caffe\caffe-master\data\cifar10\output_folders Create a folder, create a new. bat file under that directory with the file name cifar10_ Convert.bat. The contents of the file are:
D:\Caffe\caffe-master\Build\x64\Release\convert_cifar_data.exe D:\Caffe\caffe-master\data\cifar10\input_folder D : \caffe\caffe-master\data\cifar10\output_folder leveldb
Pause
Double-click Run to get the following file Leveldb file
Step 3: Write the Cifar_mean.bat file in the data peer directory to calculate the image's mean value. The contents of the file are:
Build\x64\release\compute_image_mean.exe data\cifar10\output_folder\cifar10_train_leveldb Mean.binaryproto-- Backend=leveldb
Pause
Double-click the run Cifar_mean.bat file to get the Mean.bianryproto file and move the file to the */examples/cifar10 directory.
SETP 4: Create a Cifar_train.bat file for training.
Since this operation is performed under the CPU, the D:\Caffe\caffe-master\examples\cifar10\ file is opened, the training mode is modified to the CPU, and the D:\Caffe\caffe-master\examples\ is turned on. Cifar10\cifar10_quick_train_test.prototxt file, modify the data source for the data layer named Cifar, which acts on train and test, as follows;
Build\x64\release\caffe.exe Train--solver=examples/cifar10/cifar10_quick_solver.prototxt
Pause
Double-click to run the model training. Get the following two files
The training results are as follows:
Step 5: Perform a picture classification
First, create the D:\Caffe\caffe-master\examples\cifar10\synset_words.txt file. The contents of the file are as follows:
Under the Caffe root directory, create the Cifar_class.bat file. That is D:\Caffe\caffe-master\cifar_class.bat. The contents are as follows:
D:\Caffe\caffe-master\Build\x64\Release\classification.exe D:\Caffe\caffe-master\examples\cifar10\cifar10_ Quick.prototxt D:\Caffe\caffe-master\examples\cifar10\cifar10_quick_iter_4000.caffemodel.h5 D:\Caffe\ Caffe-master\examples\cifar10\mean.binaryproto D:\Caffe\caffe-master\examples\cifar10\synset_words.txt D:\Caffe\ Caffe-master\examples\images\cat_gray.jpg
Pause
The following results are obtained: