├── model ├── solver_PQAN_image.prototxt ├── solver_PQAN_pool2.prototxt ├── solver_bn.prototxt └── test_bn.prototxt ├── train_baseline ├── solver_bn.prototxt ├── get_train_minibatch_for_LPW.m ├── test_network.m ├── test_network_for_LPW.m ├── get_train_minibatch.m ├── train_baseline.m ├── train_LPW.m ├── test_script.m └── test_script_for_LPW.m ├── train_PQAN ├── test_network.m ├── test_network_for_LPW.m ├── get_train_minibatch.m ├── train_network_and_test.m ├── train_LPW.m ├── test_script_moreparam.m ├── test_script.m ├── get_train_minibatch_for_LPW.m └── test_script_for_LPW.m ├── README.md └── generate_data ├── generate_iLIDS_VID_data.m ├── generate_prid2011_data.m └── generate_LPW_dataset.m /model/solver_PQAN_image.prototxt: -------------------------------------------------------------------------------- 1 | net: "../model/train_PQAN_image.prototxt" 2 | base_lr: 0.001 3 | lr_policy: "multistep" 4 | #stepvalue:156600 5 | #stepvalue:217600 6 | #stepvalue:230000 7 | gamma: 0.5 8 | max_iter: 1200000 9 | momentum: 0.9 10 | weight_decay: 0.0002 11 | #snapshot: 500 12 | #snapshot_prefix: "model/partQAN" 13 | #solver_mode: GPU -------------------------------------------------------------------------------- /model/solver_PQAN_pool2.prototxt: -------------------------------------------------------------------------------- 1 | net: "../model/train_PQAN_pool2.prototxt" 2 | base_lr: 0.001 3 | lr_policy: "multistep" 4 | #stepvalue:10000 5 | #stepvalue:13000 6 | #stepvalue:230000 7 | gamma: 0.5 8 | max_iter: 1200000 9 | momentum: 0.9 10 | weight_decay: 0.0002 11 | #snapshot: 500 12 | #snapshot_prefix: "model/partQAN" 13 | #solver_mode: GPU -------------------------------------------------------------------------------- /train_baseline/solver_bn.prototxt: -------------------------------------------------------------------------------- 1 | net: "train_bn.prototxt" 2 | 3 | base_lr: 0.001 4 | lr_policy: "multistep" 5 | stepvalue: 6400 6 | stepvalue: 10000 7 | stepvalue: 16000 8 | stepvalue: 25000 9 | gamma: 0.5 10 | max_iter: 1200000 11 | momentum: 0.9 12 | weight_decay: 0.0002 13 | snapshot: 500 14 | snapshot_prefix: "model/googlenet_roadpede" 15 | solver_mode: GPU -------------------------------------------------------------------------------- /model/solver_bn.prototxt: -------------------------------------------------------------------------------- 1 | net: "../model/train_bn.prototxt" 2 | 3 | base_lr: 0.001 4 | lr_policy: "multistep" 5 | stepvalue: 6400 6 | stepvalue: 10000 7 | stepvalue: 16000 8 | stepvalue: 25000 9 | gamma: 0.5 10 | max_iter: 1200000 11 | momentum: 0.9 12 | weight_decay: 0.0002 13 | #snapshot: 500 14 | #snapshot_prefix: "model/googlenet_roadpede" 15 | #solver_mode: GPU -------------------------------------------------------------------------------- /train_baseline/get_train_minibatch_for_LPW.m: -------------------------------------------------------------------------------- 1 | function [batch_data,batch_label]=get_train_minibatch_for_LPW(batch_data,batch_label,batch_size, ... 2 | label_train,train_image_name) 3 | data_size=size(label_train,1); 4 | data_sel=randperm(data_size,batch_size); 5 | batch_label(:)=label_train(data_sel,1)-1; 6 | for m=1:batch_size 7 | sel=data_sel(m); 8 | train_data=imread(train_image_name{sel}); 9 | im_data=imresize((single(train_data)),[224 224]); 10 | im_data=im_data(:,:,[3,2,1]); 11 | im_data=permute(im_data,[2,1,3]); 12 | batch_data(:,:,:,m)=im_data; 13 | batch_data(:,:,1,m)=batch_data(:,:,1,m)-104; 14 | batch_data(:,:,2,m)=batch_data(:,:,2,m)-117; 15 | batch_data(:,:,3,m)=batch_data(:,:,3,m)-123; 16 | end 17 | end -------------------------------------------------------------------------------- /train_baseline/test_network.m: -------------------------------------------------------------------------------- 1 | for model_index=1:10 2 | caffe.reset_all; 3 | net=caffe.get_net(param.test_net_file,'test'); 4 | net.copy_from(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(2600),'.caffemodel')); 5 | % net.copy_from(param.fintune_model); 6 | tic; 7 | fin=fopen(param.result_save_file,'a'); 8 | str=strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(2600),'.caffemodel'); 9 | fprintf(fin,'model:%s\n',str); 10 | fprintf('testing model:%s\n',str); 11 | fclose(fin); 12 | net.blobs('data').reshape([224 224 3 param.test_batch_size]); 13 | load(strcat(param.data_path,param.testdata_filename,num2str(split_index),'/test_data.mat')); 14 | test_script; 15 | 16 | 17 | toc; 18 | end -------------------------------------------------------------------------------- /train_baseline/test_network_for_LPW.m: -------------------------------------------------------------------------------- 1 | for model_index=1:7 2 | caffe.reset_all; 3 | net=caffe.get_net(param.test_net_file,'test'); 4 | % net.copy_from(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(86000+model_index*2000),'.caffemodel')); 5 | net.copy_from(param.fintune_model); 6 | tic; 7 | fin=fopen(param.result_save_file,'a'); 8 | str=strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(86000+model_index*2000),'.caffemodel'); 9 | fprintf(fin,'model:%s\n',str); 10 | fprintf('testing model:%s\n',str); 11 | fclose(fin); 12 | net.blobs('data').reshape([224 224 3 param.test_batch_size]); 13 | load(strcat(param.data_path,param.testdata_filename,num2str(split_index),'/test_data.mat')); 14 | test_script_for_LPW; 15 | toc; 16 | end -------------------------------------------------------------------------------- /train_baseline/get_train_minibatch.m: -------------------------------------------------------------------------------- 1 | function [batch_data,batch_label]=get_train_minibatch(batch_data,batch_label,batch_size,train_data_cam1,train_data_cam2,label_train_cam1,label_train_cam2) 2 | train_data=[train_data_cam1;train_data_cam2]; 3 | train_labels=[label_train_cam1;label_train_cam2]; 4 | data_size=size(train_data,1); 5 | data_sel=randperm(data_size,batch_size); 6 | batch_label(:)=train_labels(data_sel,1)-1; 7 | for m=1:batch_size 8 | sel=data_sel(m); 9 | im_data=imresize((reshape(single(train_data(sel,:)),128,64,3)),[224 224]); 10 | im_data=im_data(:,:,[3,2,1]); 11 | im_data=permute(im_data,[2,1,3]); 12 | batch_data(:,:,:,m)=im_data; 13 | batch_data(:,:,1,m)=batch_data(:,:,1,m)-104; 14 | batch_data(:,:,2,m)=batch_data(:,:,2,m)-117; 15 | batch_data(:,:,3,m)=batch_data(:,:,3,m)-123; 16 | end 17 | end -------------------------------------------------------------------------------- /train_PQAN/test_network.m: -------------------------------------------------------------------------------- 1 | for model_index=1:15 2 | caffe.reset_all; 3 | net=caffe.get_net(param.test_net_file,'test'); 4 | % net.copy_from(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(12400),'.caffemodel')); 5 | net.copy_from(param.fintune_model); 6 | tic; 7 | fin=fopen(param.result_save_file,'a'); 8 | str=strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(12400),'.caffemodel'); 9 | fprintf(fin,'model:%s\n',str); 10 | fprintf('testing model:%s\n',str); 11 | fclose(fin); 12 | net.blobs('data').reshape([224 224 3 param.test_batch_size]); 13 | % set all the scores to value 1 14 | % net.blobs('sig').reshape([1 1 3 param.test_batch_size]); 15 | % batch_sig=ones(1,1,3,param.test_batch_size,'single'); 16 | % net.blobs('sig').set_data(batch_sig); 17 | % 18 | load(strcat(param.data_path,param.testdata_filename,num2str(split_index),'/test_data.mat')); 19 | test_script; 20 | toc; 21 | end -------------------------------------------------------------------------------- /train_PQAN/test_network_for_LPW.m: -------------------------------------------------------------------------------- 1 | for model_index=0:0 2 | caffe.reset_all; 3 | net=caffe.get_net(param.test_net_file,'test'); 4 | % net.copy_from(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(65500+model_index*2000),'.caffemodel')); 5 | net.copy_from(param.fintune_model); 6 | tic; 7 | fin=fopen(param.result_save_file,'a'); 8 | str=strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(65500+model_index*2000),'.caffemodel'); 9 | fprintf(fin,'model:%s\n',str); 10 | fprintf('testing model:%s\n',str); 11 | fclose(fin); 12 | net.blobs('data').reshape([224 224 3 param.test_batch_size]); 13 | % % contrast fix score 14 | % net.blobs('sig').reshape([1 1 3 param.test_batch_size]); 15 | % batch_sig=ones(1,1,3,param.test_batch_size,'single'); 16 | % net.blobs('sig').set_data(batch_sig); 17 | % % 18 | load(strcat(param.data_path,param.testdata_filename,num2str(split_index),'/test_data.mat')); 19 | test_script_for_LPW; 20 | toc; 21 | end -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Quality Aware Network 2 | 3 | Codebase for (Partial) [Quality Aware Network](https://arxiv.org/abs/1704.03373). Notice that QAN in ''Quality Aware Network for Set to Set Recognition'' is a 'single-part' version of P-QAN in ''Unsupervised Partial Quality Predictor for Large-Scale Person Re-identification'', so you can set part number to 1 if you wanna reproduce results of QAN. 4 | 5 | **QAN** is used to handle set-to-set recognition problem. It can automatically learn the quality score for each sample in a set, and use the score to be the weight for synthesizing feature. 6 | 7 | **P-QAN** is our subsequent work after QAN. It is used to handle video based person re-identification problem with awareness of partial quality. It can learn not only the quality of each frame but also the occlusion/blur/noise/etc. level in each part of a frame. 8 | 9 | We use the [PRID 2011](https://lrs.icg.tugraz.at/datasets/prid/), [iLIDS-VID](www.eecs.qmul.ac.uk/.../downloads_qmul_iLIDS-VID_ReID_dataset.html) and [LPW] (coming soon) datasets for evaluation. They are video-based tasks for person re-identification. 10 | 11 | ## Running code 12 | 13 | 1.Clone [CaffeMex\_v2](https://github.com/sciencefans/CaffeMex_v2); 14 | 15 | ~~2.Replace `normalization layer (.hpp .cu .cpp)` in `CaffeMex_v2` with `layers/*` and add `NormalizationParameter` to `caffe.proto`;~~ 16 | 17 | 3.Complile with matlab interface (see readme in CaffeMex\_v2). 18 | 19 | 4.Configure the path `CaffeMex_v2/matlab/+caffe` to the directory in this project. 20 | 21 | 5.Configure the parameters in `train_baseline/train_baseline.m`, `train_baseline/train_LPW.m` and `train_PQAN/train_LPW.m`, `train_PQAN/train_network_and_test.m`, including the path of prototxt and the relative param. The pretrain_model can be found in here(https://github.com/lim0606/caffe-googlenet-bn). 22 | 23 | 6.Running the scripts in the `generate_data` to generate your dataset split. 24 | 25 | 7.Modify the number of corresponding network classifications. 26 | Running the `train_baseline/train_baseline.m` or `train_baseline/train_LPW.m` for baseline and `train_PQAN/train_LPW.m`, `train_PQAN/train_network_and_test.m` for PQAN. 27 | 28 | ## Q&A 29 | 30 | Here we list some commonly asked questions we received from the public. Thanks for your engagement to make our work better! 31 | 32 | - *What is `LPW`? 33 | 34 | Labeled Pedestrian in the Wild (LPW) is a large scale human re-identification dataset that we collected in three different crowed scenes. ~~We haven't released it now but if you are interested in it, please contact us by e-mail.~~ Now you can download it at http://liuyu.us/dataset/lpw/. 35 | 36 | - *Any strategies are used to make the quality scores effective? 37 | 38 | There are two main aspects that will affect the effectiveness of the quality scores. One is using a pre-trained model for imagenet classification task in order to make the network converge well. In the training stage, the use_global_stats is set to false in the Batchnorm layer; The other is the configuration of the parameter like learning rate, margin in the tripletloss layer, and you can adjust the parameters by observing the change of the scores in the training stage. 39 | 40 | ## Still having questions? 41 | Feel free to drop us an email sharing your ideas. 42 | 43 | 44 | ## Citation 45 | Please kindly cite our work in your publications if it helps your research: 46 | 47 | @inproceedings{liu_2017_qan, 48 | Author = {Liu, Yu and Junjie, Yan and Ouyang, Wanli}, 49 | Title={Quality Aware Network for Set to Set Recognition}, 50 | Booktitle={IEEE Conference on Computer Vision and Pattern Recognition}, 51 | Year = {2017} 52 | } 53 | -------------------------------------------------------------------------------- /train_PQAN/get_train_minibatch.m: -------------------------------------------------------------------------------- 1 | function [batch_data,batch_label]=get_train_minibatch(param,batch_data,batch_label,batch_size,train_data_cam1,train_data_cam2,label_train_cam1,label_train_cam2) 2 | data_an=[]; 3 | data_pos=[]; 4 | data_neg=[]; 5 | select_view1_anr=randperm(2,1); 6 | select_view1_pos=randperm(2,1); 7 | select_view1_neg=randperm(2,1); 8 | person_sel=randperm(param.train_person_num,2); 9 | if select_view1_anr==1 10 | person_1_1=find(label_train_cam1==person_sel(1)); 11 | else 12 | person_1_1=find(label_train_cam2==person_sel(1)); 13 | end 14 | if select_view1_pos==1 15 | person_1_2=find(label_train_cam1==person_sel(1)); 16 | else 17 | person_1_2=find(label_train_cam2==person_sel(1)); 18 | end 19 | if select_view1_neg==1 20 | person_2=find(label_train_cam1==person_sel(2)); 21 | else 22 | person_2=find(label_train_cam2==person_sel(2)); 23 | end 24 | size_a=size(person_1_1); 25 | size_p=size(person_1_2); 26 | size_n=size(person_2); 27 | data_sel_anr=randperm(size_a(1),batch_size/3); 28 | data_sel_pos=randperm(size_p(1),batch_size/3); 29 | data_sel_neg=randperm(size_n(1),batch_size/3); 30 | for t=1:batch_size/3 31 | if select_view1_anr==1 32 | data_t=train_data_cam1(person_1_1(data_sel_anr(t)),:); 33 | batch_label(:,:,:,t)=label_train_cam1(person_1_1(data_sel_anr(t)))-1; 34 | else 35 | data_t=train_data_cam2(person_1_1(data_sel_anr(t)),:); 36 | batch_label(:,:,:,t)=label_train_cam2(person_1_1(data_sel_anr(t)))-1; 37 | end 38 | data_t=reshape(data_t,128,64,3); 39 | im_data=imresize((single(data_t)),[224 224]); 40 | im_data=im_data(:,:,[3,2,1]); 41 | im_data=permute(im_data,[2,1,3]); 42 | batch_data(:,:,:,t)=im_data; 43 | batch_data(:,:,1,t)=batch_data(:,:,1,t)-104; 44 | batch_data(:,:,2,t)=batch_data(:,:,2,t)-117; 45 | batch_data(:,:,3,t)=batch_data(:,:,3,t)-123; 46 | 47 | if select_view1_pos==1 48 | data_t=train_data_cam1(person_1_2(data_sel_pos(t)),:); 49 | batch_label(:,:,:,t+batch_size/3)=label_train_cam1(person_1_2(data_sel_pos(t)))-1; 50 | else 51 | data_t=train_data_cam2(person_1_2(data_sel_pos(t)),:); 52 | batch_label(:,:,:,t+batch_size/3)=label_train_cam2(person_1_2(data_sel_pos(t)))-1; 53 | end 54 | data_t=reshape(data_t,128,64,3); 55 | im_data=imresize((single(data_t)),[224 224]); 56 | im_data=im_data(:,:,[3,2,1]); 57 | im_data=permute(im_data,[2,1,3]); 58 | batch_data(:,:,:,t+batch_size/3)=im_data; 59 | batch_data(:,:,1,t+batch_size/3)=batch_data(:,:,1,t+batch_size/3)-104; 60 | batch_data(:,:,2,t+batch_size/3)=batch_data(:,:,2,t+batch_size/3)-117; 61 | batch_data(:,:,3,t+batch_size/3)=batch_data(:,:,3,t+batch_size/3)-123; 62 | 63 | if select_view1_neg==1 64 | data_t=train_data_cam1(person_2(data_sel_neg(t)),:); 65 | batch_label(:,:,:,t+2*batch_size/3)=label_train_cam1(person_2(data_sel_neg(t)))-1; 66 | else 67 | data_t=train_data_cam2(person_2(data_sel_neg(t)),:); 68 | batch_label(:,:,:,t+2*batch_size/3)=label_train_cam2(person_2(data_sel_neg(t)))-1; 69 | end 70 | data_t=reshape(data_t,128,64,3); 71 | im_data=imresize((single(data_t)),[224 224]); 72 | im_data=im_data(:,:,[3,2,1]); 73 | im_data=permute(im_data,[2,1,3]); 74 | batch_data(:,:,:,t+2*batch_size/3)=im_data; 75 | batch_data(:,:,1,t+2*batch_size/3)=batch_data(:,:,1,t+2*batch_size/3)-104; 76 | batch_data(:,:,2,t+2*batch_size/3)=batch_data(:,:,2,t+2*batch_size/3)-117; 77 | batch_data(:,:,3,t+2*batch_size/3)=batch_data(:,:,3,t+2*batch_size/3)-123; 78 | end 79 | end -------------------------------------------------------------------------------- /train_baseline/train_baseline.m: -------------------------------------------------------------------------------- 1 | %%train network config 2 | param.caffe_path=fullfile(fileparts(pwd),'matcaffe'); 3 | param.solver_netfile=fullfile(fileparts(pwd),'model','solver_bn.prototxt'); 4 | param.fintune_model=fullfile(fileparts(pwd),'pretrain_model','googlenet_bn.caffemodel'); 5 | param.test_net_file=fullfile(fileparts(pwd),'model','test_bn.prototxt'); 6 | param.test_batch_size=16; 7 | param.result_save_file='result.txt'; 8 | param.save_model_file='model_cross'; 9 | param.save_model_name='base_train_cross'; 10 | param.test_interval=500; 11 | param.train_maxiter=4000; 12 | param.data_path=fullfile(fileparts(pwd),'generate_data'); 13 | param.traindata_filename='train_data_Prid'; 14 | param.testdata_filename='test_data_Prid'; 15 | param.use_data_split_index=1; 16 | param.data_split_num=1; 17 | param.train_person_num=150; 18 | param.use_gpu=1; 19 | param.gpu_id=0; 20 | %% 21 | for split_index=param.use_data_split_index:param.data_split_num 22 | if ~exist(strcat(param.save_model_file,num2str(split_index)),'file') 23 | mkdir(strcat(param.save_model_file,num2str(split_index))); 24 | end 25 | load(strcat(param.data_path,param.traindata_filename,num2str(split_index),'/train_data.mat')); 26 | %% find caffe 27 | cur_path=pwd; 28 | addpath(genpath(param.caffe_path)) 29 | cd(param.caffe_path); 30 | caffe.reset_all; 31 | caffe.init_log(fullfile(cur_path,'log')); 32 | addpath(param.caffe_path); 33 | if param.use_gpu 34 | caffe.set_mode_gpu; 35 | else 36 | caffe.set_mode_cpu; 37 | end 38 | cd(cur_path); 39 | caffe_solver=caffe.get_solver(param.solver_netfile,param.gpu_id); 40 | net=caffe.get_net(param.test_net_file,'test'); 41 | caffe_solver.use_caffemodel(param.fintune_model); 42 | input_data_shape=caffe_solver.nets{1}.blobs('data').shape; 43 | batch_size=input_data_shape(4); 44 | batch_data=zeros(input_data_shape,'single'); 45 | batch_label=zeros(1,1,1,batch_size,'single'); 46 | train_x_axis=[]; 47 | train_y_axis=[]; 48 | iter=0; 49 | while iter100 && mod(iter,100)==0 76 | caffe_solver.nets{1}.save(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(iter),'.caffemodel')); 77 | end 78 | end 79 | % test_network; 80 | end -------------------------------------------------------------------------------- /train_baseline/train_LPW.m: -------------------------------------------------------------------------------- 1 | %%train network config 2 | param.caffe_path=fullfile(fileparts(pwd),'matcaffe'); 3 | param.solver_netfile=fullfile(fileparts(pwd),'model','solver_bn.prototxt'); 4 | param.fintune_model=fullfile(fileparts(pwd),'pretrain_model','googlenet_bn.caffemodel'); 5 | param.test_net_file=fullfile(fileparts(pwd),'model','test_bn.prototxt'); 6 | param.test_batch_size=32; 7 | param.result_save_file='LPW.txt'; 8 | param.save_model_file='LPW'; 9 | param.save_model_name='LPW_iter'; 10 | param.test_interval=500; 11 | param.train_maxiter=50000; 12 | param.data_path=fullfile(fileparts(pwd),'generate_data'); 13 | param.traindata_filename='train_data_LPW'; 14 | param.testdata_filename='test_data_LPW'; 15 | param.use_data_split_index=1; 16 | param.data_split_num=1; 17 | param.test_person_num=1975; 18 | param.use_gpu=1; 19 | param.gpu_id=0; 20 | %% 21 | for split_index=param.use_data_split_index:param.data_split_num 22 | if ~exist(strcat(param.save_model_file,num2str(split_index)),'file') 23 | mkdir(strcat(param.save_model_file,num2str(split_index))); 24 | end 25 | load(strcat(param.data_path,param.traindata_filename,num2str(split_index),'/train_data.mat')); 26 | %% find caffe 27 | cur_path=pwd; 28 | addpath(genpath(param.caffe_path)) 29 | cd(param.caffe_path); 30 | caffe.reset_all; 31 | caffe.init_log(fullfile(cur_path,'log')); 32 | addpath(param.caffe_path); 33 | if param.use_gpu 34 | caffe.set_mode_gpu; 35 | else 36 | caffe.set_mode_cpu; 37 | end 38 | cd(cur_path); 39 | caffe_solver=caffe.get_solver(param.solver_netfile,param.gpu_id); 40 | net=caffe.get_net(param.test_net_file,'test'); 41 | caffe_solver.use_caffemodel(param.fintune_model); 42 | input_data_shape=caffe_solver.nets{1}.blobs('data').shape; 43 | batch_size=input_data_shape(4); 44 | batch_data=zeros(input_data_shape,'single'); 45 | batch_label=zeros(1,1,1,batch_size,'single'); 46 | train_x_axis=[]; 47 | train_y_axis=[]; 48 | label_train=[label_train_cam2_view1;label_train_cam2_view2;label_train_cam2_view3;label_train_cam2_view4; ... 49 | label_train_cam3_view1;label_train_cam3_view2;label_train_cam3_view3;label_train_cam3_view4]; 50 | train_image_name=[train_image_name_cam2_view1,train_image_name_cam2_view2,train_image_name_cam2_view3,train_image_name_cam2_view4, ... 51 | train_image_name_cam3_view1,train_image_name_cam3_view2,train_image_name_cam3_view3,train_image_name_cam3_view4]; 52 | iter=0; 53 | while iter10000 && mod(iter,200)==0 79 | caffe_solver.nets{1}.save(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(iter),'.caffemodel')); 80 | end 81 | end 82 | %test_network_for_LPW; 83 | end -------------------------------------------------------------------------------- /generate_data/generate_iLIDS_VID_data.m: -------------------------------------------------------------------------------- 1 | %%generate data config 2 | param.split_data_num=1; 3 | param.file_path_cam1=fullfile(fileparts(pwd),'iLIDS-VID','i-LIDS-VID','sequences','cam1'); 4 | param.file_path_cam2=fullfile(fileparts(pwd),'iLIDS-VID','i-LIDS-VID','sequences','cam2'); 5 | param.save_traindata_filename='train_data_iLID'; 6 | param.save_testdata_filename='test_data_iLID'; 7 | %%generate ten split train/test data 8 | for split_num_start=1:param.split_data_num 9 | if ~exist(strcat(param.save_traindata_filename,num2str(split_num_start)),'file') 10 | mkdir(strcat(param.save_traindata_filename,num2str(split_num_start))); 11 | end 12 | if ~exist(strcat(param.save_testdata_filename,num2str(split_num_start)),'file') 13 | mkdir(strcat(param.save_testdata_filename,num2str(split_num_start))); 14 | end 15 | subdir_cam1=dir(param.file_path_cam1); 16 | subdir_cam2=dir(param.file_path_cam2); 17 | person_num=1:(length(subdir_cam1)-2); 18 | train_data_select=randperm((length(subdir_cam1)-2),(length(subdir_cam1)-2)/2); 19 | train_data_index=person_num(train_data_select); 20 | test_data_index=setdiff(person_num,train_data_index); 21 | %generate train data 22 | train_data_cam1=[]; 23 | label_train_cam1=[]; 24 | train_image_name_cam1={}; 25 | train_data_cam2=[]; 26 | label_train_cam2=[]; 27 | train_image_name_cam2={}; 28 | for i=1:(length(subdir_cam1)-2)/2 29 | fprintf('process train data:%d/%d\n',i,(length(subdir_cam1)-2)/2); 30 | index=train_data_index(i); 31 | image_path_cam1=fullfile(param.file_path_cam1,subdir_cam1(index+2).name,'/'); 32 | image_list_cam1=dir(image_path_cam1); 33 | for j=3:length(image_list_cam1); 34 | image_name=strcat(image_path_cam1,image_list_cam1(j).name); 35 | image_data=imread(image_name); 36 | train_data_cam1=[train_data_cam1;reshape(image_data,1,64*128*3)]; 37 | label_train_cam1=[label_train_cam1;i]; 38 | train_image_name_cam1=[train_image_name_cam1,image_name]; 39 | end 40 | image_path_cam2=fullfile(param.file_path_cam2,subdir_cam2(index+2).name,'/'); 41 | image_list_cam2=dir(image_path_cam2); 42 | for j=3:length(image_list_cam2); 43 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 44 | image_data=imread(image_name); 45 | train_data_cam2=[train_data_cam2;reshape(image_data,1,64*128*3)]; 46 | label_train_cam2=[label_train_cam2;i]; 47 | train_image_name_cam2=[train_image_name_cam2,image_name]; 48 | end 49 | end 50 | save(strcat(param.save_traindata_filename,num2str(split_num_start),'/train_data.mat'),'train_data_cam1','train_data_cam2','label_train_cam1','label_train_cam2','train_image_name_cam1','train_image_name_cam2'); 51 | %generate test data 52 | test_data_cam1=[]; 53 | label_test_cam1=[]; 54 | test_image_name_cam1={}; 55 | test_data_cam2=[]; 56 | label_test_cam2=[]; 57 | test_image_name_cam2={}; 58 | for i=1:(length(subdir_cam1)-2)/2 59 | fprintf('process test data:%d/%d\n',i,(length(subdir_cam1)-2)/2); 60 | index=test_data_index(i); 61 | image_path_cam1=fullfile(param.file_path_cam1,subdir_cam1(index+2).name,'/'); 62 | image_list_cam1=dir(image_path_cam1); 63 | for j=3:length(image_list_cam1); 64 | image_name=strcat(image_path_cam1,image_list_cam1(j).name); 65 | image_data=imread(image_name); 66 | test_data_cam1=[test_data_cam1;reshape(image_data,1,64*128*3)]; 67 | label_test_cam1=[label_test_cam1;i+150]; 68 | test_image_name_cam1=[test_image_name_cam1,image_name]; 69 | end 70 | image_path_cam2=fullfile(param.file_path_cam2,subdir_cam2(index+2).name,'/'); 71 | image_list_cam2=dir(image_path_cam2); 72 | for j=3:length(image_list_cam2); 73 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 74 | image_data=imread(image_name); 75 | test_data_cam2=[test_data_cam2;reshape(image_data,1,64*128*3)]; 76 | label_test_cam2=[label_test_cam2;i+150]; 77 | test_image_name_cam2=[test_image_name_cam2,image_name]; 78 | end 79 | end 80 | save(strcat(param.save_testdata_filename,num2str(split_num_start),'/test_data.mat'),'test_data_cam1','test_data_cam2','label_test_cam1','label_test_cam2','test_image_name_cam1','test_image_name_cam2'); 81 | end -------------------------------------------------------------------------------- /train_PQAN/train_network_and_test.m: -------------------------------------------------------------------------------- 1 | %%train network config 2 | param.caffe_path=fullfile(fileparts(pwd),'matcaffe'); 3 | param.solver_netfile=fullfile(fileparts(pwd),'model','solver_PQAN_image.prototxt'); 4 | param.fintune_model=fullfile(fileparts(pwd),'pretrain_model','googlenet_bn.caffemodel'); 5 | param.test_net_file=fullfile(fileparts(pwd),'model','test_PQAN_image.prototxt'); 6 | param.test_batch_size=32; 7 | param.result_save_file='result.txt'; 8 | param.save_model_file='ilIDS_VID_model'; 9 | param.save_model_name='PQAN_322_iter'; 10 | param.test_interval=500; 11 | param.train_maxiter=15000; 12 | param.data_path=fullfile(fileparts(pwd),'generate_data'); 13 | param.traindata_filename='train_data_iLID'; 14 | param.testdata_filename='test_data_iLID'; 15 | param.use_data_split_index=1; 16 | param.data_split_num=1; 17 | param.train_person_num=150; 18 | param.use_gpu=1; 19 | param.gpu_id=0; 20 | %% 21 | for split_index=param.use_data_split_index:param.data_split_num 22 | if ~exist(strcat(param.save_model_file,num2str(split_index)),'file') 23 | mkdir(strcat(param.save_model_file,num2str(split_index))); 24 | end 25 | load(strcat(param.data_path,param.traindata_filename,num2str(split_index),'/train_data.mat')); 26 | %% find caffe 27 | cur_path=pwd; 28 | cd(param.caffe_path); 29 | addpath(genpath(param.caffe_path)) 30 | caffe.reset_all; 31 | caffe.init_log(fullfile(cur_path,'log')); 32 | addpath(param.caffe_path); 33 | if param.use_gpu 34 | caffe.set_mode_gpu; 35 | else 36 | caffe.set_mode_cpu; 37 | end 38 | cd(cur_path); 39 | caffe_solver=caffe.get_solver(param.solver_netfile,param.gpu_id); 40 | net=caffe.get_net(param.test_net_file,'test'); 41 | caffe_solver.use_caffemodel(param.fintune_model); 42 | input_data_shape=caffe_solver.nets{1}.blobs('data').shape; 43 | batch_size=input_data_shape(4); 44 | batch_data=zeros(input_data_shape,'single'); 45 | batch_label=zeros(1,1,1,batch_size,'single'); 46 | batch_sim=ones(1,1,1,1,'single'); 47 | % 48 | batch_score=ones(1,1,3,batch_size,'single'); 49 | % 50 | train_x_axis=[]; 51 | train_y_axis=[]; 52 | iter=0; 53 | while iter 80 73 | fprintf('stop'); 74 | end 75 | end 76 | % test in the training stage 77 | if iter>10000 && mod(iter,param.test_interval)==0 78 | caffe_solver.nets{1}.save(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(iter),'.caffemodel')); 79 | net.copy_from(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(iter),'.caffemodel')); 80 | net.blobs('data').reshape([224 224 3 param.test_batch_size]); 81 | load(strcat(param.data_path,param.testdata_filename,num2str(split_index),'/test_data.mat')); 82 | test_script; 83 | end 84 | if iter>9900 && mod(iter,100)==0 85 | caffe_solver.nets{1}.save(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(iter),'.caffemodel')); 86 | end 87 | end 88 | % test_network; 89 | end 90 | -------------------------------------------------------------------------------- /train_PQAN/train_LPW.m: -------------------------------------------------------------------------------- 1 | %%train network config 2 | param.caffe_path=fullfile(fileparts(pwd),'matcaffe'); 3 | param.solver_netfile=fullfile(fileparts(pwd),'model','solver_PQAN_image.prototxt'); 4 | param.fintune_model=fullfile(fileparts(pwd),'pretrain_model','googlenet_bn.caffemodel'); 5 | param.test_net_file=fullfile(fileparts(pwd),'model','test_PQAN_image.prototxt'); 6 | param.test_batch_size=32; 7 | param.result_save_file='LPW.txt'; 8 | param.save_model_file='LPW'; 9 | param.save_model_name='LPW_iter'; 10 | param.test_interval=1000; 11 | param.train_maxiter=150000; 12 | param.data_path=fullfile(fileparts(pwd),'generate_data'); 13 | param.traindata_filename='train_data_LPW'; 14 | param.testdata_filename='test_data_LPW'; 15 | param.use_data_split_index=1; 16 | param.data_split_num=1; 17 | param.test_person_num=1975; 18 | param.use_gpu=1; 19 | param.gpu_id=0; 20 | %% 21 | for split_index=param.use_data_split_index:param.data_split_num 22 | if ~exist(strcat(param.save_model_file,num2str(split_index)),'file') 23 | mkdir(strcat(param.save_model_file,num2str(split_index))); 24 | end 25 | load(strcat(param.data_path,param.traindata_filename,num2str(split_index),'/train_data.mat')); 26 | %% find caffe 27 | cur_path=pwd; 28 | addpath(genpath(param.caffe_path)) 29 | cd(param.caffe_path); 30 | caffe.reset_all; 31 | caffe.init_log(fullfile(cur_path,'log')); 32 | addpath(param.caffe_path); 33 | if param.use_gpu 34 | caffe.set_mode_gpu; 35 | else 36 | caffe.set_mode_cpu; 37 | end 38 | cd(cur_path); 39 | caffe_solver=caffe.get_solver(param.solver_netfile,param.gpu_id); 40 | net=caffe.get_net(param.test_net_file,'test'); 41 | caffe_solver.use_caffemodel(param.fintune_model); 42 | input_data_shape=caffe_solver.nets{1}.blobs('data').shape; 43 | batch_size=input_data_shape(4); 44 | batch_data=zeros(input_data_shape,'single'); 45 | batch_label=zeros(1,1,1,batch_size,'single'); 46 | batch_sim=ones(1,1,1,1,'single'); 47 | % fix score 48 | %batch_score=ones(1,1,3,batch_size,'single'); 49 | % 50 | train_x_axis=[]; 51 | train_y_axis=[]; 52 | label_train_view1=[label_train_cam2_view1;label_train_cam3_view1]; 53 | label_train_view2=[label_train_cam2_view2;label_train_cam3_view2]; 54 | label_train_view3=[label_train_cam2_view3;label_train_cam3_view3]; 55 | label_train_view4=[label_train_cam2_view4;label_train_cam3_view4]; 56 | train_image_name_view1=[train_image_name_cam2_view1,train_image_name_cam3_view1]; 57 | train_image_name_view2=[train_image_name_cam2_view2,train_image_name_cam3_view2]; 58 | train_image_name_view3=[train_image_name_cam2_view3,train_image_name_cam3_view3]; 59 | train_image_name_view4=[train_image_name_cam2_view4,train_image_name_cam3_view4]; 60 | iter=0; 61 | while iter10000 && mod(iter,500)==0 91 | caffe_solver.nets{1}.save(strcat(param.save_model_file,num2str(split_index),'/',param.save_model_name,'_',num2str(iter),'.caffemodel')); 92 | end 93 | end 94 | %test_network_for_LPW; 95 | end -------------------------------------------------------------------------------- /generate_data/generate_prid2011_data.m: -------------------------------------------------------------------------------- 1 | %%generate data config 2 | param.split_data_num=1; 3 | param.file_path_cam1=fullfile(fileparts(pwd),'prid_2011','multi_shot','cam_a'); 4 | param.file_path_cam2=fullfile(fileparts(pwd),'prid_2011','multi_shot','cam_b'); 5 | param.save_traindata_filename='train_data_Prid'; 6 | param.save_testdata_filename='test_data_Prid'; 7 | %% generate ten split train/test data 8 | for split_num_start=1:param.split_data_num 9 | if ~exist(strcat(param.save_traindata_filename,num2str(split_num_start)),'file') 10 | mkdir(strcat(param.save_traindata_filename,num2str(split_num_start))); 11 | end 12 | if ~exist(strcat(param.save_testdata_filename,num2str(split_num_start)),'file') 13 | mkdir(strcat(param.save_testdata_filename,num2str(split_num_start))); 14 | end 15 | subdir_cam1=dir(param.file_path_cam1); 16 | subdir_cam2=dir(param.file_path_cam2); 17 | %% select images >27 frame 18 | person_file_cam1=[]; 19 | person_file_cam2=[]; 20 | for i=3:202 21 | image_path_a=fullfile(param.file_path_cam1,subdir_cam1(i).name,'/'); 22 | image_list_a=dir(image_path_a); 23 | len=length(image_list_a); 24 | if len<29 25 | continue; 26 | else 27 | person_file_cam1=[person_file_cam1;i-2]; 28 | end 29 | end 30 | for i=3:202 31 | image_path_b=fullfile(param.file_path_cam2,subdir_cam2(i).name,'/'); 32 | image_list_b=dir(image_path_b); 33 | len=length(image_list_b); 34 | if len<29 35 | continue; 36 | else 37 | person_file_cam2=[person_file_cam2;i-2]; 38 | end 39 | end 40 | %% 41 | person_num=intersect(person_file_cam1,person_file_cam2); 42 | select_list_len=size(person_num,1); 43 | train_data_select=randperm(select_list_len,select_list_len/2); 44 | train_data_index=person_num(train_data_select); 45 | test_data_index=setdiff(person_num,train_data_index); 46 | %generate train data 47 | train_data_cam1=[]; 48 | label_train_cam1=[]; 49 | train_image_name_cam1={}; 50 | train_data_cam2=[]; 51 | label_train_cam2=[]; 52 | train_image_name_cam2={}; 53 | for i=1:(length(train_data_index)) 54 | fprintf('process train data:%d/%d\n',i,(length(train_data_index))); 55 | index=train_data_index(i); 56 | image_path_cam1=fullfile(param.file_path_cam1,subdir_cam1(index+2).name,'/'); 57 | image_list_cam1=dir(image_path_cam1); 58 | for j=3:length(image_list_cam1); 59 | image_name=strcat(image_path_cam1,image_list_cam1(j).name); 60 | image_data=imread(image_name); 61 | train_data_cam1=[train_data_cam1;reshape(image_data,1,64*128*3)]; 62 | label_train_cam1=[label_train_cam1;i]; 63 | train_image_name_cam1=[train_image_name_cam1,image_name]; 64 | end 65 | image_path_cam2=fullfile(param.file_path_cam2,subdir_cam2(index+2).name,'/'); 66 | image_list_cam2=dir(image_path_cam2); 67 | for j=3:length(image_list_cam2); 68 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 69 | image_data=imread(image_name); 70 | train_data_cam2=[train_data_cam2;reshape(image_data,1,64*128*3)]; 71 | label_train_cam2=[label_train_cam2;i]; 72 | train_image_name_cam2=[train_image_name_cam2,image_name]; 73 | end 74 | end 75 | save(strcat(param.save_traindata_filename,num2str(split_num_start),'/train_data.mat'),'train_data_cam1','train_data_cam2','label_train_cam1','label_train_cam2','train_image_name_cam1','train_image_name_cam2'); 76 | %% generate test data 77 | test_data_cam1=[]; 78 | label_test_cam1=[]; 79 | test_image_name_cam1={}; 80 | test_data_cam2=[]; 81 | label_test_cam2=[]; 82 | test_image_name_cam2={}; 83 | for i=1:(length(test_data_index)) 84 | fprintf('process test data:%d/%d\n',i,(length(test_data_index))); 85 | index=test_data_index(i); 86 | image_path_cam1=fullfile(param.file_path_cam1,subdir_cam1(index+2).name,'/'); 87 | image_list_cam1=dir(image_path_cam1); 88 | for j=3:length(image_list_cam1); 89 | image_name=strcat(image_path_cam1,image_list_cam1(j).name); 90 | image_data=imread(image_name); 91 | test_data_cam1=[test_data_cam1;reshape(image_data,1,64*128*3)]; 92 | label_test_cam1=[label_test_cam1;i+89]; 93 | test_image_name_cam1=[test_image_name_cam1,image_name]; 94 | end 95 | image_path_cam2=fullfile(param.file_path_cam2,subdir_cam2(index+2).name,'/'); 96 | image_list_cam2=dir(image_path_cam2); 97 | for j=3:length(image_list_cam2); 98 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 99 | image_data=imread(image_name); 100 | test_data_cam2=[test_data_cam2;reshape(image_data,1,64*128*3)]; 101 | label_test_cam2=[label_test_cam2;i+89]; 102 | test_image_name_cam2=[test_image_name_cam2,image_name]; 103 | end 104 | end 105 | save(strcat(param.save_testdata_filename,num2str(split_num_start),'/test_data.mat'),'test_data_cam1','test_data_cam2','label_test_cam1','label_test_cam2','test_image_name_cam1','test_image_name_cam2'); 106 | end -------------------------------------------------------------------------------- /train_PQAN/test_script_moreparam.m: -------------------------------------------------------------------------------- 1 | %%test network 2 | cam1_size=size(test_data_cam1); 3 | cam2_size=size(test_data_cam2); 4 | cam1_feature1=[]; 5 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 6 | for m=0:floor(cam1_size(1)/param.test_batch_size)-1 7 | for n=1:param.test_batch_size 8 | im_data=imresize((reshape(single(test_data_cam1(m*param.test_batch_size+n,:)),128,64,3)),[224 224]); 9 | im_data=im_data(:,:,[3,2,1]); 10 | im_data=permute(im_data,[2,1,3]); 11 | test_batch_data(:,:,:,n)=im_data; 12 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 13 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 14 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 15 | end 16 | net.blobs('data').set_data(test_batch_data); 17 | net.forward_prefilled; 18 | cam1_feature1=[cam1_feature1;(squeeze(net.blobs('normfeature1').get_data))']; 19 | end 20 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 21 | for m=(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size+1:cam1_size(1) 22 | count=m-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 23 | im_data=imresize((reshape(single(test_data_cam1(m,:)),128,64,3)),[224 224]); 24 | im_data=im_data(:,:,[3,2,1]); 25 | im_data=permute(im_data,[2,1,3]); 26 | test_batch_data(:,:,:,count)=im_data; 27 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 28 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 29 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 30 | end 31 | net.blobs('data').set_data(test_batch_data); 32 | net.forward_prefilled; 33 | index=cam1_size(1)-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 34 | result1=(squeeze(net.blobs('normfeature1').get_data))'; 35 | cam1_feature1=[cam1_feature1;result1(1:index,:)]; 36 | prob_feature=[]; 37 | for m=1:param.test_person_num 38 | test_label_index=find(label_test_cam1==(m+param.test_person_num)); 39 | a=sum(cam1_feature1(test_label_index,:))/size(test_label_index,1); 40 | prob_feature=[prob_feature;a]; 41 | end 42 | %extract feature cam2 43 | cam2_feature1=[]; 44 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 45 | for m=0:floor(cam2_size(1)/param.test_batch_size)-1 46 | for n=1:param.test_batch_size 47 | im_data=imresize((reshape(single(test_data_cam2(m*param.test_batch_size+n,:)),128,64,3)),[224 224]); 48 | im_data=im_data(:,:,[3,2,1]); 49 | im_data=permute(im_data,[2,1,3]); 50 | test_batch_data(:,:,:,n)=im_data; 51 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 52 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 53 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 54 | end 55 | net.blobs('data').set_data(test_batch_data); 56 | net.forward_prefilled; 57 | cam2_feature1=[cam2_feature1;(squeeze(net.blobs('normfeature1').get_data))']; 58 | end 59 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 60 | for m=(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size+1:cam2_size(1) 61 | count=m-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 62 | im_data=imresize((reshape(single(test_data_cam2(m,:)),128,64,3)),[224 224]); 63 | im_data=im_data(:,:,[3,2,1]); 64 | im_data=permute(im_data,[2,1,3]); 65 | test_batch_data(:,:,:,count)=im_data; 66 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 67 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 68 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 69 | end 70 | net.blobs('data').set_data(test_batch_data); 71 | net.forward_prefilled; 72 | index=cam2_size(1)-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 73 | result1=(squeeze(net.blobs('normfeature1').get_data))'; 74 | cam2_feature1=[cam2_feature1;result1(1:index,:)]; 75 | gallery_feature=[]; 76 | for m=1:param.test_person_num 77 | test_label_index=find(label_test_cam2==(m+param.test_person_num)); 78 | a=sum(cam2_feature1(test_label_index,:))/size(test_label_index,1); 79 | gallery_feature=[gallery_feature;a]; 80 | end 81 | % cal cmc 82 | prob_norm=bsxfun(@rdivide,prob_feature,sum(abs(prob_feature).^2,2).^(1/2)); 83 | gallery_norm=bsxfun(@rdivide,gallery_feature,sum(abs(gallery_feature).^2,2).^(1/2)); 84 | % [~,it]=sort(prob_norm*gallery_norm',2,'descend'); 85 | score_matrix=prob_norm*gallery_norm'; 86 | rank1_hit=0; 87 | rank5_hit=0; 88 | rank10_hit=0; 89 | rank20_hit=0; 90 | problen=size(prob_feature,1); 91 | for m=1:problen 92 | [~,location]=sort(score_matrix(m,:),2,'descend'); 93 | if find(location(1)==m) 94 | rank1_hit=rank1_hit+1; 95 | end 96 | if find(location(1:5)==m) 97 | rank5_hit=rank5_hit+1; 98 | end 99 | if find(location(1:10)==m) 100 | rank10_hit=rank10_hit+1; 101 | end 102 | if find(location(1:20)==m) 103 | rank20_hit=rank20_hit+1; 104 | end 105 | end 106 | rank_acc=[rank1_hit/problen,rank5_hit/problen,rank10_hit/problen,rank20_hit/problen]; 107 | fin=fopen(param.result_save_file,'a'); 108 | fprintf(fin,'split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 109 | fprintf('split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 110 | fclose(fin); -------------------------------------------------------------------------------- /train_baseline/test_script.m: -------------------------------------------------------------------------------- 1 | %%test network 2 | cam1_size=size(test_data_cam1); 3 | cam2_size=size(test_data_cam2); 4 | cam1_feature1=[]; 5 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 6 | for m=0:floor(cam1_size(1)/param.test_batch_size)-1 7 | for n=1:param.test_batch_size 8 | im_data=imresize((reshape(single(test_data_cam1(m*param.test_batch_size+n,:)),128,64,3)),[224 224]); 9 | im_data=im_data(:,:,[3,2,1]); 10 | im_data=permute(im_data,[2,1,3]); 11 | test_batch_data(:,:,:,n)=im_data; 12 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 13 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 14 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 15 | end 16 | net.blobs('data').set_data(test_batch_data); 17 | net.forward_prefilled; 18 | cam1_feature1=[cam1_feature1;(squeeze(net.blobs('pool5/7x7_s1').get_data))']; 19 | end 20 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 21 | for m=(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size+1:cam1_size(1) 22 | count=m-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 23 | im_data=imresize((reshape(single(test_data_cam1(m,:)),128,64,3)),[224 224]); 24 | im_data=im_data(:,:,[3,2,1]); 25 | im_data=permute(im_data,[2,1,3]); 26 | test_batch_data(:,:,:,count)=im_data; 27 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 28 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 29 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 30 | end 31 | net.blobs('data').set_data(test_batch_data); 32 | net.forward_prefilled; 33 | index=cam1_size(1)-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 34 | result1=(squeeze(net.blobs('pool5/7x7_s1').get_data))'; 35 | cam1_feature1=[cam1_feature1;result1(1:index,:)]; 36 | prob_feature=[]; 37 | name_cam1={}; 38 | for m=1:param.train_person_num 39 | test_label_index=find(label_test_cam1==(m+param.train_person_num)); 40 | a=sum(cam1_feature1(test_label_index,:))/size(test_label_index,1); 41 | prob_feature=[prob_feature;a]; 42 | name_cam1=[name_cam1,test_image_name_cam1{test_label_index(1)}]; 43 | end 44 | %extract feature cam2 45 | cam2_feature1=[]; 46 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 47 | for m=0:floor(cam2_size(1)/param.test_batch_size)-1 48 | for n=1:param.test_batch_size 49 | im_data=imresize((reshape(single(test_data_cam2(m*param.test_batch_size+n,:)),128,64,3)),[224 224]); 50 | im_data=im_data(:,:,[3,2,1]); 51 | im_data=permute(im_data,[2,1,3]); 52 | test_batch_data(:,:,:,n)=im_data; 53 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 54 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 55 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 56 | end 57 | net.blobs('data').set_data(test_batch_data); 58 | net.forward_prefilled; 59 | cam2_feature1=[cam2_feature1;(squeeze(net.blobs('pool5/7x7_s1').get_data))']; 60 | end 61 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 62 | for m=(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size+1:cam2_size(1) 63 | count=m-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 64 | im_data=imresize((reshape(single(test_data_cam2(m,:)),128,64,3)),[224 224]); 65 | im_data=im_data(:,:,[3,2,1]); 66 | im_data=permute(im_data,[2,1,3]); 67 | test_batch_data(:,:,:,count)=im_data; 68 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 69 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 70 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 71 | end 72 | net.blobs('data').set_data(test_batch_data); 73 | net.forward_prefilled; 74 | index=cam2_size(1)-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 75 | result1=(squeeze(net.blobs('pool5/7x7_s1').get_data))'; 76 | cam2_feature1=[cam2_feature1;result1(1:index,:)]; 77 | gallery_feature=[]; 78 | %% 79 | name_cam2={}; 80 | for m=1:param.train_person_num 81 | test_label_index=find(label_test_cam2==(m+param.train_person_num)); 82 | a=sum(cam2_feature1(test_label_index,:))/size(test_label_index,1); 83 | gallery_feature=[gallery_feature;a]; 84 | name_cam2=[name_cam2,train_image_name_cam2{test_label_index(1)}]; 85 | end 86 | % cal cmc 87 | prob_norm=bsxfun(@rdivide,prob_feature,sum(abs(prob_feature).^2,2).^(1/2)); 88 | gallery_norm=bsxfun(@rdivide,gallery_feature,sum(abs(gallery_feature).^2,2).^(1/2)); 89 | % [~,it]=sort(prob_norm*gallery_norm',2,'descend'); 90 | score_matrix=prob_norm*gallery_norm'; 91 | rank1_hit=0; 92 | rank5_hit=0; 93 | rank10_hit=0; 94 | rank20_hit=0; 95 | problen=size(prob_feature,1); 96 | for m=1:problen 97 | [~,location]=sort(score_matrix(m,:),2,'descend'); 98 | if find(location(1)==m) 99 | rank1_hit=rank1_hit+1; 100 | end 101 | if find(location(1:5)==m) 102 | rank5_hit=rank5_hit+1; 103 | end 104 | if find(location(1:10)==m) 105 | rank10_hit=rank10_hit+1; 106 | end 107 | if find(location(1:20)==m) 108 | rank20_hit=rank20_hit+1; 109 | end 110 | end 111 | rank_acc=[rank1_hit/problen,rank5_hit/problen,rank10_hit/problen,rank20_hit/problen]; 112 | fin=fopen(param.result_save_file,'a'); 113 | fprintf(fin,'split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 114 | fprintf('split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 115 | fclose(fin); -------------------------------------------------------------------------------- /train_PQAN/test_script.m: -------------------------------------------------------------------------------- 1 | %%test network 2 | cam1_size=size(test_data_cam1); 3 | cam2_size=size(test_data_cam2); 4 | cam1_feature1=[]; 5 | cam1_feature2=[]; 6 | cam1_feature3=[]; 7 | cam1_score=[]; 8 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 9 | for m=0:floor(cam1_size(1)/param.test_batch_size)-1 10 | for n=1:param.test_batch_size 11 | im_data=imresize((reshape(single(test_data_cam1(m*param.test_batch_size+n,:)),128,64,3)),[224 224]); 12 | im_data=im_data(:,:,[3,2,1]); 13 | im_data=permute(im_data,[2,1,3]); 14 | test_batch_data(:,:,:,n)=im_data; 15 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 16 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 17 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 18 | end 19 | net.blobs('data').set_data(test_batch_data); 20 | net.forward_prefilled; 21 | cam1_feature1=[cam1_feature1;(squeeze(net.blobs('data1_p_1').get_data))']; 22 | cam1_feature2=[cam1_feature2;(squeeze(net.blobs('data1_p_2').get_data))']; 23 | cam1_feature3=[cam1_feature3;(squeeze(net.blobs('data1_p_3').get_data))']; 24 | cam1_score=[cam1_score;(squeeze(net.blobs('sig').get_data))']; 25 | end 26 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 27 | for m=(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size+1:cam1_size(1) 28 | count=m-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 29 | im_data=imresize((reshape(single(test_data_cam1(m,:)),128,64,3)),[224 224]); 30 | im_data=im_data(:,:,[3,2,1]); 31 | im_data=permute(im_data,[2,1,3]); 32 | test_batch_data(:,:,:,count)=im_data; 33 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 34 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 35 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 36 | end 37 | net.blobs('data').set_data(test_batch_data); 38 | net.forward_prefilled; 39 | index=cam1_size(1)-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 40 | result1=(squeeze(net.blobs('data1_p_1').get_data))'; 41 | result2=(squeeze(net.blobs('data1_p_2').get_data))'; 42 | result3=(squeeze(net.blobs('data1_p_3').get_data))'; 43 | score=(squeeze(net.blobs('sig').get_data))'; 44 | cam1_feature1=[cam1_feature1;result1(1:index,:)]; 45 | cam1_feature2=[cam1_feature2;result2(1:index,:)]; 46 | cam1_feature3=[cam1_feature3;result3(1:index,:)]; 47 | cam1_score=[cam1_score;score(1:index,:)]; 48 | prob_feature=[]; 49 | name_cam1={}; 50 | for m=1:param.train_person_num 51 | test_label_index=find(label_test_cam1==(m+param.train_person_num)); 52 | a=bsxfun(@times,cam1_feature1(test_label_index,:),cam1_score(test_label_index,1)); 53 | b=bsxfun(@times,cam1_feature2(test_label_index,:),cam1_score(test_label_index,2)); 54 | c=bsxfun(@times,cam1_feature3(test_label_index,:),cam1_score(test_label_index,3)); 55 | prob_feature=[prob_feature;sum(a/sum(cam1_score(test_label_index,1))),sum(b/sum(cam1_score(test_label_index,2))),sum(c/sum(cam1_score(test_label_index,3)))]; 56 | % prob_feature=[prob_feature;sum(a/sum(cam1_score(test_label_index,1)))]; 57 | % prob_feature=[prob_feature;sum(b/sum(cam1_score(test_label_index,2)))]; 58 | % prob_feature=[prob_feature;sum(c/sum(cam1_score(test_label_index,3)))]; 59 | name_cam1=[name_cam1,test_image_name_cam1{test_label_index(1)}]; 60 | end 61 | %extract feature cam2 62 | cam2_feature1=[]; 63 | cam2_feature2=[]; 64 | cam2_feature3=[]; 65 | cam2_score=[]; 66 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 67 | for m=0:floor(cam2_size(1)/param.test_batch_size)-1 68 | for n=1:param.test_batch_size 69 | im_data=imresize((reshape(single(test_data_cam2(m*param.test_batch_size+n,:)),128,64,3)),[224 224]); 70 | im_data=im_data(:,:,[3,2,1]); 71 | im_data=permute(im_data,[2,1,3]); 72 | test_batch_data(:,:,:,n)=im_data; 73 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 74 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 75 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 76 | end 77 | net.blobs('data').set_data(test_batch_data); 78 | net.forward_prefilled; 79 | cam2_feature1=[cam2_feature1;(squeeze(net.blobs('data1_p_1').get_data))']; 80 | cam2_feature2=[cam2_feature2;(squeeze(net.blobs('data1_p_2').get_data))']; 81 | cam2_feature3=[cam2_feature3;(squeeze(net.blobs('data1_p_3').get_data))']; 82 | cam2_score=[cam2_score;(squeeze(net.blobs('sig').get_data))']; 83 | end 84 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 85 | for m=(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size+1:cam2_size(1) 86 | count=m-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 87 | im_data=imresize((reshape(single(test_data_cam2(m,:)),128,64,3)),[224 224]); 88 | im_data=im_data(:,:,[3,2,1]); 89 | im_data=permute(im_data,[2,1,3]); 90 | test_batch_data(:,:,:,count)=im_data; 91 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 92 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 93 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 94 | end 95 | net.blobs('data').set_data(test_batch_data); 96 | net.forward_prefilled; 97 | index=cam2_size(1)-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 98 | result1=(squeeze(net.blobs('data1_p_1').get_data))'; 99 | result2=(squeeze(net.blobs('data1_p_2').get_data))'; 100 | result3=(squeeze(net.blobs('data1_p_3').get_data))'; 101 | score=(squeeze(net.blobs('sig').get_data))'; 102 | cam2_feature1=[cam2_feature1;result1(1:index,:)]; 103 | cam2_feature2=[cam2_feature2;result2(1:index,:)]; 104 | cam2_feature3=[cam2_feature3;result3(1:index,:)]; 105 | cam2_score=[cam2_score;score(1:index,:)]; 106 | gallery_feature=[]; 107 | name_cam2={}; 108 | for m=1:param.train_person_num 109 | test_label_index=find(label_test_cam2==(m+param.train_person_num)); 110 | a=bsxfun(@times,cam2_feature1(test_label_index,:),cam2_score(test_label_index,1)); 111 | b=bsxfun(@times,cam2_feature2(test_label_index,:),cam2_score(test_label_index,2)); 112 | c=bsxfun(@times,cam2_feature3(test_label_index,:),cam2_score(test_label_index,3)); 113 | gallery_feature=[gallery_feature;sum(a/sum(cam2_score(test_label_index,1))),sum(b/sum(cam2_score(test_label_index,2))),sum(c/sum(cam2_score(test_label_index,3)))]; 114 | % gallery_feature=[gallery_feature;sum(a/sum(cam2_score(test_label_index,1)))]; 115 | % gallery_feature=[gallery_feature;sum(b/sum(cam2_score(test_label_index,2)))]; 116 | % gallery_feature=[gallery_feature;sum(c/sum(cam2_score(test_label_index,3)))]; 117 | name_cam2=[name_cam2,test_image_name_cam2(test_label_index(1))]; 118 | end 119 | % cal cmc 120 | prob_norm=bsxfun(@rdivide,prob_feature,sum(abs(prob_feature).^2,2).^(1/2)); 121 | gallery_norm=bsxfun(@rdivide,gallery_feature,sum(abs(gallery_feature).^2,2).^(1/2)); 122 | % [~,it]=sort(prob_norm*gallery_norm',2,'descend'); 123 | score_matrix=prob_norm*gallery_norm'; 124 | rank1_hit=0; 125 | rank5_hit=0; 126 | rank10_hit=0; 127 | rank20_hit=0; 128 | problen=size(prob_feature,1); 129 | for m=1:problen 130 | [~,location]=sort(score_matrix(m,:),2,'descend'); 131 | if find(location(1)==m) 132 | rank1_hit=rank1_hit+1; 133 | end 134 | if find(location(1:5)==m) 135 | rank5_hit=rank5_hit+1; 136 | end 137 | if find(location(1:10)==m) 138 | rank10_hit=rank10_hit+1; 139 | end 140 | if find(location(1:20)==m) 141 | rank20_hit=rank20_hit+1; 142 | end 143 | end 144 | rank_acc=[rank1_hit/problen,rank5_hit/problen,rank10_hit/problen,rank20_hit/problen]; 145 | fin=fopen(param.result_save_file,'a'); 146 | fprintf(fin,'2below split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 147 | fprintf('split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 148 | fclose(fin); -------------------------------------------------------------------------------- /train_baseline/test_script_for_LPW.m: -------------------------------------------------------------------------------- 1 | %%test network 2 | cam1_size=size(label_test_cam1); 3 | cam2_size=size(label_test_cam2); 4 | cam3_size=size(label_test_cam3); 5 | cam1_feature1=[]; 6 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 7 | for m=0:floor(cam1_size(1)/param.test_batch_size)-1 8 | fprintf('process cam1:%d/%d\n',m,floor(cam1_size(1)/param.test_batch_size)-1); 9 | for n=1:param.test_batch_size 10 | im_data=imread(test_image_name_cam1{m*param.test_batch_size+n}); 11 | im_data=imresize(single(im_data),[224 224]); 12 | im_data=im_data(:,:,[3,2,1]); 13 | im_data=permute(im_data,[2,1,3]); 14 | test_batch_data(:,:,:,n)=im_data; 15 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 16 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 17 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 18 | end 19 | net.blobs('data').set_data(test_batch_data); 20 | net.forward_prefilled; 21 | cam1_feature1=[cam1_feature1;(squeeze(net.blobs('pool5/7x7_s1').get_data))']; 22 | end 23 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 24 | for m=(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size+1:cam1_size(1) 25 | fprintf('process cam1:%d/%d\n',m,cam1_size(1)); 26 | count=m-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 27 | im_data=imread(test_image_name_cam1{m}); 28 | im_data=imresize(single(im_data),[224 224]); 29 | im_data=im_data(:,:,[3,2,1]); 30 | im_data=permute(im_data,[2,1,3]); 31 | test_batch_data(:,:,:,count)=im_data; 32 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 33 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 34 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 35 | end 36 | net.blobs('data').set_data(test_batch_data); 37 | net.forward_prefilled; 38 | index=cam1_size(1)-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 39 | result1=(squeeze(net.blobs('pool5/7x7_s1').get_data))'; 40 | cam1_feature1=[cam1_feature1;result1(1:index,:)]; 41 | gallery_feature=[]; 42 | gallery_label=[]; 43 | for m=1:param.test_person_num 44 | test_label_index=find(label_test_cam1==(m)); 45 | if isempty(test_label_index) 46 | continue; 47 | end 48 | a=sum(cam1_feature1(test_label_index,:))/size(test_label_index,1); 49 | gallery_feature=[gallery_feature;a]; 50 | gallery_label=[gallery_label;m]; 51 | end 52 | %extract feature cam3 53 | cam3_feature1=[]; 54 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 55 | for m=0:floor(cam3_size(1)/param.test_batch_size)-1 56 | fprintf('process cam3:%d/%d\n',m,floor(cam3_size(1)/param.test_batch_size)-1); 57 | for n=1:param.test_batch_size 58 | im_data=imread(test_image_name_cam3{m*param.test_batch_size+n}); 59 | im_data=imresize(single(im_data),[224 224]); 60 | im_data=im_data(:,:,[3,2,1]); 61 | im_data=permute(im_data,[2,1,3]); 62 | test_batch_data(:,:,:,n)=im_data; 63 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 64 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 65 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 66 | end 67 | net.blobs('data').set_data(test_batch_data); 68 | net.forward_prefilled; 69 | cam3_feature1=[cam3_feature1;(squeeze(net.blobs('pool5/7x7_s1').get_data))']; 70 | end 71 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 72 | for m=(floor(cam3_size(1)/param.test_batch_size))*param.test_batch_size+1:cam3_size(1) 73 | fprintf('process cam3:%d/%d\n',m,cam3_size(1)); 74 | count=m-(floor(cam3_size(1)/param.test_batch_size))*param.test_batch_size; 75 | im_data=imread(test_image_name_cam3{m}); 76 | im_data=imresize(single(im_data),[224 224]); 77 | im_data=im_data(:,:,[3,2,1]); 78 | im_data=permute(im_data,[2,1,3]); 79 | test_batch_data(:,:,:,count)=im_data; 80 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 81 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 82 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 83 | end 84 | net.blobs('data').set_data(test_batch_data); 85 | net.forward_prefilled; 86 | index=cam3_size(1)-(floor(cam3_size(1)/param.test_batch_size))*param.test_batch_size; 87 | result1=(squeeze(net.blobs('pool5/7x7_s1').get_data))'; 88 | cam3_feature1=[cam3_feature1;result1(1:index,:)]; 89 | for m=1:param.test_person_num 90 | test_label_index=find(label_test_cam3==(m)); 91 | if isempty(test_label_index) 92 | continue; 93 | end 94 | a=sum(cam3_feature1(test_label_index,:))/size(test_label_index,1); 95 | gallery_feature=[gallery_feature;a]; 96 | gallery_label=[gallery_label;m]; 97 | end 98 | %extract feature cam2 99 | cam2_feature1=[]; 100 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 101 | for m=0:floor(cam2_size(1)/param.test_batch_size)-1 102 | fprintf('process cam2:%d/%d\n',m,floor(cam2_size(1)/param.test_batch_size)-1); 103 | for n=1:param.test_batch_size 104 | im_data=imread(test_image_name_cam2{m*param.test_batch_size+n}); 105 | im_data=imresize(single(im_data),[224 224]); 106 | im_data=im_data(:,:,[3,2,1]); 107 | im_data=permute(im_data,[2,1,3]); 108 | test_batch_data(:,:,:,n)=im_data; 109 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 110 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 111 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 112 | end 113 | net.blobs('data').set_data(test_batch_data); 114 | net.forward_prefilled; 115 | cam2_feature1=[cam2_feature1;(squeeze(net.blobs('pool5/7x7_s1').get_data))']; 116 | end 117 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 118 | for m=(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size+1:cam2_size(1) 119 | fprintf('process cam2:%d/%d\n',m,cam2_size(1)); 120 | count=m-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 121 | im_data=imread(test_image_name_cam2{m}); 122 | im_data=imresize(single(im_data),[224 224]); 123 | im_data=im_data(:,:,[3,2,1]); 124 | im_data=permute(im_data,[2,1,3]); 125 | test_batch_data(:,:,:,count)=im_data; 126 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 127 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 128 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 129 | end 130 | net.blobs('data').set_data(test_batch_data); 131 | net.forward_prefilled; 132 | index=cam2_size(1)-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 133 | result1=(squeeze(net.blobs('pool5/7x7_s1').get_data))'; 134 | cam2_feature1=[cam2_feature1;result1(1:index,:)]; 135 | prob_feature=[]; 136 | prob_label=[]; 137 | for m=1:param.test_person_num 138 | test_label_index=find(label_test_cam2==(m)); 139 | if isempty(test_label_index) 140 | continue; 141 | end 142 | a=sum(cam2_feature1(test_label_index,:))/size(test_label_index,1); 143 | prob_feature=[prob_feature;a]; 144 | prob_label=[prob_label;m]; 145 | end 146 | % cal cmc 147 | prob_norm=bsxfun(@rdivide,prob_feature,sum(abs(prob_feature).^2,2).^(1/2)); 148 | gallery_norm=bsxfun(@rdivide,gallery_feature,sum(abs(gallery_feature).^2,2).^(1/2)); 149 | % [~,it]=sort(prob_norm*gallery_norm',2,'descend'); 150 | score_matrix=prob_norm*gallery_norm'; 151 | rank1_hit=0; 152 | rank5_hit=0; 153 | rank10_hit=0; 154 | rank20_hit=0; 155 | problen=size(prob_feature,1); 156 | for m=1:problen 157 | [~,location_temp]=sort(score_matrix(m,:),2,'descend'); 158 | location=gallery_label(location_temp); 159 | if find(location(1)==prob_label(m)) 160 | rank1_hit=rank1_hit+1; 161 | end 162 | if find(location(1:5)==prob_label(m)) 163 | rank5_hit=rank5_hit+1; 164 | end 165 | if find(location(1:10)==prob_label(m)) 166 | rank10_hit=rank10_hit+1; 167 | end 168 | if find(location(1:20)==prob_label(m)) 169 | rank20_hit=rank20_hit+1; 170 | end 171 | end 172 | rank_acc=[rank1_hit/problen,rank5_hit/problen,rank10_hit/problen,rank20_hit/problen]; 173 | fin=fopen(param.result_save_file,'a'); 174 | fprintf(fin,'split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 175 | fprintf('split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 176 | fclose(fin); -------------------------------------------------------------------------------- /train_PQAN/get_train_minibatch_for_LPW.m: -------------------------------------------------------------------------------- 1 | function [batch_data,batch_label]=get_train_minibatch_for_LPW(batch_data,batch_label,batch_size, ... 2 | label_train_view1,label_train_view2,label_train_view3,label_train_view4, ... 3 | train_image_name_view1,train_image_name_view2,train_image_name_view3,train_image_name_view4); 4 | select_view1_anr=randperm(4,1); 5 | select_view1_pos=randperm(4,1); 6 | select_view1_neg=randperm(4,1); 7 | if select_view1_anr==1 8 | if select_view1_pos==1 9 | anr_sel=label_train_view1; 10 | end 11 | if select_view1_pos==2 12 | anr_sel=intersect(label_train_view1,label_train_view2); 13 | end 14 | if select_view1_pos==3 15 | anr_sel=intersect(label_train_view1,label_train_view3); 16 | end 17 | if select_view1_pos==4 18 | anr_sel=intersect(label_train_view1,label_train_view4); 19 | end 20 | end 21 | if select_view1_anr==2 22 | if select_view1_pos==1 23 | anr_sel=intersect(label_train_view2,label_train_view1); 24 | end 25 | if select_view1_pos==2 26 | anr_sel=label_train_view2; 27 | end 28 | if select_view1_pos==3 29 | anr_sel=intersect(label_train_view2,label_train_view3); 30 | end 31 | if select_view1_pos==4 32 | anr_sel=intersect(label_train_view2,label_train_view4); 33 | end 34 | end 35 | if select_view1_anr==3 36 | if select_view1_pos==1 37 | anr_sel=intersect(label_train_view3,label_train_view1);; 38 | end 39 | if select_view1_pos==2 40 | anr_sel=intersect(label_train_view3,label_train_view2); 41 | end 42 | if select_view1_pos==3 43 | anr_sel=label_train_view3; 44 | end 45 | if select_view1_pos==4 46 | anr_sel=intersect(label_train_view3,label_train_view4); 47 | end 48 | end 49 | if select_view1_anr==4 50 | if select_view1_pos==1 51 | anr_sel=intersect(label_train_view4,label_train_view1); 52 | end 53 | if select_view1_pos==2 54 | anr_sel=intersect(label_train_view4,label_train_view2); 55 | end 56 | if select_view1_pos==3 57 | anr_sel=intersect(label_train_view4,label_train_view3); 58 | end 59 | if select_view1_pos==4 60 | anr_sel=label_train_view4; 61 | end 62 | end 63 | if select_view1_neg==1 64 | neg_sel=label_train_view1; 65 | end 66 | if select_view1_neg==2 67 | neg_sel=label_train_view2; 68 | end 69 | if select_view1_neg==3 70 | neg_sel=label_train_view3; 71 | end 72 | if select_view1_neg==4 73 | neg_sel=label_train_view4; 74 | end 75 | anr_sel=unique(anr_sel); 76 | neg_sel=unique(neg_sel); 77 | anr_sel_index=randperm(size(anr_sel,1),1); 78 | person_sel_anrlabel=anr_sel(anr_sel_index); 79 | neg_sel=setdiff(neg_sel,person_sel_anrlabel); 80 | neg_sel_index=randperm(size(neg_sel,1),1); 81 | person_sel_neglabel=neg_sel(neg_sel_index); 82 | if select_view1_anr==1 83 | person_1_1=find(label_train_view1==person_sel_anrlabel); 84 | end 85 | if select_view1_anr==2 86 | person_1_1=find(label_train_view2==person_sel_anrlabel); 87 | end 88 | if select_view1_anr==3 89 | person_1_1=find(label_train_view3==person_sel_anrlabel); 90 | end 91 | if select_view1_anr==4 92 | person_1_1=find(label_train_view4==person_sel_anrlabel); 93 | end 94 | if select_view1_pos==1 95 | person_1_2=find(label_train_view1==person_sel_anrlabel); 96 | end 97 | if select_view1_pos==2 98 | person_1_2=find(label_train_view2==person_sel_anrlabel); 99 | end 100 | if select_view1_pos==3 101 | person_1_2=find(label_train_view3==person_sel_anrlabel); 102 | end 103 | if select_view1_pos==4 104 | person_1_2=find(label_train_view4==person_sel_anrlabel); 105 | end 106 | if select_view1_neg==1 107 | person_2=find(label_train_view1==person_sel_neglabel); 108 | end 109 | if select_view1_neg==2 110 | person_2=find(label_train_view2==person_sel_neglabel); 111 | end 112 | if select_view1_neg==3 113 | person_2=find(label_train_view3==person_sel_neglabel); 114 | end 115 | if select_view1_neg==4 116 | person_2=find(label_train_view4==person_sel_neglabel); 117 | end 118 | size_a=size(person_1_1); 119 | size_p=size(person_1_2); 120 | size_n=size(person_2); 121 | data_sel_anr=randperm(size_a(1),batch_size/3); 122 | data_sel_pos=randperm(size_p(1),batch_size/3); 123 | data_sel_neg=randperm(size_n(1),batch_size/3); 124 | for t=1:batch_size/3 125 | if select_view1_anr==1 126 | data_t=train_image_name_view1{person_1_1(data_sel_anr(t))}; 127 | batch_label(:,:,:,t)=label_train_view1(person_1_1(data_sel_anr(t)))-1; 128 | end 129 | if select_view1_anr==2 130 | data_t=train_image_name_view2{person_1_1(data_sel_anr(t))}; 131 | batch_label(:,:,:,t)=label_train_view2(person_1_1(data_sel_anr(t)))-1; 132 | end 133 | if select_view1_anr==3 134 | data_t=train_image_name_view3{person_1_1(data_sel_anr(t))}; 135 | batch_label(:,:,:,t)=label_train_view3(person_1_1(data_sel_anr(t)))-1; 136 | end 137 | if select_view1_anr==4 138 | data_t=train_image_name_view4{person_1_1(data_sel_anr(t))}; 139 | batch_label(:,:,:,t)=label_train_view4(person_1_1(data_sel_anr(t)))-1; 140 | end 141 | data_t=imread(data_t); 142 | im_data=imresize((single(data_t)),[224 224]); 143 | im_data=im_data(:,:,[3,2,1]); 144 | im_data=permute(im_data,[2,1,3]); 145 | batch_data(:,:,:,t)=im_data; 146 | batch_data(:,:,1,t)=batch_data(:,:,1,t)-104; 147 | batch_data(:,:,2,t)=batch_data(:,:,2,t)-117; 148 | batch_data(:,:,3,t)=batch_data(:,:,3,t)-123; 149 | 150 | if select_view1_pos==1 151 | data_t=train_image_name_view1{person_1_2(data_sel_pos(t))}; 152 | batch_label(:,:,:,t+batch_size/3)=label_train_view1(person_1_2(data_sel_pos(t)))-1; 153 | end 154 | if select_view1_pos==2 155 | data_t=train_image_name_view2{person_1_2(data_sel_pos(t))}; 156 | batch_label(:,:,:,t+batch_size/3)=label_train_view2(person_1_2(data_sel_pos(t)))-1; 157 | end 158 | if select_view1_pos==3 159 | data_t=train_image_name_view3{person_1_2(data_sel_pos(t))}; 160 | batch_label(:,:,:,t+batch_size/3)=label_train_view3(person_1_2(data_sel_pos(t)))-1; 161 | end 162 | if select_view1_pos==4 163 | data_t=train_image_name_view4{person_1_2(data_sel_pos(t))}; 164 | batch_label(:,:,:,t+batch_size/3)=label_train_view4(person_1_2(data_sel_pos(t)))-1; 165 | end 166 | 167 | data_t=imread(data_t); 168 | im_data=imresize((single(data_t)),[224 224]); 169 | im_data=im_data(:,:,[3,2,1]); 170 | im_data=permute(im_data,[2,1,3]); 171 | batch_data(:,:,:,t+batch_size/3)=im_data; 172 | batch_data(:,:,1,t+batch_size/3)=batch_data(:,:,1,t+batch_size/3)-104; 173 | batch_data(:,:,2,t+batch_size/3)=batch_data(:,:,2,t+batch_size/3)-117; 174 | batch_data(:,:,3,t+batch_size/3)=batch_data(:,:,3,t+batch_size/3)-123; 175 | 176 | if select_view1_neg==1 177 | data_t=train_image_name_view1{person_2(data_sel_neg(t))}; 178 | batch_label(:,:,:,t+2*batch_size/3)=label_train_view1(person_2(data_sel_neg(t)))-1; 179 | end 180 | if select_view1_neg==2 181 | data_t=train_image_name_view2{person_2(data_sel_neg(t))}; 182 | batch_label(:,:,:,t+2*batch_size/3)=label_train_view2(person_2(data_sel_neg(t)))-1; 183 | end 184 | if select_view1_neg==3 185 | data_t=train_image_name_view3{person_2(data_sel_neg(t))}; 186 | batch_label(:,:,:,t+2*batch_size/3)=label_train_view3(person_2(data_sel_neg(t)))-1; 187 | end 188 | if select_view1_neg==4 189 | data_t=train_image_name_view4{person_2(data_sel_neg(t))}; 190 | batch_label(:,:,:,t+2*batch_size/3)=label_train_view4(person_2(data_sel_neg(t)))-1; 191 | end 192 | data_t=imread(data_t); 193 | im_data=imresize((single(data_t)),[224 224]); 194 | im_data=im_data(:,:,[3,2,1]); 195 | im_data=permute(im_data,[2,1,3]); 196 | batch_data(:,:,:,t+2*batch_size/3)=im_data; 197 | batch_data(:,:,1,t+2*batch_size/3)=batch_data(:,:,1,t+2*batch_size/3)-104; 198 | batch_data(:,:,2,t+2*batch_size/3)=batch_data(:,:,2,t+2*batch_size/3)-117; 199 | batch_data(:,:,3,t+2*batch_size/3)=batch_data(:,:,3,t+2*batch_size/3)-123; 200 | end 201 | end -------------------------------------------------------------------------------- /train_PQAN/test_script_for_LPW.m: -------------------------------------------------------------------------------- 1 | %%test network 2 | cam1_size=size(label_test_cam1); 3 | cam2_size=size(label_test_cam2); 4 | cam3_size=size(label_test_cam3); 5 | cam1_feature1=[]; 6 | cam1_feature2=[]; 7 | cam1_feature3=[]; 8 | cam1_score=[]; 9 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 10 | for m=0:floor(cam1_size(1)/param.test_batch_size)-1 11 | fprintf('process cam1:%d/%d\n',m,floor(cam1_size(1)/param.test_batch_size)-1); 12 | for n=1:param.test_batch_size 13 | im_data=imread(test_image_name_cam1{m*param.test_batch_size+n}); 14 | im_data=imresize(single(im_data),[224 224]); 15 | im_data=im_data(:,:,[3,2,1]); 16 | im_data=permute(im_data,[2,1,3]); 17 | test_batch_data(:,:,:,n)=im_data; 18 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 19 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 20 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 21 | end 22 | net.blobs('data').set_data(test_batch_data); 23 | net.forward_prefilled; 24 | cam1_feature1=[cam1_feature1;(squeeze(net.blobs('data1_p_1').get_data))']; 25 | cam1_feature2=[cam1_feature2;(squeeze(net.blobs('data1_p_2').get_data))']; 26 | cam1_feature3=[cam1_feature3;(squeeze(net.blobs('data1_p_3').get_data))']; 27 | cam1_score=[cam1_score;(squeeze(net.blobs('sig').get_data))']; 28 | end 29 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 30 | for m=(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size+1:cam1_size(1) 31 | fprintf('process cam1:%d/%d\n',m,cam1_size(1)); 32 | count=m-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 33 | im_data=imread(test_image_name_cam1{m}); 34 | im_data=imresize(single(im_data),[224 224]); 35 | im_data=im_data(:,:,[3,2,1]); 36 | im_data=permute(im_data,[2,1,3]); 37 | test_batch_data(:,:,:,count)=im_data; 38 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 39 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 40 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 41 | end 42 | net.blobs('data').set_data(test_batch_data); 43 | net.forward_prefilled; 44 | index=cam1_size(1)-(floor(cam1_size(1)/param.test_batch_size))*param.test_batch_size; 45 | result1=(squeeze(net.blobs('data1_p_1').get_data))'; 46 | result2=(squeeze(net.blobs('data1_p_2').get_data))'; 47 | result3=(squeeze(net.blobs('data1_p_3').get_data))'; 48 | score=(squeeze(net.blobs('sig').get_data))'; 49 | cam1_feature1=[cam1_feature1;result1(1:index,:)]; 50 | cam1_feature2=[cam1_feature2;result2(1:index,:)]; 51 | cam1_feature3=[cam1_feature3;result3(1:index,:)]; 52 | cam1_score=[cam1_score;score(1:index,:)]; 53 | gallery_feature=[]; 54 | gallery_label=[]; 55 | for m=1:param.test_person_num 56 | test_label_index=find(label_test_cam1==(m)); 57 | if isempty(test_label_index) 58 | continue; 59 | end 60 | a=bsxfun(@times,cam1_feature1(test_label_index,:),cam1_score(test_label_index,1)); 61 | b=bsxfun(@times,cam1_feature2(test_label_index,:),cam1_score(test_label_index,2)); 62 | c=bsxfun(@times,cam1_feature3(test_label_index,:),cam1_score(test_label_index,3)); 63 | gallery_feature=[gallery_feature;sum(a/sum(cam1_score(test_label_index,1))),sum(b/sum(cam1_score(test_label_index,2))),sum(c/sum(cam1_score(test_label_index,3)))]; 64 | % gallery_feature=[gallery_feature;sum(a/sum(cam1_score(test_label_index,1)))]; 65 | % gallery_feature=[gallery_feature;sum(b/sum(cam1_score(test_label_index,2)))]; 66 | % gallery_feature=[gallery_feature;sum(c/sum(cam1_score(test_label_index,3)))]; 67 | gallery_label=[gallery_label;m]; 68 | end 69 | %extract feature cam3 70 | cam3_feature1=[]; 71 | cam3_feature2=[]; 72 | cam3_feature3=[]; 73 | cam3_score=[]; 74 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 75 | for m=0:floor(cam3_size(1)/param.test_batch_size)-1 76 | fprintf('process cam3:%d/%d\n',m,floor(cam3_size(1)/param.test_batch_size)-1); 77 | for n=1:param.test_batch_size 78 | im_data=imread(test_image_name_cam3{m*param.test_batch_size+n}); 79 | im_data=imresize(single(im_data),[224 224]); 80 | im_data=im_data(:,:,[3,2,1]); 81 | im_data=permute(im_data,[2,1,3]); 82 | test_batch_data(:,:,:,n)=im_data; 83 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 84 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 85 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 86 | end 87 | net.blobs('data').set_data(test_batch_data); 88 | net.forward_prefilled; 89 | cam3_feature1=[cam3_feature1;(squeeze(net.blobs('data1_p_1').get_data))']; 90 | cam3_feature2=[cam3_feature2;(squeeze(net.blobs('data1_p_2').get_data))']; 91 | cam3_feature3=[cam3_feature3;(squeeze(net.blobs('data1_p_3').get_data))']; 92 | cam3_score=[cam3_score;(squeeze(net.blobs('sig').get_data))']; 93 | end 94 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 95 | for m=(floor(cam3_size(1)/param.test_batch_size))*param.test_batch_size+1:cam3_size(1) 96 | fprintf('process cam3:%d/%d\n',m,cam3_size(1)); 97 | count=m-(floor(cam3_size(1)/param.test_batch_size))*param.test_batch_size; 98 | im_data=imread(test_image_name_cam3{m}); 99 | im_data=imresize(single(im_data),[224 224]); 100 | im_data=im_data(:,:,[3,2,1]); 101 | im_data=permute(im_data,[2,1,3]); 102 | test_batch_data(:,:,:,count)=im_data; 103 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 104 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 105 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 106 | end 107 | net.blobs('data').set_data(test_batch_data); 108 | net.forward_prefilled; 109 | index=cam3_size(1)-(floor(cam3_size(1)/param.test_batch_size))*param.test_batch_size; 110 | result1=(squeeze(net.blobs('data1_p_1').get_data))'; 111 | result2=(squeeze(net.blobs('data1_p_2').get_data))'; 112 | result3=(squeeze(net.blobs('data1_p_3').get_data))'; 113 | score=(squeeze(net.blobs('sig').get_data))'; 114 | cam3_feature1=[cam3_feature1;result1(1:index,:)]; 115 | cam3_feature2=[cam3_feature2;result2(1:index,:)]; 116 | cam3_feature3=[cam3_feature3;result3(1:index,:)]; 117 | cam3_score=[cam3_score;score(1:index,:)]; 118 | for m=1:param.test_person_num 119 | test_label_index=find(label_test_cam3==(m)); 120 | if isempty(test_label_index) 121 | continue; 122 | end 123 | a=bsxfun(@times,cam3_feature1(test_label_index,:),cam3_score(test_label_index,1)); 124 | b=bsxfun(@times,cam3_feature2(test_label_index,:),cam3_score(test_label_index,2)); 125 | c=bsxfun(@times,cam3_feature3(test_label_index,:),cam3_score(test_label_index,3)); 126 | gallery_feature=[gallery_feature;sum(a/sum(cam3_score(test_label_index,1))),sum(b/sum(cam3_score(test_label_index,2))),sum(c/sum(cam3_score(test_label_index,3)))]; 127 | % gallery_feature=[gallery_feature;sum(a/sum(cam3_score(test_label_index,1)))]; 128 | % gallery_feature=[gallery_feature;sum(b/sum(cam3_score(test_label_index,2)))]; 129 | % gallery_feature=[gallery_feature;sum(c/sum(cam3_score(test_label_index,3)))]; 130 | gallery_label=[gallery_label;m]; 131 | end 132 | %extract feature cam2 133 | cam2_feature1=[]; 134 | cam2_feature2=[]; 135 | cam2_feature3=[]; 136 | cam2_score=[]; 137 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 138 | for m=0:floor(cam2_size(1)/param.test_batch_size)-1 139 | fprintf('process cam2:%d/%d\n',m,floor(cam2_size(1)/param.test_batch_size)-1); 140 | for n=1:param.test_batch_size 141 | im_data=imread(test_image_name_cam2{m*param.test_batch_size+n}); 142 | im_data=imresize(single(im_data),[224 224]); 143 | im_data=im_data(:,:,[3,2,1]); 144 | im_data=permute(im_data,[2,1,3]); 145 | test_batch_data(:,:,:,n)=im_data; 146 | test_batch_data(:,:,1,n)=test_batch_data(:,:,1,n)-104; 147 | test_batch_data(:,:,2,n)=test_batch_data(:,:,2,n)-117; 148 | test_batch_data(:,:,3,n)=test_batch_data(:,:,3,n)-123; 149 | end 150 | net.blobs('data').set_data(test_batch_data); 151 | net.forward_prefilled; 152 | cam2_feature1=[cam2_feature1;(squeeze(net.blobs('data1_p_1').get_data))']; 153 | cam2_feature2=[cam2_feature2;(squeeze(net.blobs('data1_p_2').get_data))']; 154 | cam2_feature3=[cam2_feature3;(squeeze(net.blobs('data1_p_3').get_data))']; 155 | cam2_score=[cam2_score;(squeeze(net.blobs('sig').get_data))']; 156 | end 157 | test_batch_data=zeros(224,224,3,param.test_batch_size,'single'); 158 | for m=(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size+1:cam2_size(1) 159 | fprintf('process cam2:%d/%d\n',m,cam2_size(1)); 160 | count=m-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 161 | im_data=imread(test_image_name_cam2{m}); 162 | im_data=imresize(single(im_data),[224 224]); 163 | im_data=im_data(:,:,[3,2,1]); 164 | im_data=permute(im_data,[2,1,3]); 165 | test_batch_data(:,:,:,count)=im_data; 166 | test_batch_data(:,:,1,count)=test_batch_data(:,:,1,count)-104; 167 | test_batch_data(:,:,2,count)=test_batch_data(:,:,2,count)-117; 168 | test_batch_data(:,:,3,count)=test_batch_data(:,:,3,count)-123; 169 | end 170 | net.blobs('data').set_data(test_batch_data); 171 | net.forward_prefilled; 172 | index=cam2_size(1)-(floor(cam2_size(1)/param.test_batch_size))*param.test_batch_size; 173 | result1=(squeeze(net.blobs('data1_p_1').get_data))'; 174 | result2=(squeeze(net.blobs('data1_p_2').get_data))'; 175 | result3=(squeeze(net.blobs('data1_p_3').get_data))'; 176 | score=(squeeze(net.blobs('sig').get_data))'; 177 | cam2_feature1=[cam2_feature1;result1(1:index,:)]; 178 | cam2_feature2=[cam2_feature2;result2(1:index,:)]; 179 | cam2_feature3=[cam2_feature3;result3(1:index,:)]; 180 | cam2_score=[cam2_score;score(1:index,:)]; 181 | prob_feature=[]; 182 | prob_label=[]; 183 | for m=1:param.test_person_num 184 | test_label_index=find(label_test_cam2==(m)); 185 | if isempty(test_label_index) 186 | continue; 187 | end 188 | a=bsxfun(@times,cam2_feature1(test_label_index,:),cam2_score(test_label_index,1)); 189 | b=bsxfun(@times,cam2_feature2(test_label_index,:),cam2_score(test_label_index,2)); 190 | c=bsxfun(@times,cam2_feature3(test_label_index,:),cam2_score(test_label_index,3)); 191 | prob_feature=[prob_feature;sum(a/sum(cam2_score(test_label_index,1))),sum(b/sum(cam2_score(test_label_index,2))),sum(c/sum(cam2_score(test_label_index,3)))]; 192 | 193 | % prob_feature=[prob_feature;sum(a/sum(cam2_score(test_label_index,1)))]; 194 | % prob_feature=[prob_feature;sum(b/sum(cam2_score(test_label_index,2)))]; 195 | % prob_feature=[prob_feature;sum(c/sum(cam2_score(test_label_index,3)))]; 196 | 197 | prob_label=[prob_label;m]; 198 | end 199 | % cal cmc 200 | prob_norm=bsxfun(@rdivide,prob_feature,sum(abs(prob_feature).^2,2).^(1/2)); 201 | gallery_norm=bsxfun(@rdivide,gallery_feature,sum(abs(gallery_feature).^2,2).^(1/2)); 202 | score_matrix=prob_norm*gallery_norm'; 203 | rank1_hit=0; 204 | rank5_hit=0; 205 | rank10_hit=0; 206 | rank20_hit=0; 207 | problen=size(prob_feature,1); 208 | for m=1:problen 209 | [~,location_temp]=sort(score_matrix(m,:),2,'descend'); 210 | location=gallery_label(location_temp); 211 | if find(location(1)==prob_label(m)) 212 | rank1_hit=rank1_hit+1; 213 | end 214 | if find(location(1:5)==prob_label(m)) 215 | rank5_hit=rank5_hit+1; 216 | end 217 | if find(location(1:10)==prob_label(m)) 218 | rank10_hit=rank10_hit+1; 219 | end 220 | if find(location(1:20)==prob_label(m)) 221 | rank20_hit=rank20_hit+1; 222 | end 223 | end 224 | rank_acc=[rank1_hit/problen,rank5_hit/problen,rank10_hit/problen,rank20_hit/problen]; 225 | fin=fopen(param.result_save_file,'a'); 226 | fprintf(fin,'up split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 227 | fprintf('split_index:%d,iter:%d, rank1:%f,rank5:%f,rank10:%f,rank20:%f\n',split_index,iter,rank_acc(1),rank_acc(2),rank_acc(3),rank_acc(4)); 228 | fclose(fin); -------------------------------------------------------------------------------- /generate_data/generate_LPW_dataset.m: -------------------------------------------------------------------------------- 1 | %%generate data config 2 | param.split_data_num=1; 3 | param.file_path_cam1=fullfile(fileparts(pwd),'people_tuples','scen1');%for test 4 | param.file_path_cam2=fullfile(fileparts(pwd),'people_tuples','scen2');%for train 5 | param.file_path_cam3=fullfile(fileparts(pwd),'people_tuples','scen3');%for train 6 | param.save_traindata_filename='train_data_LPW'; 7 | param.save_testdata_filename='test_data_LPW'; 8 | %%generate ten split train/test data 9 | for split_num_start=1:param.split_data_num 10 | if ~exist(strcat(param.save_traindata_filename,num2str(split_num_start)),'file') 11 | mkdir(strcat(param.save_traindata_filename,num2str(split_num_start))); 12 | end 13 | if ~exist(strcat(param.save_testdata_filename,num2str(split_num_start)),'file') 14 | mkdir(strcat(param.save_testdata_filename,num2str(split_num_start))); 15 | end 16 | subdir_cam3_view1=dir(strcat(param.file_path_cam3,'view1')); 17 | subdir_cam3_view2=dir(strcat(param.file_path_cam3,'view2')); 18 | subdir_cam3_view3=dir(strcat(param.file_path_cam3,'view3')); 19 | subdir_cam3_view4=dir(strcat(param.file_path_cam3,'view4')); 20 | subdir_cam2_view1=dir(strcat(param.file_path_cam2,'view1')); 21 | subdir_cam2_view2=dir(strcat(param.file_path_cam2,'view2')); 22 | subdir_cam2_view3=dir(strcat(param.file_path_cam2,'view3')); 23 | subdir_cam2_view4=dir(strcat(param.file_path_cam2,'view4')); 24 | 25 | subdir_cam1_view1=dir(strcat(param.file_path_cam1,'view1')); 26 | subdir_cam1_view2=dir(strcat(param.file_path_cam1,'view2')); 27 | subdir_cam1_view3=dir(strcat(param.file_path_cam1,'view3')); 28 | 29 | label_train_cam2_view1=[]; 30 | train_image_name_cam2_view1={}; 31 | label_train_cam2_view2=[]; 32 | train_image_name_cam2_view2={}; 33 | label_train_cam2_view3=[]; 34 | train_image_name_cam2_view3={}; 35 | label_train_cam2_view4=[]; 36 | train_image_name_cam2_view4={}; 37 | label_train_cam3_view1=[]; 38 | train_image_name_cam3_view1={}; 39 | label_train_cam3_view2=[]; 40 | train_image_name_cam3_view2={}; 41 | label_train_cam3_view3=[]; 42 | train_image_name_cam3_view3={}; 43 | label_train_cam3_view4=[]; 44 | train_image_name_cam3_view4={}; 45 | nameMapLabel_cam2=[]; 46 | nameMapLabel_cam3=[]; 47 | for i=3:(length(subdir_cam2_view3)) 48 | fprintf('process test data cam2 view3:%d/%d\n',i,(length(subdir_cam2_view3))); 49 | image_path_cam2=strcat(param.file_path_cam2,'view3/',subdir_cam2_view3(i).name,'/'); 50 | image_list_cam2=dir(image_path_cam2); 51 | nameMapLabel_cam2=[nameMapLabel_cam2;str2num(subdir_cam2_view3(i).name)]; 52 | for j=3:length(image_list_cam2); 53 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 54 | label_train_cam2_view3=[label_train_cam2_view3;str2num(subdir_cam2_view3(i).name)]; 55 | train_image_name_cam2_view3=[train_image_name_cam2_view3,image_name]; 56 | end 57 | end 58 | for i=3:(length(subdir_cam2_view1)) 59 | fprintf('process test data cam2 view1:%d/%d\n',i,(length(subdir_cam2_view1))); 60 | image_path_cam2=strcat(param.file_path_cam2,'view1/',subdir_cam2_view1(i).name,'/'); 61 | image_list_cam2=dir(image_path_cam2); 62 | for j=3:length(image_list_cam2); 63 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 64 | label_train_cam2_view1=[label_train_cam2_view1;str2num(subdir_cam2_view1(i).name)]; 65 | train_image_name_cam2_view1=[train_image_name_cam2_view1,image_name]; 66 | end 67 | end 68 | for i=3:(length(subdir_cam2_view2)) 69 | fprintf('process test data cam2 view2:%d/%d\n',i,(length(subdir_cam2_view2))); 70 | image_path_cam2=strcat(param.file_path_cam2,'view2/',subdir_cam2_view2(i).name,'/'); 71 | image_list_cam2=dir(image_path_cam2); 72 | for j=3:length(image_list_cam2); 73 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 74 | label_train_cam2_view2=[label_train_cam2_view2;str2num(subdir_cam2_view2(i).name)]; 75 | train_image_name_cam2_view2=[train_image_name_cam2_view2,image_name]; 76 | end 77 | end 78 | for i=3:(length(subdir_cam2_view4)) 79 | fprintf('process test data cam2 view2:%d/%d\n',i,(length(subdir_cam2_view4))); 80 | image_path_cam2=strcat(param.file_path_cam2,'view4/',subdir_cam2_view4(i).name,'/'); 81 | image_list_cam2=dir(image_path_cam2); 82 | for j=3:length(image_list_cam2); 83 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 84 | label_train_cam2_view4=[label_train_cam2_view4;str2num(subdir_cam2_view4(i).name)]; 85 | train_image_name_cam2_view4=[train_image_name_cam2_view4,image_name]; 86 | end 87 | end 88 | %generate data for cam3 89 | for i=3:(length(subdir_cam3_view3)) 90 | fprintf('process test data cam3 view3:%d/%d\n',i,(length(subdir_cam3_view3))); 91 | image_path_cam3=strcat(param.file_path_cam3,'view3/',subdir_cam3_view3(i).name,'/'); 92 | image_list_cam3=dir(image_path_cam3); 93 | nameMapLabel_cam3=[nameMapLabel_cam3;str2num(subdir_cam3_view3(i).name)]; 94 | for j=3:length(image_list_cam3); 95 | image_name=strcat(image_path_cam3,image_list_cam3(j).name); 96 | label_train_cam3_view3=[label_train_cam3_view3;str2num(subdir_cam3_view3(i).name)]; 97 | train_image_name_cam3_view3=[train_image_name_cam3_view3,image_name]; 98 | end 99 | end 100 | for i=3:(length(subdir_cam3_view1)) 101 | fprintf('process test data cam3 view1:%d/%d\n',i,(length(subdir_cam3_view1))); 102 | image_path_cam3=strcat(param.file_path_cam3,'view1/',subdir_cam3_view1(i).name,'/'); 103 | image_list_cam3=dir(image_path_cam3); 104 | for j=3:length(image_list_cam3); 105 | image_name=strcat(image_path_cam3,image_list_cam3(j).name); 106 | label_train_cam3_view1=[label_train_cam3_view1;str2num(subdir_cam3_view1(i).name)]; 107 | train_image_name_cam3_view1=[train_image_name_cam3_view1,image_name]; 108 | end 109 | end 110 | for i=3:(length(subdir_cam3_view2)) 111 | fprintf('process test data cam3 view2:%d/%d\n',i,(length(subdir_cam3_view2))); 112 | image_path_cam3=strcat(param.file_path_cam3,'view2/',subdir_cam3_view2(i).name,'/'); 113 | image_list_cam3=dir(image_path_cam3); 114 | for j=3:length(image_list_cam3); 115 | image_name=strcat(image_path_cam3,image_list_cam3(j).name); 116 | label_train_cam3_view2=[label_train_cam3_view2;str2num(subdir_cam3_view2(i).name)]; 117 | train_image_name_cam3_view2=[train_image_name_cam3_view2,image_name]; 118 | end 119 | end 120 | for i=3:(length(subdir_cam3_view4)) 121 | fprintf('process test data cam3 view4:%d/%d\n',i,(length(subdir_cam3_view4))); 122 | image_path_cam3=strcat(param.file_path_cam3,'view4/',subdir_cam3_view4(i).name,'/'); 123 | image_list_cam3=dir(image_path_cam3); 124 | for j=3:length(image_list_cam3); 125 | image_name=strcat(image_path_cam3,image_list_cam3(j).name); 126 | label_train_cam3_view4=[label_train_cam3_view4;str2num(subdir_cam3_view4(i).name)]; 127 | train_image_name_cam3_view4=[train_image_name_cam3_view4,image_name]; 128 | end 129 | end 130 | for i=1:length(label_train_cam2_view1) 131 | temp=find(nameMapLabel_cam2==label_train_cam2_view1(i)); 132 | label_train_cam2_view1(i)=temp; 133 | end 134 | for i=1:length(label_train_cam2_view2) 135 | temp=find(nameMapLabel_cam2==label_train_cam2_view2(i)); 136 | label_train_cam2_view2(i)=temp; 137 | end 138 | for i=1:length(label_train_cam2_view3) 139 | temp=find(nameMapLabel_cam2==label_train_cam2_view3(i)); 140 | label_train_cam2_view3(i)=temp; 141 | end 142 | for i=1:length(label_train_cam2_view4) 143 | temp=find(nameMapLabel_cam2==label_train_cam2_view4(i)); 144 | label_train_cam2_view4(i)=temp; 145 | end 146 | cam_label_max=size(nameMapLabel_cam2,1); 147 | for i=1:length(label_train_cam3_view1) 148 | temp=find(nameMapLabel_cam3==label_train_cam3_view1(i)); 149 | label_train_cam3_view1(i)=temp+cam_label_max; 150 | end 151 | for i=1:length(label_train_cam3_view2) 152 | temp=find(nameMapLabel_cam3==label_train_cam3_view2(i)); 153 | label_train_cam3_view2(i)=temp+cam_label_max; 154 | end 155 | for i=1:length(label_train_cam3_view3) 156 | temp=find(nameMapLabel_cam3==label_train_cam3_view3(i)); 157 | label_train_cam3_view3(i)=temp+cam_label_max; 158 | end 159 | for i=1:length(label_train_cam3_view4) 160 | temp=find(nameMapLabel_cam3==label_train_cam3_view4(i)); 161 | label_train_cam3_view4(i)=temp+cam_label_max; 162 | end 163 | save(strcat(param.save_traindata_filename,num2str(split_num_start),'/train_data.mat'),'label_train_cam2_view1','label_train_cam2_view2','label_train_cam2_view3','label_train_cam2_view4', ... 164 | 'label_train_cam3_view1','label_train_cam3_view2','label_train_cam3_view3','label_train_cam3_view4', ... 165 | 'train_image_name_cam2_view1','train_image_name_cam2_view2','train_image_name_cam2_view3','train_image_name_cam2_view4', ... 166 | 'train_image_name_cam3_view1','train_image_name_cam3_view2','train_image_name_cam3_view3','train_image_name_cam3_view4','-v7.3'); 167 | %generate test data 168 | test_data_cam1=[]; 169 | label_test_cam1=[]; 170 | test_image_name_cam1={}; 171 | test_data_cam2=[]; 172 | label_test_cam2=[]; 173 | test_image_name_cam2={}; 174 | test_data_cam3=[]; 175 | label_test_cam3=[]; 176 | test_image_name_cam3={}; 177 | nameMapLabel=[]; 178 | for i=3:(length(subdir_cam1_view2)) 179 | fprintf('process test data view2:%d/%d\n',i,(length(subdir_cam1_view2))); 180 | image_path_cam2=strcat(param.file_path_cam1,'view2/',subdir_cam1_view2(i).name,'/'); 181 | image_list_cam2=dir(image_path_cam2); 182 | nameMapLabel=[nameMapLabel;str2num(subdir_cam1_view2(i).name)]; 183 | for j=3:length(image_list_cam2); 184 | image_name=strcat(image_path_cam2,image_list_cam2(j).name); 185 | label_test_cam2=[label_test_cam2;str2num(subdir_cam1_view2(i).name)]; 186 | test_image_name_cam2=[test_image_name_cam2,image_name]; 187 | end 188 | end 189 | for i=3:(length(subdir_cam1_view1)) 190 | fprintf('process test data view1:%d/%d\n',i,(length(subdir_cam1_view1))); 191 | image_path_cam1=strcat(param.file_path_cam1,'view1/',subdir_cam1_view1(i).name,'/'); 192 | image_list_cam1=dir(image_path_cam1); 193 | for j=3:length(image_list_cam1); 194 | image_name=strcat(image_path_cam1,image_list_cam1(j).name); 195 | label_test_cam1=[label_test_cam1;str2num(subdir_cam1_view1(i).name)]; 196 | test_image_name_cam1=[test_image_name_cam1,image_name]; 197 | end 198 | end 199 | for i=3:(length(subdir_cam1_view3)) 200 | fprintf('process test data view3:%d/%d\n',i,(length(subdir_cam1_view3))); 201 | image_path_cam3=strcat(param.file_path_cam1,'view3/',subdir_cam1_view3(i).name,'/'); 202 | image_list_cam3=dir(image_path_cam3); 203 | for j=3:length(image_list_cam3); 204 | image_name=strcat(image_path_cam3,image_list_cam3(j).name); 205 | label_test_cam3=[label_test_cam3;str2num(subdir_cam1_view3(i).name)]; 206 | test_image_name_cam3=[test_image_name_cam3,image_name]; 207 | end 208 | end 209 | for i=1:length(label_test_cam1) 210 | temp=find(nameMapLabel==label_test_cam1(i)); 211 | label_test_cam1(i)=temp; 212 | end 213 | for i=1:length(label_test_cam2) 214 | temp=find(nameMapLabel==label_test_cam2(i)); 215 | label_test_cam2(i)=temp; 216 | end 217 | for i=1:length(label_test_cam3) 218 | temp=find(nameMapLabel==label_test_cam3(i)); 219 | label_test_cam3(i)=temp; 220 | end 221 | save(strcat(param.save_testdata_filename,num2str(split_num_start),'/test_data.mat'),'label_test_cam1','label_test_cam2','label_test_cam3','test_image_name_cam1','test_image_name_cam2','test_image_name_cam3','-v7.3'); 222 | end -------------------------------------------------------------------------------- /model/test_bn.prototxt: -------------------------------------------------------------------------------- 1 | 2 | ### Training Set 3 | name: "GoogleNet" 4 | input: "data" 5 | input_dim: 1 6 | input_dim: 3 7 | input_dim: 224 8 | input_dim: 224 9 | 10 | 11 | ### Validation Set 12 | 13 | layer { 14 | bottom: "data" 15 | top: "conv1/7x7_s2" 16 | name: "conv1/7x7_s2" 17 | type: "Convolution" 18 | param { 19 | lr_mult: 1 20 | decay_mult: 1 21 | } 22 | convolution_param { 23 | num_output: 64 24 | pad: 3 25 | kernel_size: 7 26 | stride: 2 27 | weight_filler { 28 | type: "xavier" 29 | } 30 | bias_term: false 31 | } 32 | } 33 | layer { 34 | bottom: "conv1/7x7_s2" 35 | name: "conv1/7x7_s2/bn" 36 | top: "conv1/7x7_s2/bn" 37 | type: "BatchNorm" 38 | } 39 | layer { 40 | bottom: "conv1/7x7_s2/bn" 41 | top: "conv1/7x7_s2/bn/sc" 42 | name: "conv1/7x7_s2/bn/sc" 43 | type: "Scale" 44 | scale_param { 45 | bias_term: true 46 | } 47 | } 48 | layer { 49 | bottom: "conv1/7x7_s2/bn/sc" 50 | top: "conv1/7x7_s2/bn/sc" 51 | name: "conv1/7x7_s2/bn/sc/relu" 52 | type: "ReLU" 53 | } 54 | layer { 55 | bottom: "conv1/7x7_s2/bn/sc" 56 | top: "pool1/3x3_s2" 57 | name: "pool1/3x3_s2" 58 | type: "Pooling" 59 | pooling_param { 60 | pool: MAX 61 | kernel_size: 3 62 | stride: 2 63 | } 64 | } 65 | layer { 66 | bottom: "pool1/3x3_s2" 67 | top: "conv2/3x3_reduce" 68 | name: "conv2/3x3_reduce" 69 | type: "Convolution" 70 | param { 71 | lr_mult: 1 72 | decay_mult: 1 73 | } 74 | convolution_param { 75 | num_output: 64 76 | pad: 0 77 | kernel_size: 1 78 | stride: 1 79 | weight_filler { 80 | type: "xavier" 81 | } 82 | bias_term: false 83 | } 84 | } 85 | layer { 86 | bottom: "conv2/3x3_reduce" 87 | name: "conv2/3x3_reduce/bn" 88 | top: "conv2/3x3_reduce/bn" 89 | type: "BatchNorm" 90 | } 91 | layer { 92 | bottom: "conv2/3x3_reduce/bn" 93 | top: "conv2/3x3_reduce/bn/sc" 94 | name: "conv2/3x3_reduce/bn/sc" 95 | type: "Scale" 96 | scale_param { 97 | bias_term: true 98 | } 99 | } 100 | layer { 101 | bottom: "conv2/3x3_reduce/bn/sc" 102 | top: "conv2/3x3_reduce/bn/sc" 103 | name: "conv2/3x3_reduce/bn/sc/relu" 104 | type: "ReLU" 105 | } 106 | layer { 107 | bottom: "conv2/3x3_reduce/bn/sc" 108 | top: "conv2/3x3" 109 | name: "conv2/3x3" 110 | type: "Convolution" 111 | param { 112 | lr_mult: 1 113 | decay_mult: 1 114 | } 115 | convolution_param { 116 | num_output: 192 117 | pad: 1 118 | kernel_size: 3 119 | stride: 1 120 | weight_filler { 121 | type: "xavier" 122 | } 123 | bias_term: false 124 | } 125 | } 126 | layer { 127 | bottom: "conv2/3x3" 128 | name: "conv2/3x3/bn" 129 | top: "conv2/3x3/bn" 130 | type: "BatchNorm" 131 | } 132 | layer { 133 | bottom: "conv2/3x3/bn" 134 | top: "conv2/3x3/bn/sc" 135 | name: "conv2/3x3/bn/sc" 136 | type: "Scale" 137 | scale_param { 138 | bias_term: true 139 | } 140 | } 141 | layer { 142 | bottom: "conv2/3x3/bn/sc" 143 | top: "conv2/3x3/bn/sc" 144 | name: "conv2/3x3/bn/sc/relu" 145 | type: "ReLU" 146 | } 147 | layer { 148 | bottom: "conv2/3x3/bn/sc" 149 | top: "pool2/3x3_s2" 150 | name: "pool2/3x3_s2" 151 | type: "Pooling" 152 | pooling_param { 153 | pool: MAX 154 | kernel_size: 3 155 | stride: 2 156 | } 157 | } 158 | layer { 159 | bottom: "pool2/3x3_s2" 160 | top: "inception_3a/1x1" 161 | name: "inception_3a/1x1" 162 | type: "Convolution" 163 | param { 164 | lr_mult: 1 165 | decay_mult: 1 166 | } 167 | convolution_param { 168 | num_output: 64 169 | pad: 0 170 | kernel_size: 1 171 | stride: 1 172 | weight_filler { 173 | type: "xavier" 174 | } 175 | bias_term: false 176 | } 177 | } 178 | layer { 179 | bottom: "inception_3a/1x1" 180 | name: "inception_3a/1x1/bn" 181 | top: "inception_3a/1x1/bn" 182 | type: "BatchNorm" 183 | } 184 | layer { 185 | bottom: "inception_3a/1x1/bn" 186 | top: "inception_3a/1x1/bn/sc" 187 | name: "inception_3a/1x1/bn/sc" 188 | type: "Scale" 189 | scale_param { 190 | bias_term: true 191 | } 192 | } 193 | layer { 194 | bottom: "inception_3a/1x1/bn/sc" 195 | top: "inception_3a/1x1/bn/sc" 196 | name: "inception_3a/1x1/bn/sc/relu" 197 | type: "ReLU" 198 | } 199 | layer { 200 | bottom: "pool2/3x3_s2" 201 | top: "inception_3a/3x3_reduce" 202 | name: "inception_3a/3x3_reduce" 203 | type: "Convolution" 204 | param { 205 | lr_mult: 1 206 | decay_mult: 1 207 | } 208 | convolution_param { 209 | num_output: 64 210 | pad: 0 211 | kernel_size: 1 212 | stride: 1 213 | weight_filler { 214 | type: "xavier" 215 | } 216 | bias_term: false 217 | } 218 | } 219 | layer { 220 | bottom: "inception_3a/3x3_reduce" 221 | name: "inception_3a/3x3_reduce/bn" 222 | top: "inception_3a/3x3_reduce/bn" 223 | type: "BatchNorm" 224 | } 225 | layer { 226 | bottom: "inception_3a/3x3_reduce/bn" 227 | top: "inception_3a/3x3_reduce/bn/sc" 228 | name: "inception_3a/3x3_reduce/bn/sc" 229 | type: "Scale" 230 | scale_param { 231 | bias_term: true 232 | } 233 | } 234 | layer { 235 | bottom: "inception_3a/3x3_reduce/bn/sc" 236 | top: "inception_3a/3x3_reduce/bn/sc" 237 | name: "inception_3a/3x3_reduce/bn/sc/relu" 238 | type: "ReLU" 239 | } 240 | layer { 241 | bottom: "inception_3a/3x3_reduce/bn/sc" 242 | top: "inception_3a/3x3" 243 | name: "inception_3a/3x3" 244 | type: "Convolution" 245 | param { 246 | lr_mult: 1 247 | decay_mult: 1 248 | } 249 | convolution_param { 250 | num_output: 64 251 | pad: 1 252 | kernel_size: 3 253 | stride: 1 254 | weight_filler { 255 | type: "xavier" 256 | } 257 | bias_term: false 258 | } 259 | } 260 | layer { 261 | bottom: "inception_3a/3x3" 262 | name: "inception_3a/3x3/bn" 263 | top: "inception_3a/3x3/bn" 264 | type: "BatchNorm" 265 | } 266 | layer { 267 | bottom: "inception_3a/3x3/bn" 268 | top: "inception_3a/3x3/bn/sc" 269 | name: "inception_3a/3x3/bn/sc" 270 | type: "Scale" 271 | scale_param { 272 | bias_term: true 273 | } 274 | } 275 | layer { 276 | bottom: "inception_3a/3x3/bn/sc" 277 | top: "inception_3a/3x3/bn/sc" 278 | name: "inception_3a/3x3/bn/sc/relu" 279 | type: "ReLU" 280 | } 281 | layer { 282 | bottom: "pool2/3x3_s2" 283 | top: "inception_3a/double3x3_reduce" 284 | name: "inception_3a/double3x3_reduce" 285 | type: "Convolution" 286 | param { 287 | lr_mult: 1 288 | decay_mult: 1 289 | } 290 | convolution_param { 291 | num_output: 64 292 | pad: 0 293 | kernel_size: 1 294 | stride: 1 295 | weight_filler { 296 | type: "xavier" 297 | } 298 | bias_term: false 299 | } 300 | } 301 | layer { 302 | bottom: "inception_3a/double3x3_reduce" 303 | name: "inception_3a/double3x3_reduce/bn" 304 | top: "inception_3a/double3x3_reduce/bn" 305 | type: "BatchNorm" 306 | } 307 | layer { 308 | bottom: "inception_3a/double3x3_reduce/bn" 309 | top: "inception_3a/double3x3_reduce/bn/sc" 310 | name: "inception_3a/double3x3_reduce/bn/sc" 311 | type: "Scale" 312 | scale_param { 313 | bias_term: true 314 | } 315 | } 316 | layer { 317 | bottom: "inception_3a/double3x3_reduce/bn/sc" 318 | top: "inception_3a/double3x3_reduce/bn/sc" 319 | name: "inception_3a/double3x3_reduce/bn/sc/relu" 320 | type: "ReLU" 321 | } 322 | layer { 323 | bottom: "inception_3a/double3x3_reduce/bn/sc" 324 | top: "inception_3a/double3x3a" 325 | name: "inception_3a/double3x3a" 326 | type: "Convolution" 327 | param { 328 | lr_mult: 1 329 | decay_mult: 1 330 | } 331 | convolution_param { 332 | num_output: 96 333 | pad: 1 334 | kernel_size: 3 335 | stride: 1 336 | weight_filler { 337 | type: "xavier" 338 | } 339 | bias_term: false 340 | } 341 | } 342 | layer { 343 | bottom: "inception_3a/double3x3a" 344 | name: "inception_3a/double3x3a/bn" 345 | top: "inception_3a/double3x3a/bn" 346 | type: "BatchNorm" 347 | } 348 | layer { 349 | bottom: "inception_3a/double3x3a/bn" 350 | top: "inception_3a/double3x3a/bn/sc" 351 | name: "inception_3a/double3x3a/bn/sc" 352 | type: "Scale" 353 | scale_param { 354 | bias_term: true 355 | } 356 | } 357 | layer { 358 | bottom: "inception_3a/double3x3a/bn/sc" 359 | top: "inception_3a/double3x3a/bn/sc" 360 | name: "inception_3a/double3x3a/bn/sc/relu" 361 | type: "ReLU" 362 | } 363 | layer { 364 | bottom: "inception_3a/double3x3a/bn/sc" 365 | top: "inception_3a/double3x3b" 366 | name: "inception_3a/double3x3b" 367 | type: "Convolution" 368 | param { 369 | lr_mult: 1 370 | decay_mult: 1 371 | } 372 | convolution_param { 373 | num_output: 96 374 | pad: 1 375 | kernel_size: 3 376 | stride: 1 377 | weight_filler { 378 | type: "xavier" 379 | } 380 | bias_term: false 381 | } 382 | } 383 | layer { 384 | bottom: "inception_3a/double3x3b" 385 | name: "inception_3a/double3x3b/bn" 386 | top: "inception_3a/double3x3b/bn" 387 | type: "BatchNorm" 388 | } 389 | layer { 390 | bottom: "inception_3a/double3x3b/bn" 391 | top: "inception_3a/double3x3b/bn/sc" 392 | name: "inception_3a/double3x3b/bn/sc" 393 | type: "Scale" 394 | scale_param { 395 | bias_term: true 396 | } 397 | } 398 | layer { 399 | bottom: "inception_3a/double3x3b/bn/sc" 400 | top: "inception_3a/double3x3b/bn/sc" 401 | name: "inception_3a/double3x3b/bn/sc/relu" 402 | type: "ReLU" 403 | } 404 | layer { 405 | bottom: "pool2/3x3_s2" 406 | top: "inception_3a/pool" 407 | name: "inception_3a/pool" 408 | type: "Pooling" 409 | pooling_param { 410 | pool: AVE 411 | kernel_size: 3 412 | stride: 1 413 | pad: 1 414 | } 415 | } 416 | layer { 417 | bottom: "inception_3a/pool" 418 | top: "inception_3a/pool_proj" 419 | name: "inception_3a/pool_proj" 420 | type: "Convolution" 421 | param { 422 | lr_mult: 1 423 | decay_mult: 1 424 | } 425 | convolution_param { 426 | num_output: 32 427 | pad: 0 428 | kernel_size: 1 429 | stride: 1 430 | weight_filler { 431 | type: "xavier" 432 | } 433 | bias_term: false 434 | } 435 | } 436 | layer { 437 | bottom: "inception_3a/pool_proj" 438 | name: "inception_3a/pool_proj/bn" 439 | top: "inception_3a/pool_proj/bn" 440 | type: "BatchNorm" 441 | } 442 | layer { 443 | bottom: "inception_3a/pool_proj/bn" 444 | top: "inception_3a/pool_proj/bn/sc" 445 | name: "inception_3a/pool_proj/bn/sc" 446 | type: "Scale" 447 | scale_param { 448 | bias_term: true 449 | } 450 | } 451 | layer { 452 | bottom: "inception_3a/pool_proj/bn/sc" 453 | top: "inception_3a/pool_proj/bn/sc" 454 | name: "inception_3a/pool_proj/bn/sc/relu" 455 | type: "ReLU" 456 | } 457 | layer { 458 | bottom: "inception_3a/1x1/bn/sc" 459 | bottom: "inception_3a/3x3/bn/sc" 460 | bottom: "inception_3a/double3x3b/bn/sc" 461 | bottom: "inception_3a/pool_proj/bn/sc" 462 | top: "inception_3a/output" 463 | name: "inception_3a/output" 464 | type: "Concat" 465 | } 466 | layer { 467 | bottom: "inception_3a/output" 468 | top: "inception_3b/1x1" 469 | name: "inception_3b/1x1" 470 | type: "Convolution" 471 | param { 472 | lr_mult: 1 473 | decay_mult: 1 474 | } 475 | convolution_param { 476 | num_output: 64 477 | pad: 0 478 | kernel_size: 1 479 | stride: 1 480 | weight_filler { 481 | type: "xavier" 482 | } 483 | bias_term: false 484 | } 485 | } 486 | layer { 487 | bottom: "inception_3b/1x1" 488 | name: "inception_3b/1x1/bn" 489 | top: "inception_3b/1x1/bn" 490 | type: "BatchNorm" 491 | } 492 | layer { 493 | bottom: "inception_3b/1x1/bn" 494 | top: "inception_3b/1x1/bn/sc" 495 | name: "inception_3b/1x1/bn/sc" 496 | type: "Scale" 497 | scale_param { 498 | bias_term: true 499 | } 500 | } 501 | layer { 502 | bottom: "inception_3b/1x1/bn/sc" 503 | top: "inception_3b/1x1/bn/sc" 504 | name: "inception_3b/1x1/bn/sc/relu" 505 | type: "ReLU" 506 | } 507 | layer { 508 | bottom: "inception_3a/output" 509 | top: "inception_3b/3x3_reduce" 510 | name: "inception_3b/3x3_reduce" 511 | type: "Convolution" 512 | param { 513 | lr_mult: 1 514 | decay_mult: 1 515 | } 516 | convolution_param { 517 | num_output: 64 518 | pad: 0 519 | kernel_size: 1 520 | stride: 1 521 | weight_filler { 522 | type: "xavier" 523 | } 524 | bias_term: false 525 | } 526 | } 527 | layer { 528 | bottom: "inception_3b/3x3_reduce" 529 | name: "inception_3b/3x3_reduce/bn" 530 | top: "inception_3b/3x3_reduce/bn" 531 | type: "BatchNorm" 532 | } 533 | layer { 534 | bottom: "inception_3b/3x3_reduce/bn" 535 | top: "inception_3b/3x3_reduce/bn/sc" 536 | name: "inception_3b/3x3_reduce/bn/sc" 537 | type: "Scale" 538 | scale_param { 539 | bias_term: true 540 | } 541 | } 542 | layer { 543 | bottom: "inception_3b/3x3_reduce/bn/sc" 544 | top: "inception_3b/3x3_reduce/bn/sc" 545 | name: "inception_3b/3x3_reduce/bn/sc/relu" 546 | type: "ReLU" 547 | } 548 | layer { 549 | bottom: "inception_3b/3x3_reduce/bn/sc" 550 | top: "inception_3b/3x3" 551 | name: "inception_3b/3x3" 552 | type: "Convolution" 553 | param { 554 | lr_mult: 1 555 | decay_mult: 1 556 | } 557 | convolution_param { 558 | num_output: 96 559 | pad: 1 560 | kernel_size: 3 561 | stride: 1 562 | weight_filler { 563 | type: "xavier" 564 | } 565 | bias_term: false 566 | } 567 | } 568 | layer { 569 | bottom: "inception_3b/3x3" 570 | name: "inception_3b/3x3/bn" 571 | top: "inception_3b/3x3/bn" 572 | type: "BatchNorm" 573 | } 574 | layer { 575 | bottom: "inception_3b/3x3/bn" 576 | top: "inception_3b/3x3/bn/sc" 577 | name: "inception_3b/3x3/bn/sc" 578 | type: "Scale" 579 | scale_param { 580 | bias_term: true 581 | } 582 | } 583 | layer { 584 | bottom: "inception_3b/3x3/bn/sc" 585 | top: "inception_3b/3x3/bn/sc" 586 | name: "inception_3b/3x3/bn/sc/relu" 587 | type: "ReLU" 588 | } 589 | layer { 590 | bottom: "inception_3a/output" 591 | top: "inception_3b/double3x3_reduce" 592 | name: "inception_3b/double3x3_reduce" 593 | type: "Convolution" 594 | param { 595 | lr_mult: 1 596 | decay_mult: 1 597 | } 598 | convolution_param { 599 | num_output: 64 600 | pad: 0 601 | kernel_size: 1 602 | stride: 1 603 | weight_filler { 604 | type: "xavier" 605 | } 606 | bias_term: false 607 | } 608 | } 609 | layer { 610 | bottom: "inception_3b/double3x3_reduce" 611 | name: "inception_3b/double3x3_reduce/bn" 612 | top: "inception_3b/double3x3_reduce/bn" 613 | type: "BatchNorm" 614 | } 615 | layer { 616 | bottom: "inception_3b/double3x3_reduce/bn" 617 | top: "inception_3b/double3x3_reduce/bn/sc" 618 | name: "inception_3b/double3x3_reduce/bn/sc" 619 | type: "Scale" 620 | scale_param { 621 | bias_term: true 622 | } 623 | } 624 | layer { 625 | bottom: "inception_3b/double3x3_reduce/bn/sc" 626 | top: "inception_3b/double3x3_reduce/bn/sc" 627 | name: "inception_3b/double3x3_reduce/bn/sc/relu" 628 | type: "ReLU" 629 | } 630 | layer { 631 | bottom: "inception_3b/double3x3_reduce/bn/sc" 632 | top: "inception_3b/double3x3a" 633 | name: "inception_3b/double3x3a" 634 | type: "Convolution" 635 | param { 636 | lr_mult: 1 637 | decay_mult: 1 638 | } 639 | convolution_param { 640 | num_output: 96 641 | pad: 1 642 | kernel_size: 3 643 | stride: 1 644 | weight_filler { 645 | type: "xavier" 646 | } 647 | bias_term: false 648 | } 649 | } 650 | layer { 651 | bottom: "inception_3b/double3x3a" 652 | name: "inception_3b/double3x3a/bn" 653 | top: "inception_3b/double3x3a/bn" 654 | type: "BatchNorm" 655 | } 656 | layer { 657 | bottom: "inception_3b/double3x3a/bn" 658 | top: "inception_3b/double3x3a/bn/sc" 659 | name: "inception_3b/double3x3a/bn/sc" 660 | type: "Scale" 661 | scale_param { 662 | bias_term: true 663 | } 664 | } 665 | layer { 666 | bottom: "inception_3b/double3x3a/bn/sc" 667 | top: "inception_3b/double3x3a/bn/sc" 668 | name: "inception_3b/double3x3a/bn/sc/relu" 669 | type: "ReLU" 670 | } 671 | layer { 672 | bottom: "inception_3b/double3x3a/bn/sc" 673 | top: "inception_3b/double3x3b" 674 | name: "inception_3b/double3x3b" 675 | type: "Convolution" 676 | param { 677 | lr_mult: 1 678 | decay_mult: 1 679 | } 680 | convolution_param { 681 | num_output: 96 682 | pad: 1 683 | kernel_size: 3 684 | stride: 1 685 | weight_filler { 686 | type: "xavier" 687 | } 688 | bias_term: false 689 | } 690 | } 691 | layer { 692 | bottom: "inception_3b/double3x3b" 693 | name: "inception_3b/double3x3b/bn" 694 | top: "inception_3b/double3x3b/bn" 695 | type: "BatchNorm" 696 | } 697 | layer { 698 | bottom: "inception_3b/double3x3b/bn" 699 | top: "inception_3b/double3x3b/bn/sc" 700 | name: "inception_3b/double3x3b/bn/sc" 701 | type: "Scale" 702 | scale_param { 703 | bias_term: true 704 | } 705 | } 706 | layer { 707 | bottom: "inception_3b/double3x3b/bn/sc" 708 | top: "inception_3b/double3x3b/bn/sc" 709 | name: "inception_3b/double3x3b/bn/sc/relu" 710 | type: "ReLU" 711 | } 712 | layer { 713 | bottom: "inception_3a/output" 714 | top: "inception_3b/pool" 715 | name: "inception_3b/pool" 716 | type: "Pooling" 717 | pooling_param { 718 | pool: AVE 719 | kernel_size: 3 720 | stride: 1 721 | pad: 1 722 | } 723 | } 724 | layer { 725 | bottom: "inception_3b/pool" 726 | top: "inception_3b/pool_proj" 727 | name: "inception_3b/pool_proj" 728 | type: "Convolution" 729 | param { 730 | lr_mult: 1 731 | decay_mult: 1 732 | } 733 | convolution_param { 734 | num_output: 64 735 | pad: 0 736 | kernel_size: 1 737 | stride: 1 738 | weight_filler { 739 | type: "xavier" 740 | } 741 | bias_term: false 742 | } 743 | } 744 | layer { 745 | bottom: "inception_3b/pool_proj" 746 | name: "inception_3b/pool_proj/bn" 747 | top: "inception_3b/pool_proj/bn" 748 | type: "BatchNorm" 749 | } 750 | layer { 751 | bottom: "inception_3b/pool_proj/bn" 752 | top: "inception_3b/pool_proj/bn/sc" 753 | name: "inception_3b/pool_proj/bn/sc" 754 | type: "Scale" 755 | scale_param { 756 | bias_term: true 757 | } 758 | } 759 | layer { 760 | bottom: "inception_3b/pool_proj/bn/sc" 761 | top: "inception_3b/pool_proj/bn/sc" 762 | name: "inception_3b/pool_proj/bn/sc/relu" 763 | type: "ReLU" 764 | } 765 | layer { 766 | bottom: "inception_3b/1x1/bn/sc" 767 | bottom: "inception_3b/3x3/bn/sc" 768 | bottom: "inception_3b/double3x3b/bn/sc" 769 | bottom: "inception_3b/pool_proj/bn/sc" 770 | top: "inception_3b/output" 771 | name: "inception_3b/output" 772 | type: "Concat" 773 | } 774 | layer { 775 | bottom: "inception_3b/output" 776 | top: "inception_3c/3x3_reduce" 777 | name: "inception_3c/3x3_reduce" 778 | type: "Convolution" 779 | param { 780 | lr_mult: 1 781 | decay_mult: 1 782 | } 783 | convolution_param { 784 | num_output: 128 785 | pad: 0 786 | kernel_size: 1 787 | stride: 1 788 | weight_filler { 789 | type: "xavier" 790 | } 791 | bias_term: false 792 | } 793 | } 794 | layer { 795 | bottom: "inception_3c/3x3_reduce" 796 | name: "inception_3c/3x3_reduce/bn" 797 | top: "inception_3c/3x3_reduce/bn" 798 | type: "BatchNorm" 799 | } 800 | layer { 801 | bottom: "inception_3c/3x3_reduce/bn" 802 | top: "inception_3c/3x3_reduce/bn/sc" 803 | name: "inception_3c/3x3_reduce/bn/sc" 804 | type: "Scale" 805 | scale_param { 806 | bias_term: true 807 | } 808 | } 809 | layer { 810 | bottom: "inception_3c/3x3_reduce/bn/sc" 811 | top: "inception_3c/3x3_reduce/bn/sc" 812 | name: "inception_3c/3x3_reduce/bn/sc/relu" 813 | type: "ReLU" 814 | } 815 | layer { 816 | bottom: "inception_3c/3x3_reduce/bn/sc" 817 | top: "inception_3c/3x3" 818 | name: "inception_3c/3x3" 819 | type: "Convolution" 820 | param { 821 | lr_mult: 1 822 | decay_mult: 1 823 | } 824 | convolution_param { 825 | num_output: 160 826 | pad: 1 827 | kernel_size: 3 828 | stride: 2 829 | weight_filler { 830 | type: "xavier" 831 | } 832 | bias_term: false 833 | } 834 | } 835 | layer { 836 | bottom: "inception_3c/3x3" 837 | name: "inception_3c/3x3/bn" 838 | top: "inception_3c/3x3/bn" 839 | type: "BatchNorm" 840 | } 841 | layer { 842 | bottom: "inception_3c/3x3/bn" 843 | top: "inception_3c/3x3/bn/sc" 844 | name: "inception_3c/3x3/bn/sc" 845 | type: "Scale" 846 | scale_param { 847 | bias_term: true 848 | } 849 | } 850 | layer { 851 | bottom: "inception_3c/3x3/bn/sc" 852 | top: "inception_3c/3x3/bn/sc" 853 | name: "inception_3c/3x3/bn/sc/relu" 854 | type: "ReLU" 855 | } 856 | layer { 857 | bottom: "inception_3b/output" 858 | top: "inception_3c/double3x3_reduce" 859 | name: "inception_3c/double3x3_reduce" 860 | type: "Convolution" 861 | param { 862 | lr_mult: 1 863 | decay_mult: 1 864 | } 865 | convolution_param { 866 | num_output: 64 867 | pad: 0 868 | kernel_size: 1 869 | stride: 1 870 | weight_filler { 871 | type: "xavier" 872 | } 873 | bias_term: false 874 | } 875 | } 876 | layer { 877 | bottom: "inception_3c/double3x3_reduce" 878 | name: "inception_3c/double3x3_reduce/bn" 879 | top: "inception_3c/double3x3_reduce/bn" 880 | type: "BatchNorm" 881 | } 882 | layer { 883 | bottom: "inception_3c/double3x3_reduce/bn" 884 | top: "inception_3c/double3x3_reduce/bn/sc" 885 | name: "inception_3c/double3x3_reduce/bn/sc" 886 | type: "Scale" 887 | scale_param { 888 | bias_term: true 889 | } 890 | } 891 | layer { 892 | bottom: "inception_3c/double3x3_reduce/bn/sc" 893 | top: "inception_3c/double3x3_reduce/bn/sc" 894 | name: "inception_3c/double3x3_reduce/bn/sc/relu" 895 | type: "ReLU" 896 | } 897 | layer { 898 | bottom: "inception_3c/double3x3_reduce/bn/sc" 899 | top: "inception_3c/double3x3a" 900 | name: "inception_3c/double3x3a" 901 | type: "Convolution" 902 | param { 903 | lr_mult: 1 904 | decay_mult: 1 905 | } 906 | convolution_param { 907 | num_output: 96 908 | pad: 1 909 | kernel_size: 3 910 | stride: 1 911 | weight_filler { 912 | type: "xavier" 913 | } 914 | bias_term: false 915 | } 916 | } 917 | layer { 918 | bottom: "inception_3c/double3x3a" 919 | name: "inception_3c/double3x3a/bn" 920 | top: "inception_3c/double3x3a/bn" 921 | type: "BatchNorm" 922 | } 923 | layer { 924 | bottom: "inception_3c/double3x3a/bn" 925 | top: "inception_3c/double3x3a/bn/sc" 926 | name: "inception_3c/double3x3a/bn/sc" 927 | type: "Scale" 928 | scale_param { 929 | bias_term: true 930 | } 931 | } 932 | layer { 933 | bottom: "inception_3c/double3x3a/bn/sc" 934 | top: "inception_3c/double3x3a/bn/sc" 935 | name: "inception_3c/double3x3a/bn/sc/relu" 936 | type: "ReLU" 937 | } 938 | layer { 939 | bottom: "inception_3c/double3x3a/bn/sc" 940 | top: "inception_3c/double3x3b" 941 | name: "inception_3c/double3x3b" 942 | type: "Convolution" 943 | param { 944 | lr_mult: 1 945 | decay_mult: 1 946 | } 947 | convolution_param { 948 | num_output: 96 949 | pad: 1 950 | kernel_size: 3 951 | stride: 2 952 | weight_filler { 953 | type: "xavier" 954 | } 955 | bias_term: false 956 | } 957 | } 958 | layer { 959 | bottom: "inception_3c/double3x3b" 960 | name: "inception_3c/double3x3b/bn" 961 | top: "inception_3c/double3x3b/bn" 962 | type: "BatchNorm" 963 | } 964 | layer { 965 | bottom: "inception_3c/double3x3b/bn" 966 | top: "inception_3c/double3x3b/bn/sc" 967 | name: "inception_3c/double3x3b/bn/sc" 968 | type: "Scale" 969 | scale_param { 970 | bias_term: true 971 | } 972 | } 973 | layer { 974 | bottom: "inception_3c/double3x3b/bn/sc" 975 | top: "inception_3c/double3x3b/bn/sc" 976 | name: "inception_3c/double3x3b/bn/sc/relu" 977 | type: "ReLU" 978 | } 979 | layer { 980 | bottom: "inception_3b/output" 981 | top: "inception_3c/pool" 982 | name: "inception_3c/pool" 983 | type: "Pooling" 984 | pooling_param { 985 | pool: MAX 986 | kernel_size: 3 987 | stride: 2 988 | } 989 | } 990 | layer { 991 | bottom: "inception_3c/3x3/bn/sc" 992 | bottom: "inception_3c/double3x3b/bn/sc" 993 | bottom: "inception_3c/pool" 994 | top: "inception_3c/output" 995 | name: "inception_3c/output" 996 | type: "Concat" 997 | } 998 | layer { 999 | bottom: "inception_3c/output" 1000 | top: "pool3/5x5_s3" 1001 | name: "pool3/5x5_s3" 1002 | type: "Pooling" 1003 | pooling_param { 1004 | pool: AVE 1005 | kernel_size: 5 1006 | stride: 3 1007 | } 1008 | } 1009 | layer { 1010 | bottom: "pool3/5x5_s3" 1011 | top: "loss1/conv" 1012 | name: "loss1/conv" 1013 | type: "Convolution" 1014 | param { 1015 | lr_mult: 1 1016 | decay_mult: 1 1017 | } 1018 | convolution_param { 1019 | num_output: 128 1020 | pad: 0 1021 | kernel_size: 1 1022 | stride: 1 1023 | weight_filler { 1024 | type: "xavier" 1025 | } 1026 | bias_term: false 1027 | } 1028 | } 1029 | layer { 1030 | bottom: "loss1/conv" 1031 | name: "loss1/conv/bn" 1032 | top: "loss1/conv/bn" 1033 | type: "BatchNorm" 1034 | } 1035 | layer { 1036 | bottom: "loss1/conv/bn" 1037 | top: "loss1/conv/bn/sc" 1038 | name: "loss1/conv/bn/sc" 1039 | type: "Scale" 1040 | scale_param { 1041 | bias_term: true 1042 | } 1043 | } 1044 | layer { 1045 | bottom: "loss1/conv/bn/sc" 1046 | top: "loss1/conv/bn/sc" 1047 | name: "loss1/conv/bn/sc/relu" 1048 | type: "ReLU" 1049 | } 1050 | layer { 1051 | bottom: "loss1/conv/bn/sc" 1052 | top: "loss1/fc" 1053 | name: "loss1/fc" 1054 | type: "InnerProduct" 1055 | param { 1056 | lr_mult: 1 1057 | decay_mult: 1 1058 | } 1059 | inner_product_param { 1060 | num_output: 1024 1061 | weight_filler { 1062 | type: "xavier" 1063 | } 1064 | bias_term: false 1065 | } 1066 | } 1067 | layer { 1068 | bottom: "loss1/fc" 1069 | name: "loss1/fc/bn" 1070 | top: "loss1/fc/bn" 1071 | type: "BatchNorm" 1072 | } 1073 | layer { 1074 | bottom: "loss1/fc/bn" 1075 | top: "loss1/fc/bn/sc" 1076 | name: "loss1/fc/bn/sc" 1077 | type: "Scale" 1078 | scale_param { 1079 | bias_term: true 1080 | } 1081 | } 1082 | layer { 1083 | bottom: "loss1/fc/bn/sc" 1084 | top: "loss1/fc/bn/sc" 1085 | name: "loss1/fc/bn/sc/relu" 1086 | type: "ReLU" 1087 | } 1088 | 1089 | 1090 | layer { 1091 | bottom: "inception_3c/output" 1092 | top: "inception_4a/1x1" 1093 | name: "inception_4a/1x1" 1094 | type: "Convolution" 1095 | param { 1096 | lr_mult: 1 1097 | decay_mult: 1 1098 | } 1099 | convolution_param { 1100 | num_output: 224 1101 | pad: 0 1102 | kernel_size: 1 1103 | stride: 1 1104 | weight_filler { 1105 | type: "xavier" 1106 | } 1107 | bias_term: false 1108 | } 1109 | } 1110 | layer { 1111 | bottom: "inception_4a/1x1" 1112 | name: "inception_4a/1x1/bn" 1113 | top: "inception_4a/1x1/bn" 1114 | type: "BatchNorm" 1115 | } 1116 | layer { 1117 | bottom: "inception_4a/1x1/bn" 1118 | top: "inception_4a/1x1/bn/sc" 1119 | name: "inception_4a/1x1/bn/sc" 1120 | type: "Scale" 1121 | scale_param { 1122 | bias_term: true 1123 | } 1124 | } 1125 | layer { 1126 | bottom: "inception_4a/1x1/bn/sc" 1127 | top: "inception_4a/1x1/bn/sc" 1128 | name: "inception_4a/1x1/bn/sc/relu" 1129 | type: "ReLU" 1130 | } 1131 | layer { 1132 | bottom: "inception_3c/output" 1133 | top: "inception_4a/3x3_reduce" 1134 | name: "inception_4a/3x3_reduce" 1135 | type: "Convolution" 1136 | param { 1137 | lr_mult: 1 1138 | decay_mult: 1 1139 | } 1140 | convolution_param { 1141 | num_output: 64 1142 | pad: 0 1143 | kernel_size: 1 1144 | stride: 1 1145 | weight_filler { 1146 | type: "xavier" 1147 | } 1148 | bias_term: false 1149 | } 1150 | } 1151 | layer { 1152 | bottom: "inception_4a/3x3_reduce" 1153 | name: "inception_4a/3x3_reduce/bn" 1154 | top: "inception_4a/3x3_reduce/bn" 1155 | type: "BatchNorm" 1156 | } 1157 | layer { 1158 | bottom: "inception_4a/3x3_reduce/bn" 1159 | top: "inception_4a/3x3_reduce/bn/sc" 1160 | name: "inception_4a/3x3_reduce/bn/sc" 1161 | type: "Scale" 1162 | scale_param { 1163 | bias_term: true 1164 | } 1165 | } 1166 | layer { 1167 | bottom: "inception_4a/3x3_reduce/bn/sc" 1168 | top: "inception_4a/3x3_reduce/bn/sc" 1169 | name: "inception_4a/3x3_reduce/bn/sc/relu" 1170 | type: "ReLU" 1171 | } 1172 | layer { 1173 | bottom: "inception_4a/3x3_reduce/bn/sc" 1174 | top: "inception_4a/3x3" 1175 | name: "inception_4a/3x3" 1176 | type: "Convolution" 1177 | param { 1178 | lr_mult: 1 1179 | decay_mult: 1 1180 | } 1181 | convolution_param { 1182 | num_output: 96 1183 | pad: 1 1184 | kernel_size: 3 1185 | stride: 1 1186 | weight_filler { 1187 | type: "xavier" 1188 | } 1189 | bias_term: false 1190 | } 1191 | } 1192 | layer { 1193 | bottom: "inception_4a/3x3" 1194 | name: "inception_4a/3x3/bn" 1195 | top: "inception_4a/3x3/bn" 1196 | type: "BatchNorm" 1197 | } 1198 | layer { 1199 | bottom: "inception_4a/3x3/bn" 1200 | top: "inception_4a/3x3/bn/sc" 1201 | name: "inception_4a/3x3/bn/sc" 1202 | type: "Scale" 1203 | scale_param { 1204 | bias_term: true 1205 | } 1206 | } 1207 | layer { 1208 | bottom: "inception_4a/3x3/bn/sc" 1209 | top: "inception_4a/3x3/bn/sc" 1210 | name: "inception_4a/3x3/bn/sc/relu" 1211 | type: "ReLU" 1212 | } 1213 | layer { 1214 | bottom: "inception_3c/output" 1215 | top: "inception_4a/double3x3_reduce" 1216 | name: "inception_4a/double3x3_reduce" 1217 | type: "Convolution" 1218 | param { 1219 | lr_mult: 1 1220 | decay_mult: 1 1221 | } 1222 | convolution_param { 1223 | num_output: 96 1224 | pad: 0 1225 | kernel_size: 1 1226 | stride: 1 1227 | weight_filler { 1228 | type: "xavier" 1229 | } 1230 | bias_term: false 1231 | } 1232 | } 1233 | layer { 1234 | bottom: "inception_4a/double3x3_reduce" 1235 | name: "inception_4a/double3x3_reduce/bn" 1236 | top: "inception_4a/double3x3_reduce/bn" 1237 | type: "BatchNorm" 1238 | } 1239 | layer { 1240 | bottom: "inception_4a/double3x3_reduce/bn" 1241 | top: "inception_4a/double3x3_reduce/bn/sc" 1242 | name: "inception_4a/double3x3_reduce/bn/sc" 1243 | type: "Scale" 1244 | scale_param { 1245 | bias_term: true 1246 | } 1247 | } 1248 | layer { 1249 | bottom: "inception_4a/double3x3_reduce/bn/sc" 1250 | top: "inception_4a/double3x3_reduce/bn/sc" 1251 | name: "inception_4a/double3x3_reduce/bn/sc/relu" 1252 | type: "ReLU" 1253 | } 1254 | layer { 1255 | bottom: "inception_4a/double3x3_reduce/bn/sc" 1256 | top: "inception_4a/double3x3a" 1257 | name: "inception_4a/double3x3a" 1258 | type: "Convolution" 1259 | param { 1260 | lr_mult: 1 1261 | decay_mult: 1 1262 | } 1263 | convolution_param { 1264 | num_output: 128 1265 | pad: 1 1266 | kernel_size: 3 1267 | stride: 1 1268 | weight_filler { 1269 | type: "xavier" 1270 | } 1271 | bias_term: false 1272 | } 1273 | } 1274 | layer { 1275 | bottom: "inception_4a/double3x3a" 1276 | name: "inception_4a/double3x3a/bn" 1277 | top: "inception_4a/double3x3a/bn" 1278 | type: "BatchNorm" 1279 | } 1280 | layer { 1281 | bottom: "inception_4a/double3x3a/bn" 1282 | top: "inception_4a/double3x3a/bn/sc" 1283 | name: "inception_4a/double3x3a/bn/sc" 1284 | type: "Scale" 1285 | scale_param { 1286 | bias_term: true 1287 | } 1288 | } 1289 | layer { 1290 | bottom: "inception_4a/double3x3a/bn/sc" 1291 | top: "inception_4a/double3x3a/bn/sc" 1292 | name: "inception_4a/double3x3a/bn/sc/relu" 1293 | type: "ReLU" 1294 | } 1295 | layer { 1296 | bottom: "inception_4a/double3x3a/bn/sc" 1297 | top: "inception_4a/double3x3b" 1298 | name: "inception_4a/double3x3b" 1299 | type: "Convolution" 1300 | param { 1301 | lr_mult: 1 1302 | decay_mult: 1 1303 | } 1304 | convolution_param { 1305 | num_output: 128 1306 | pad: 1 1307 | kernel_size: 3 1308 | stride: 1 1309 | weight_filler { 1310 | type: "xavier" 1311 | } 1312 | bias_term: false 1313 | } 1314 | } 1315 | layer { 1316 | bottom: "inception_4a/double3x3b" 1317 | name: "inception_4a/double3x3b/bn" 1318 | top: "inception_4a/double3x3b/bn" 1319 | type: "BatchNorm" 1320 | } 1321 | layer { 1322 | bottom: "inception_4a/double3x3b/bn" 1323 | top: "inception_4a/double3x3b/bn/sc" 1324 | name: "inception_4a/double3x3b/bn/sc" 1325 | type: "Scale" 1326 | scale_param { 1327 | bias_term: true 1328 | } 1329 | } 1330 | layer { 1331 | bottom: "inception_4a/double3x3b/bn/sc" 1332 | top: "inception_4a/double3x3b/bn/sc" 1333 | name: "inception_4a/double3x3b/bn/sc/relu" 1334 | type: "ReLU" 1335 | } 1336 | layer { 1337 | bottom: "inception_3c/output" 1338 | top: "inception_4a/pool" 1339 | name: "inception_4a/pool" 1340 | type: "Pooling" 1341 | pooling_param { 1342 | pool: AVE 1343 | kernel_size: 3 1344 | stride: 1 1345 | pad: 1 1346 | } 1347 | } 1348 | layer { 1349 | bottom: "inception_4a/pool" 1350 | top: "inception_4a/pool_proj" 1351 | name: "inception_4a/pool_proj" 1352 | type: "Convolution" 1353 | param { 1354 | lr_mult: 1 1355 | decay_mult: 1 1356 | } 1357 | convolution_param { 1358 | num_output: 128 1359 | pad: 0 1360 | kernel_size: 1 1361 | stride: 1 1362 | weight_filler { 1363 | type: "xavier" 1364 | } 1365 | bias_term: false 1366 | } 1367 | } 1368 | layer { 1369 | bottom: "inception_4a/pool_proj" 1370 | name: "inception_4a/pool_proj/bn" 1371 | top: "inception_4a/pool_proj/bn" 1372 | type: "BatchNorm" 1373 | } 1374 | layer { 1375 | bottom: "inception_4a/pool_proj/bn" 1376 | top: "inception_4a/pool_proj/bn/sc" 1377 | name: "inception_4a/pool_proj/bn/sc" 1378 | type: "Scale" 1379 | scale_param { 1380 | bias_term: true 1381 | } 1382 | } 1383 | layer { 1384 | bottom: "inception_4a/pool_proj/bn/sc" 1385 | top: "inception_4a/pool_proj/bn/sc" 1386 | name: "inception_4a/pool_proj/bn/sc/relu" 1387 | type: "ReLU" 1388 | } 1389 | layer { 1390 | bottom: "inception_4a/1x1/bn/sc" 1391 | bottom: "inception_4a/3x3/bn/sc" 1392 | bottom: "inception_4a/double3x3b/bn/sc" 1393 | bottom: "inception_4a/pool_proj/bn/sc" 1394 | top: "inception_4a/output" 1395 | name: "inception_4a/output" 1396 | type: "Concat" 1397 | } 1398 | layer { 1399 | bottom: "inception_4a/output" 1400 | top: "inception_4b/1x1" 1401 | name: "inception_4b/1x1" 1402 | type: "Convolution" 1403 | param { 1404 | lr_mult: 1 1405 | decay_mult: 1 1406 | } 1407 | convolution_param { 1408 | num_output: 192 1409 | pad: 0 1410 | kernel_size: 1 1411 | stride: 1 1412 | weight_filler { 1413 | type: "xavier" 1414 | } 1415 | bias_term: false 1416 | } 1417 | } 1418 | layer { 1419 | bottom: "inception_4b/1x1" 1420 | name: "inception_4b/1x1/bn" 1421 | top: "inception_4b/1x1/bn" 1422 | type: "BatchNorm" 1423 | } 1424 | layer { 1425 | bottom: "inception_4b/1x1/bn" 1426 | top: "inception_4b/1x1/bn/sc" 1427 | name: "inception_4b/1x1/bn/sc" 1428 | type: "Scale" 1429 | scale_param { 1430 | bias_term: true 1431 | } 1432 | } 1433 | layer { 1434 | bottom: "inception_4b/1x1/bn/sc" 1435 | top: "inception_4b/1x1/bn/sc" 1436 | name: "inception_4b/1x1/bn/sc/relu" 1437 | type: "ReLU" 1438 | } 1439 | layer { 1440 | bottom: "inception_4a/output" 1441 | top: "inception_4b/3x3_reduce" 1442 | name: "inception_4b/3x3_reduce" 1443 | type: "Convolution" 1444 | param { 1445 | lr_mult: 1 1446 | decay_mult: 1 1447 | } 1448 | convolution_param { 1449 | num_output: 96 1450 | pad: 0 1451 | kernel_size: 1 1452 | stride: 1 1453 | weight_filler { 1454 | type: "xavier" 1455 | } 1456 | bias_term: false 1457 | } 1458 | } 1459 | layer { 1460 | bottom: "inception_4b/3x3_reduce" 1461 | name: "inception_4b/3x3_reduce/bn" 1462 | top: "inception_4b/3x3_reduce/bn" 1463 | type: "BatchNorm" 1464 | } 1465 | layer { 1466 | bottom: "inception_4b/3x3_reduce/bn" 1467 | top: "inception_4b/3x3_reduce/bn/sc" 1468 | name: "inception_4b/3x3_reduce/bn/sc" 1469 | type: "Scale" 1470 | scale_param { 1471 | bias_term: true 1472 | } 1473 | } 1474 | layer { 1475 | bottom: "inception_4b/3x3_reduce/bn/sc" 1476 | top: "inception_4b/3x3_reduce/bn/sc" 1477 | name: "inception_4b/3x3_reduce/bn/sc/relu" 1478 | type: "ReLU" 1479 | } 1480 | layer { 1481 | bottom: "inception_4b/3x3_reduce/bn/sc" 1482 | top: "inception_4b/3x3" 1483 | name: "inception_4b/3x3" 1484 | type: "Convolution" 1485 | param { 1486 | lr_mult: 1 1487 | decay_mult: 1 1488 | } 1489 | convolution_param { 1490 | num_output: 128 1491 | pad: 1 1492 | kernel_size: 3 1493 | stride: 1 1494 | weight_filler { 1495 | type: "xavier" 1496 | } 1497 | bias_term: false 1498 | } 1499 | } 1500 | layer { 1501 | bottom: "inception_4b/3x3" 1502 | name: "inception_4b/3x3/bn" 1503 | top: "inception_4b/3x3/bn" 1504 | type: "BatchNorm" 1505 | } 1506 | layer { 1507 | bottom: "inception_4b/3x3/bn" 1508 | top: "inception_4b/3x3/bn/sc" 1509 | name: "inception_4b/3x3/bn/sc" 1510 | type: "Scale" 1511 | scale_param { 1512 | bias_term: true 1513 | } 1514 | } 1515 | layer { 1516 | bottom: "inception_4b/3x3/bn/sc" 1517 | top: "inception_4b/3x3/bn/sc" 1518 | name: "inception_4b/3x3/bn/sc/relu" 1519 | type: "ReLU" 1520 | } 1521 | layer { 1522 | bottom: "inception_4a/output" 1523 | top: "inception_4b/double3x3_reduce" 1524 | name: "inception_4b/double3x3_reduce" 1525 | type: "Convolution" 1526 | param { 1527 | lr_mult: 1 1528 | decay_mult: 1 1529 | } 1530 | convolution_param { 1531 | num_output: 96 1532 | pad: 0 1533 | kernel_size: 1 1534 | stride: 1 1535 | weight_filler { 1536 | type: "xavier" 1537 | } 1538 | bias_term: false 1539 | } 1540 | } 1541 | layer { 1542 | bottom: "inception_4b/double3x3_reduce" 1543 | name: "inception_4b/double3x3_reduce/bn" 1544 | top: "inception_4b/double3x3_reduce/bn" 1545 | type: "BatchNorm" 1546 | } 1547 | layer { 1548 | bottom: "inception_4b/double3x3_reduce/bn" 1549 | top: "inception_4b/double3x3_reduce/bn/sc" 1550 | name: "inception_4b/double3x3_reduce/bn/sc" 1551 | type: "Scale" 1552 | scale_param { 1553 | bias_term: true 1554 | } 1555 | } 1556 | layer { 1557 | bottom: "inception_4b/double3x3_reduce/bn/sc" 1558 | top: "inception_4b/double3x3_reduce/bn/sc" 1559 | name: "inception_4b/double3x3_reduce/bn/sc/relu" 1560 | type: "ReLU" 1561 | } 1562 | layer { 1563 | bottom: "inception_4b/double3x3_reduce/bn/sc" 1564 | top: "inception_4b/double3x3a" 1565 | name: "inception_4b/double3x3a" 1566 | type: "Convolution" 1567 | param { 1568 | lr_mult: 1 1569 | decay_mult: 1 1570 | } 1571 | convolution_param { 1572 | num_output: 128 1573 | pad: 1 1574 | kernel_size: 3 1575 | stride: 1 1576 | weight_filler { 1577 | type: "xavier" 1578 | } 1579 | bias_term: false 1580 | } 1581 | } 1582 | layer { 1583 | bottom: "inception_4b/double3x3a" 1584 | name: "inception_4b/double3x3a/bn" 1585 | top: "inception_4b/double3x3a/bn" 1586 | type: "BatchNorm" 1587 | } 1588 | layer { 1589 | bottom: "inception_4b/double3x3a/bn" 1590 | top: "inception_4b/double3x3a/bn/sc" 1591 | name: "inception_4b/double3x3a/bn/sc" 1592 | type: "Scale" 1593 | scale_param { 1594 | bias_term: true 1595 | } 1596 | } 1597 | layer { 1598 | bottom: "inception_4b/double3x3a/bn/sc" 1599 | top: "inception_4b/double3x3a/bn/sc" 1600 | name: "inception_4b/double3x3a/bn/sc/relu" 1601 | type: "ReLU" 1602 | } 1603 | layer { 1604 | bottom: "inception_4b/double3x3a/bn/sc" 1605 | top: "inception_4b/double3x3b" 1606 | name: "inception_4b/double3x3b" 1607 | type: "Convolution" 1608 | param { 1609 | lr_mult: 1 1610 | decay_mult: 1 1611 | } 1612 | convolution_param { 1613 | num_output: 128 1614 | pad: 1 1615 | kernel_size: 3 1616 | stride: 1 1617 | weight_filler { 1618 | type: "xavier" 1619 | } 1620 | bias_term: false 1621 | } 1622 | } 1623 | layer { 1624 | bottom: "inception_4b/double3x3b" 1625 | name: "inception_4b/double3x3b/bn" 1626 | top: "inception_4b/double3x3b/bn" 1627 | type: "BatchNorm" 1628 | } 1629 | layer { 1630 | bottom: "inception_4b/double3x3b/bn" 1631 | top: "inception_4b/double3x3b/bn/sc" 1632 | name: "inception_4b/double3x3b/bn/sc" 1633 | type: "Scale" 1634 | scale_param { 1635 | bias_term: true 1636 | } 1637 | } 1638 | layer { 1639 | bottom: "inception_4b/double3x3b/bn/sc" 1640 | top: "inception_4b/double3x3b/bn/sc" 1641 | name: "inception_4b/double3x3b/bn/sc/relu" 1642 | type: "ReLU" 1643 | } 1644 | layer { 1645 | bottom: "inception_4a/output" 1646 | top: "inception_4b/pool" 1647 | name: "inception_4b/pool" 1648 | type: "Pooling" 1649 | pooling_param { 1650 | pool: AVE 1651 | kernel_size: 3 1652 | stride: 1 1653 | pad: 1 1654 | } 1655 | } 1656 | layer { 1657 | bottom: "inception_4b/pool" 1658 | top: "inception_4b/pool_proj" 1659 | name: "inception_4b/pool_proj" 1660 | type: "Convolution" 1661 | param { 1662 | lr_mult: 1 1663 | decay_mult: 1 1664 | } 1665 | convolution_param { 1666 | num_output: 128 1667 | pad: 0 1668 | kernel_size: 1 1669 | stride: 1 1670 | weight_filler { 1671 | type: "xavier" 1672 | } 1673 | bias_term: false 1674 | } 1675 | } 1676 | layer { 1677 | bottom: "inception_4b/pool_proj" 1678 | name: "inception_4b/pool_proj/bn" 1679 | top: "inception_4b/pool_proj/bn" 1680 | type: "BatchNorm" 1681 | } 1682 | layer { 1683 | bottom: "inception_4b/pool_proj/bn" 1684 | top: "inception_4b/pool_proj/bn/sc" 1685 | name: "inception_4b/pool_proj/bn/sc" 1686 | type: "Scale" 1687 | scale_param { 1688 | bias_term: true 1689 | } 1690 | } 1691 | layer { 1692 | bottom: "inception_4b/pool_proj/bn/sc" 1693 | top: "inception_4b/pool_proj/bn/sc" 1694 | name: "inception_4b/pool_proj/bn/sc/relu" 1695 | type: "ReLU" 1696 | } 1697 | layer { 1698 | bottom: "inception_4b/1x1/bn/sc" 1699 | bottom: "inception_4b/3x3/bn/sc" 1700 | bottom: "inception_4b/double3x3b/bn/sc" 1701 | bottom: "inception_4b/pool_proj/bn/sc" 1702 | top: "inception_4b/output" 1703 | name: "inception_4b/output" 1704 | type: "Concat" 1705 | } 1706 | layer { 1707 | bottom: "inception_4b/output" 1708 | top: "inception_4c/1x1" 1709 | name: "inception_4c/1x1" 1710 | type: "Convolution" 1711 | param { 1712 | lr_mult: 1 1713 | decay_mult: 1 1714 | } 1715 | convolution_param { 1716 | num_output: 160 1717 | pad: 0 1718 | kernel_size: 1 1719 | stride: 1 1720 | weight_filler { 1721 | type: "xavier" 1722 | } 1723 | bias_term: false 1724 | } 1725 | } 1726 | layer { 1727 | bottom: "inception_4c/1x1" 1728 | name: "inception_4c/1x1/bn" 1729 | top: "inception_4c/1x1/bn" 1730 | type: "BatchNorm" 1731 | } 1732 | layer { 1733 | bottom: "inception_4c/1x1/bn" 1734 | top: "inception_4c/1x1/bn/sc" 1735 | name: "inception_4c/1x1/bn/sc" 1736 | type: "Scale" 1737 | scale_param { 1738 | bias_term: true 1739 | } 1740 | } 1741 | layer { 1742 | bottom: "inception_4c/1x1/bn/sc" 1743 | top: "inception_4c/1x1/bn/sc" 1744 | name: "inception_4c/1x1/bn/sc/relu" 1745 | type: "ReLU" 1746 | } 1747 | layer { 1748 | bottom: "inception_4b/output" 1749 | top: "inception_4c/3x3_reduce" 1750 | name: "inception_4c/3x3_reduce" 1751 | type: "Convolution" 1752 | param { 1753 | lr_mult: 1 1754 | decay_mult: 1 1755 | } 1756 | convolution_param { 1757 | num_output: 128 1758 | pad: 0 1759 | kernel_size: 1 1760 | stride: 1 1761 | weight_filler { 1762 | type: "xavier" 1763 | } 1764 | bias_term: false 1765 | } 1766 | } 1767 | layer { 1768 | bottom: "inception_4c/3x3_reduce" 1769 | name: "inception_4c/3x3_reduce/bn" 1770 | top: "inception_4c/3x3_reduce/bn" 1771 | type: "BatchNorm" 1772 | } 1773 | layer { 1774 | bottom: "inception_4c/3x3_reduce/bn" 1775 | top: "inception_4c/3x3_reduce/bn/sc" 1776 | name: "inception_4c/3x3_reduce/bn/sc" 1777 | type: "Scale" 1778 | scale_param { 1779 | bias_term: true 1780 | } 1781 | } 1782 | layer { 1783 | bottom: "inception_4c/3x3_reduce/bn/sc" 1784 | top: "inception_4c/3x3_reduce/bn/sc" 1785 | name: "inception_4c/3x3_reduce/bn/sc/relu" 1786 | type: "ReLU" 1787 | } 1788 | layer { 1789 | bottom: "inception_4c/3x3_reduce/bn/sc" 1790 | top: "inception_4c/3x3" 1791 | name: "inception_4c/3x3" 1792 | type: "Convolution" 1793 | param { 1794 | lr_mult: 1 1795 | decay_mult: 1 1796 | } 1797 | convolution_param { 1798 | num_output: 160 1799 | pad: 1 1800 | kernel_size: 3 1801 | stride: 1 1802 | weight_filler { 1803 | type: "xavier" 1804 | } 1805 | bias_term: false 1806 | } 1807 | } 1808 | layer { 1809 | bottom: "inception_4c/3x3" 1810 | name: "inception_4c/3x3/bn" 1811 | top: "inception_4c/3x3/bn" 1812 | type: "BatchNorm" 1813 | } 1814 | layer { 1815 | bottom: "inception_4c/3x3/bn" 1816 | top: "inception_4c/3x3/bn/sc" 1817 | name: "inception_4c/3x3/bn/sc" 1818 | type: "Scale" 1819 | scale_param { 1820 | bias_term: true 1821 | } 1822 | } 1823 | layer { 1824 | bottom: "inception_4c/3x3/bn/sc" 1825 | top: "inception_4c/3x3/bn/sc" 1826 | name: "inception_4c/3x3/bn/sc/relu" 1827 | type: "ReLU" 1828 | } 1829 | layer { 1830 | bottom: "inception_4b/output" 1831 | top: "inception_4c/double3x3_reduce" 1832 | name: "inception_4c/double3x3_reduce" 1833 | type: "Convolution" 1834 | param { 1835 | lr_mult: 1 1836 | decay_mult: 1 1837 | } 1838 | convolution_param { 1839 | num_output: 128 1840 | pad: 0 1841 | kernel_size: 1 1842 | stride: 1 1843 | weight_filler { 1844 | type: "xavier" 1845 | } 1846 | bias_term: false 1847 | } 1848 | } 1849 | layer { 1850 | bottom: "inception_4c/double3x3_reduce" 1851 | name: "inception_4c/double3x3_reduce/bn" 1852 | top: "inception_4c/double3x3_reduce/bn" 1853 | type: "BatchNorm" 1854 | } 1855 | layer { 1856 | bottom: "inception_4c/double3x3_reduce/bn" 1857 | top: "inception_4c/double3x3_reduce/bn/sc" 1858 | name: "inception_4c/double3x3_reduce/bn/sc" 1859 | type: "Scale" 1860 | scale_param { 1861 | bias_term: true 1862 | } 1863 | } 1864 | layer { 1865 | bottom: "inception_4c/double3x3_reduce/bn/sc" 1866 | top: "inception_4c/double3x3_reduce/bn/sc" 1867 | name: "inception_4c/double3x3_reduce/bn/sc/relu" 1868 | type: "ReLU" 1869 | } 1870 | layer { 1871 | bottom: "inception_4c/double3x3_reduce/bn/sc" 1872 | top: "inception_4c/double3x3a" 1873 | name: "inception_4c/double3x3a" 1874 | type: "Convolution" 1875 | param { 1876 | lr_mult: 1 1877 | decay_mult: 1 1878 | } 1879 | convolution_param { 1880 | num_output: 160 1881 | pad: 1 1882 | kernel_size: 3 1883 | stride: 1 1884 | weight_filler { 1885 | type: "xavier" 1886 | } 1887 | bias_term: false 1888 | } 1889 | } 1890 | layer { 1891 | bottom: "inception_4c/double3x3a" 1892 | name: "inception_4c/double3x3a/bn" 1893 | top: "inception_4c/double3x3a/bn" 1894 | type: "BatchNorm" 1895 | } 1896 | layer { 1897 | bottom: "inception_4c/double3x3a/bn" 1898 | top: "inception_4c/double3x3a/bn/sc" 1899 | name: "inception_4c/double3x3a/bn/sc" 1900 | type: "Scale" 1901 | scale_param { 1902 | bias_term: true 1903 | } 1904 | } 1905 | layer { 1906 | bottom: "inception_4c/double3x3a/bn/sc" 1907 | top: "inception_4c/double3x3a/bn/sc" 1908 | name: "inception_4c/double3x3a/bn/sc/relu" 1909 | type: "ReLU" 1910 | } 1911 | layer { 1912 | bottom: "inception_4c/double3x3a/bn/sc" 1913 | top: "inception_4c/double3x3b" 1914 | name: "inception_4c/double3x3b" 1915 | type: "Convolution" 1916 | param { 1917 | lr_mult: 1 1918 | decay_mult: 1 1919 | } 1920 | convolution_param { 1921 | num_output: 160 1922 | pad: 1 1923 | kernel_size: 3 1924 | stride: 1 1925 | weight_filler { 1926 | type: "xavier" 1927 | } 1928 | bias_term: false 1929 | } 1930 | } 1931 | layer { 1932 | bottom: "inception_4c/double3x3b" 1933 | name: "inception_4c/double3x3b/bn" 1934 | top: "inception_4c/double3x3b/bn" 1935 | type: "BatchNorm" 1936 | } 1937 | layer { 1938 | bottom: "inception_4c/double3x3b/bn" 1939 | top: "inception_4c/double3x3b/bn/sc" 1940 | name: "inception_4c/double3x3b/bn/sc" 1941 | type: "Scale" 1942 | scale_param { 1943 | bias_term: true 1944 | } 1945 | } 1946 | layer { 1947 | bottom: "inception_4c/double3x3b/bn/sc" 1948 | top: "inception_4c/double3x3b/bn/sc" 1949 | name: "inception_4c/double3x3b/bn/sc/relu" 1950 | type: "ReLU" 1951 | } 1952 | layer { 1953 | bottom: "inception_4b/output" 1954 | top: "inception_4c/pool" 1955 | name: "inception_4c/pool" 1956 | type: "Pooling" 1957 | pooling_param { 1958 | pool: AVE 1959 | kernel_size: 3 1960 | stride: 1 1961 | pad: 1 1962 | } 1963 | } 1964 | layer { 1965 | bottom: "inception_4c/pool" 1966 | top: "inception_4c/pool_proj" 1967 | name: "inception_4c/pool_proj" 1968 | type: "Convolution" 1969 | param { 1970 | lr_mult: 1 1971 | decay_mult: 1 1972 | } 1973 | convolution_param { 1974 | num_output: 96 1975 | pad: 0 1976 | kernel_size: 1 1977 | stride: 1 1978 | weight_filler { 1979 | type: "xavier" 1980 | } 1981 | bias_term: false 1982 | } 1983 | } 1984 | layer { 1985 | bottom: "inception_4c/pool_proj" 1986 | name: "inception_4c/pool_proj/bn" 1987 | top: "inception_4c/pool_proj/bn" 1988 | type: "BatchNorm" 1989 | } 1990 | layer { 1991 | bottom: "inception_4c/pool_proj/bn" 1992 | top: "inception_4c/pool_proj/bn/sc" 1993 | name: "inception_4c/pool_proj/bn/sc" 1994 | type: "Scale" 1995 | scale_param { 1996 | bias_term: true 1997 | } 1998 | } 1999 | layer { 2000 | bottom: "inception_4c/pool_proj/bn/sc" 2001 | top: "inception_4c/pool_proj/bn/sc" 2002 | name: "inception_4c/pool_proj/bn/sc/relu" 2003 | type: "ReLU" 2004 | } 2005 | layer { 2006 | bottom: "inception_4c/1x1/bn/sc" 2007 | bottom: "inception_4c/3x3/bn/sc" 2008 | bottom: "inception_4c/double3x3b/bn/sc" 2009 | bottom: "inception_4c/pool_proj/bn/sc" 2010 | top: "inception_4c/output" 2011 | name: "inception_4c/output" 2012 | type: "Concat" 2013 | } 2014 | layer { 2015 | bottom: "inception_4c/output" 2016 | top: "inception_4d/1x1" 2017 | name: "inception_4d/1x1" 2018 | type: "Convolution" 2019 | param { 2020 | lr_mult: 1 2021 | decay_mult: 1 2022 | } 2023 | convolution_param { 2024 | num_output: 96 2025 | pad: 0 2026 | kernel_size: 1 2027 | stride: 1 2028 | weight_filler { 2029 | type: "xavier" 2030 | } 2031 | bias_term: false 2032 | } 2033 | } 2034 | layer { 2035 | bottom: "inception_4d/1x1" 2036 | name: "inception_4d/1x1/bn" 2037 | top: "inception_4d/1x1/bn" 2038 | type: "BatchNorm" 2039 | } 2040 | layer { 2041 | bottom: "inception_4d/1x1/bn" 2042 | top: "inception_4d/1x1/bn/sc" 2043 | name: "inception_4d/1x1/bn/sc" 2044 | type: "Scale" 2045 | scale_param { 2046 | bias_term: true 2047 | } 2048 | } 2049 | layer { 2050 | bottom: "inception_4d/1x1/bn/sc" 2051 | top: "inception_4d/1x1/bn/sc" 2052 | name: "inception_4d/1x1/bn/sc/relu" 2053 | type: "ReLU" 2054 | } 2055 | layer { 2056 | bottom: "inception_4c/output" 2057 | top: "inception_4d/3x3_reduce" 2058 | name: "inception_4d/3x3_reduce" 2059 | type: "Convolution" 2060 | param { 2061 | lr_mult: 1 2062 | decay_mult: 1 2063 | } 2064 | convolution_param { 2065 | num_output: 128 2066 | pad: 0 2067 | kernel_size: 1 2068 | stride: 1 2069 | weight_filler { 2070 | type: "xavier" 2071 | } 2072 | bias_term: false 2073 | } 2074 | } 2075 | layer { 2076 | bottom: "inception_4d/3x3_reduce" 2077 | name: "inception_4d/3x3_reduce/bn" 2078 | top: "inception_4d/3x3_reduce/bn" 2079 | type: "BatchNorm" 2080 | } 2081 | layer { 2082 | bottom: "inception_4d/3x3_reduce/bn" 2083 | top: "inception_4d/3x3_reduce/bn/sc" 2084 | name: "inception_4d/3x3_reduce/bn/sc" 2085 | type: "Scale" 2086 | scale_param { 2087 | bias_term: true 2088 | } 2089 | } 2090 | layer { 2091 | bottom: "inception_4d/3x3_reduce/bn/sc" 2092 | top: "inception_4d/3x3_reduce/bn/sc" 2093 | name: "inception_4d/3x3_reduce/bn/sc/relu" 2094 | type: "ReLU" 2095 | } 2096 | layer { 2097 | bottom: "inception_4d/3x3_reduce/bn/sc" 2098 | top: "inception_4d/3x3" 2099 | name: "inception_4d/3x3" 2100 | type: "Convolution" 2101 | param { 2102 | lr_mult: 1 2103 | decay_mult: 1 2104 | } 2105 | convolution_param { 2106 | num_output: 192 2107 | pad: 1 2108 | kernel_size: 3 2109 | stride: 1 2110 | weight_filler { 2111 | type: "xavier" 2112 | } 2113 | bias_term: false 2114 | } 2115 | } 2116 | layer { 2117 | bottom: "inception_4d/3x3" 2118 | name: "inception_4d/3x3/bn" 2119 | top: "inception_4d/3x3/bn" 2120 | type: "BatchNorm" 2121 | } 2122 | layer { 2123 | bottom: "inception_4d/3x3/bn" 2124 | top: "inception_4d/3x3/bn/sc" 2125 | name: "inception_4d/3x3/bn/sc" 2126 | type: "Scale" 2127 | scale_param { 2128 | bias_term: true 2129 | } 2130 | } 2131 | layer { 2132 | bottom: "inception_4d/3x3/bn/sc" 2133 | top: "inception_4d/3x3/bn/sc" 2134 | name: "inception_4d/3x3/bn/sc/relu" 2135 | type: "ReLU" 2136 | } 2137 | layer { 2138 | bottom: "inception_4c/output" 2139 | top: "inception_4d/double3x3_reduce" 2140 | name: "inception_4d/double3x3_reduce" 2141 | type: "Convolution" 2142 | param { 2143 | lr_mult: 1 2144 | decay_mult: 1 2145 | } 2146 | convolution_param { 2147 | num_output: 160 2148 | pad: 0 2149 | kernel_size: 1 2150 | stride: 1 2151 | weight_filler { 2152 | type: "xavier" 2153 | } 2154 | bias_term: false 2155 | } 2156 | } 2157 | layer { 2158 | bottom: "inception_4d/double3x3_reduce" 2159 | name: "inception_4d/double3x3_reduce/bn" 2160 | top: "inception_4d/double3x3_reduce/bn" 2161 | type: "BatchNorm" 2162 | } 2163 | layer { 2164 | bottom: "inception_4d/double3x3_reduce/bn" 2165 | top: "inception_4d/double3x3_reduce/bn/sc" 2166 | name: "inception_4d/double3x3_reduce/bn/sc" 2167 | type: "Scale" 2168 | scale_param { 2169 | bias_term: true 2170 | } 2171 | } 2172 | layer { 2173 | bottom: "inception_4d/double3x3_reduce/bn/sc" 2174 | top: "inception_4d/double3x3_reduce/bn/sc" 2175 | name: "inception_4d/double3x3_reduce/bn/sc/relu" 2176 | type: "ReLU" 2177 | } 2178 | layer { 2179 | bottom: "inception_4d/double3x3_reduce/bn/sc" 2180 | top: "inception_4d/double3x3a" 2181 | name: "inception_4d/double3x3a" 2182 | type: "Convolution" 2183 | param { 2184 | lr_mult: 1 2185 | decay_mult: 1 2186 | } 2187 | convolution_param { 2188 | num_output: 192 2189 | pad: 1 2190 | kernel_size: 3 2191 | stride: 1 2192 | weight_filler { 2193 | type: "xavier" 2194 | } 2195 | bias_term: false 2196 | } 2197 | } 2198 | layer { 2199 | bottom: "inception_4d/double3x3a" 2200 | name: "inception_4d/double3x3a/bn" 2201 | top: "inception_4d/double3x3a/bn" 2202 | type: "BatchNorm" 2203 | } 2204 | layer { 2205 | bottom: "inception_4d/double3x3a/bn" 2206 | top: "inception_4d/double3x3a/bn/sc" 2207 | name: "inception_4d/double3x3a/bn/sc" 2208 | type: "Scale" 2209 | scale_param { 2210 | bias_term: true 2211 | } 2212 | } 2213 | layer { 2214 | bottom: "inception_4d/double3x3a/bn/sc" 2215 | top: "inception_4d/double3x3a/bn/sc" 2216 | name: "inception_4d/double3x3a/bn/sc/relu" 2217 | type: "ReLU" 2218 | } 2219 | layer { 2220 | bottom: "inception_4d/double3x3a/bn/sc" 2221 | top: "inception_4d/double3x3b" 2222 | name: "inception_4d/double3x3b" 2223 | type: "Convolution" 2224 | param { 2225 | lr_mult: 1 2226 | decay_mult: 1 2227 | } 2228 | convolution_param { 2229 | num_output: 192 2230 | pad: 1 2231 | kernel_size: 3 2232 | stride: 1 2233 | weight_filler { 2234 | type: "xavier" 2235 | } 2236 | bias_term: false 2237 | } 2238 | } 2239 | layer { 2240 | bottom: "inception_4d/double3x3b" 2241 | name: "inception_4d/double3x3b/bn" 2242 | top: "inception_4d/double3x3b/bn" 2243 | type: "BatchNorm" 2244 | } 2245 | layer { 2246 | bottom: "inception_4d/double3x3b/bn" 2247 | top: "inception_4d/double3x3b/bn/sc" 2248 | name: "inception_4d/double3x3b/bn/sc" 2249 | type: "Scale" 2250 | scale_param { 2251 | bias_term: true 2252 | } 2253 | } 2254 | layer { 2255 | bottom: "inception_4d/double3x3b/bn/sc" 2256 | top: "inception_4d/double3x3b/bn/sc" 2257 | name: "inception_4d/double3x3b/bn/sc/relu" 2258 | type: "ReLU" 2259 | } 2260 | layer { 2261 | bottom: "inception_4c/output" 2262 | top: "inception_4d/pool" 2263 | name: "inception_4d/pool" 2264 | type: "Pooling" 2265 | pooling_param { 2266 | pool: AVE 2267 | kernel_size: 3 2268 | stride: 1 2269 | pad: 1 2270 | } 2271 | } 2272 | layer { 2273 | bottom: "inception_4d/pool" 2274 | top: "inception_4d/pool_proj" 2275 | name: "inception_4d/pool_proj" 2276 | type: "Convolution" 2277 | param { 2278 | lr_mult: 1 2279 | decay_mult: 1 2280 | } 2281 | convolution_param { 2282 | num_output: 96 2283 | pad: 0 2284 | kernel_size: 1 2285 | stride: 1 2286 | weight_filler { 2287 | type: "xavier" 2288 | } 2289 | bias_term: false 2290 | } 2291 | } 2292 | layer { 2293 | bottom: "inception_4d/pool_proj" 2294 | name: "inception_4d/pool_proj/bn" 2295 | top: "inception_4d/pool_proj/bn" 2296 | type: "BatchNorm" 2297 | } 2298 | layer { 2299 | bottom: "inception_4d/pool_proj/bn" 2300 | top: "inception_4d/pool_proj/bn/sc" 2301 | name: "inception_4d/pool_proj/bn/sc" 2302 | type: "Scale" 2303 | scale_param { 2304 | bias_term: true 2305 | } 2306 | } 2307 | layer { 2308 | bottom: "inception_4d/pool_proj/bn/sc" 2309 | top: "inception_4d/pool_proj/bn/sc" 2310 | name: "inception_4d/pool_proj/bn/sc/relu" 2311 | type: "ReLU" 2312 | } 2313 | layer { 2314 | bottom: "inception_4d/1x1/bn/sc" 2315 | bottom: "inception_4d/3x3/bn/sc" 2316 | bottom: "inception_4d/double3x3b/bn/sc" 2317 | bottom: "inception_4d/pool_proj/bn/sc" 2318 | top: "inception_4d/output" 2319 | name: "inception_4d/output" 2320 | type: "Concat" 2321 | } 2322 | layer { 2323 | bottom: "inception_4d/output" 2324 | top: "inception_4e/3x3_reduce" 2325 | name: "inception_4e/3x3_reduce" 2326 | type: "Convolution" 2327 | param { 2328 | lr_mult: 1 2329 | decay_mult: 1 2330 | } 2331 | convolution_param { 2332 | num_output: 128 2333 | pad: 0 2334 | kernel_size: 1 2335 | stride: 1 2336 | weight_filler { 2337 | type: "xavier" 2338 | } 2339 | bias_term: false 2340 | } 2341 | } 2342 | layer { 2343 | bottom: "inception_4e/3x3_reduce" 2344 | name: "inception_4e/3x3_reduce/bn" 2345 | top: "inception_4e/3x3_reduce/bn" 2346 | type: "BatchNorm" 2347 | } 2348 | layer { 2349 | bottom: "inception_4e/3x3_reduce/bn" 2350 | top: "inception_4e/3x3_reduce/bn/sc" 2351 | name: "inception_4e/3x3_reduce/bn/sc" 2352 | type: "Scale" 2353 | scale_param { 2354 | bias_term: true 2355 | } 2356 | } 2357 | layer { 2358 | bottom: "inception_4e/3x3_reduce/bn/sc" 2359 | top: "inception_4e/3x3_reduce/bn/sc" 2360 | name: "inception_4e/3x3_reduce/bn/sc/relu" 2361 | type: "ReLU" 2362 | } 2363 | layer { 2364 | bottom: "inception_4e/3x3_reduce/bn/sc" 2365 | top: "inception_4e/3x3" 2366 | name: "inception_4e/3x3" 2367 | type: "Convolution" 2368 | param { 2369 | lr_mult: 1 2370 | decay_mult: 1 2371 | } 2372 | convolution_param { 2373 | num_output: 192 2374 | pad: 1 2375 | kernel_size: 3 2376 | stride: 2 2377 | weight_filler { 2378 | type: "xavier" 2379 | } 2380 | bias_term: false 2381 | } 2382 | } 2383 | layer { 2384 | bottom: "inception_4e/3x3" 2385 | name: "inception_4e/3x3/bn" 2386 | top: "inception_4e/3x3/bn" 2387 | type: "BatchNorm" 2388 | } 2389 | layer { 2390 | bottom: "inception_4e/3x3/bn" 2391 | top: "inception_4e/3x3/bn/sc" 2392 | name: "inception_4e/3x3/bn/sc" 2393 | type: "Scale" 2394 | scale_param { 2395 | bias_term: true 2396 | } 2397 | } 2398 | layer { 2399 | bottom: "inception_4e/3x3/bn/sc" 2400 | top: "inception_4e/3x3/bn/sc" 2401 | name: "inception_4e/3x3/bn/sc/relu" 2402 | type: "ReLU" 2403 | } 2404 | layer { 2405 | bottom: "inception_4d/output" 2406 | top: "inception_4e/double3x3_reduce" 2407 | name: "inception_4e/double3x3_reduce" 2408 | type: "Convolution" 2409 | param { 2410 | lr_mult: 1 2411 | decay_mult: 1 2412 | } 2413 | convolution_param { 2414 | num_output: 192 2415 | pad: 0 2416 | kernel_size: 1 2417 | stride: 1 2418 | weight_filler { 2419 | type: "xavier" 2420 | } 2421 | bias_term: false 2422 | } 2423 | } 2424 | layer { 2425 | bottom: "inception_4e/double3x3_reduce" 2426 | name: "inception_4e/double3x3_reduce/bn" 2427 | top: "inception_4e/double3x3_reduce/bn" 2428 | type: "BatchNorm" 2429 | } 2430 | layer { 2431 | bottom: "inception_4e/double3x3_reduce/bn" 2432 | top: "inception_4e/double3x3_reduce/bn/sc" 2433 | name: "inception_4e/double3x3_reduce/bn/sc" 2434 | type: "Scale" 2435 | scale_param { 2436 | bias_term: true 2437 | } 2438 | } 2439 | layer { 2440 | bottom: "inception_4e/double3x3_reduce/bn/sc" 2441 | top: "inception_4e/double3x3_reduce/bn/sc" 2442 | name: "inception_4e/double3x3_reduce/bn/sc/relu" 2443 | type: "ReLU" 2444 | } 2445 | layer { 2446 | bottom: "inception_4e/double3x3_reduce/bn/sc" 2447 | top: "inception_4e/double3x3a" 2448 | name: "inception_4e/double3x3a" 2449 | type: "Convolution" 2450 | param { 2451 | lr_mult: 1 2452 | decay_mult: 1 2453 | } 2454 | convolution_param { 2455 | num_output: 256 2456 | pad: 1 2457 | kernel_size: 3 2458 | stride: 1 2459 | weight_filler { 2460 | type: "xavier" 2461 | } 2462 | bias_term: false 2463 | } 2464 | } 2465 | layer { 2466 | bottom: "inception_4e/double3x3a" 2467 | name: "inception_4e/double3x3a/bn" 2468 | top: "inception_4e/double3x3a/bn" 2469 | type: "BatchNorm" 2470 | } 2471 | layer { 2472 | bottom: "inception_4e/double3x3a/bn" 2473 | top: "inception_4e/double3x3a/bn/sc" 2474 | name: "inception_4e/double3x3a/bn/sc" 2475 | type: "Scale" 2476 | scale_param { 2477 | bias_term: true 2478 | } 2479 | } 2480 | layer { 2481 | bottom: "inception_4e/double3x3a/bn/sc" 2482 | top: "inception_4e/double3x3a/bn/sc" 2483 | name: "inception_4e/double3x3a/bn/sc/relu" 2484 | type: "ReLU" 2485 | } 2486 | layer { 2487 | bottom: "inception_4e/double3x3a/bn/sc" 2488 | top: "inception_4e/double3x3b" 2489 | name: "inception_4e/double3x3b" 2490 | type: "Convolution" 2491 | param { 2492 | lr_mult: 1 2493 | decay_mult: 1 2494 | } 2495 | convolution_param { 2496 | num_output: 256 2497 | pad: 1 2498 | kernel_size: 3 2499 | stride: 2 2500 | weight_filler { 2501 | type: "xavier" 2502 | } 2503 | bias_term: false 2504 | } 2505 | } 2506 | layer { 2507 | bottom: "inception_4e/double3x3b" 2508 | name: "inception_4e/double3x3b/bn" 2509 | top: "inception_4e/double3x3b/bn" 2510 | type: "BatchNorm" 2511 | } 2512 | layer { 2513 | bottom: "inception_4e/double3x3b/bn" 2514 | top: "inception_4e/double3x3b/bn/sc" 2515 | name: "inception_4e/double3x3b/bn/sc" 2516 | type: "Scale" 2517 | scale_param { 2518 | bias_term: true 2519 | } 2520 | } 2521 | layer { 2522 | bottom: "inception_4e/double3x3b/bn/sc" 2523 | top: "inception_4e/double3x3b/bn/sc" 2524 | name: "inception_4e/double3x3b/bn/sc/relu" 2525 | type: "ReLU" 2526 | } 2527 | layer { 2528 | bottom: "inception_4d/output" 2529 | top: "inception_4e/pool" 2530 | name: "inception_4e/pool" 2531 | type: "Pooling" 2532 | pooling_param { 2533 | pool: MAX 2534 | kernel_size: 3 2535 | stride: 2 2536 | } 2537 | } 2538 | layer { 2539 | bottom: "inception_4e/3x3/bn/sc" 2540 | bottom: "inception_4e/double3x3b/bn/sc" 2541 | bottom: "inception_4e/pool" 2542 | top: "inception_4e/output" 2543 | name: "inception_4e/output" 2544 | type: "Concat" 2545 | } 2546 | layer { 2547 | bottom: "inception_4e/output" 2548 | top: "pool4/5x5_s3" 2549 | name: "pool4/5x5_s3" 2550 | type: "Pooling" 2551 | pooling_param { 2552 | pool: AVE 2553 | kernel_size: 5 2554 | stride: 3 2555 | } 2556 | } 2557 | layer { 2558 | bottom: "pool4/5x5_s3" 2559 | top: "loss2/conv" 2560 | name: "loss2/conv" 2561 | type: "Convolution" 2562 | param { 2563 | lr_mult: 1 2564 | decay_mult: 1 2565 | } 2566 | convolution_param { 2567 | num_output: 128 2568 | pad: 0 2569 | kernel_size: 1 2570 | stride: 1 2571 | weight_filler { 2572 | type: "xavier" 2573 | } 2574 | bias_term: false 2575 | } 2576 | } 2577 | layer { 2578 | bottom: "loss2/conv" 2579 | name: "loss2/conv/bn" 2580 | top: "loss2/conv/bn" 2581 | type: "BatchNorm" 2582 | } 2583 | layer { 2584 | bottom: "loss2/conv/bn" 2585 | top: "loss2/conv/bn/sc" 2586 | name: "loss2/conv/bn/sc" 2587 | type: "Scale" 2588 | scale_param { 2589 | bias_term: true 2590 | } 2591 | } 2592 | layer { 2593 | bottom: "loss2/conv/bn/sc" 2594 | top: "loss2/conv/bn/sc" 2595 | name: "loss2/conv/bn/sc/relu" 2596 | type: "ReLU" 2597 | } 2598 | layer { 2599 | bottom: "loss2/conv/bn/sc" 2600 | top: "loss2/fc" 2601 | name: "loss2/fc" 2602 | type: "InnerProduct" 2603 | param { 2604 | lr_mult: 1 2605 | decay_mult: 1 2606 | } 2607 | inner_product_param { 2608 | num_output: 1024 2609 | weight_filler { 2610 | type: "xavier" 2611 | } 2612 | bias_term: false 2613 | } 2614 | } 2615 | layer { 2616 | bottom: "loss2/fc" 2617 | name: "loss2/fc/bn" 2618 | top: "loss2/fc/bn" 2619 | type: "BatchNorm" 2620 | } 2621 | layer { 2622 | bottom: "loss2/fc/bn" 2623 | top: "loss2/fc/bn/sc" 2624 | name: "loss2/fc/bn/sc" 2625 | type: "Scale" 2626 | scale_param { 2627 | bias_term: true 2628 | } 2629 | } 2630 | layer { 2631 | bottom: "loss2/fc/bn/sc" 2632 | top: "loss2/fc/bn/sc" 2633 | name: "loss2/fc/bn/sc/relu" 2634 | type: "ReLU" 2635 | } 2636 | 2637 | 2638 | layer { 2639 | bottom: "inception_4e/output" 2640 | top: "inception_5a/1x1" 2641 | name: "inception_5a/1x1" 2642 | type: "Convolution" 2643 | param { 2644 | lr_mult: 1 2645 | decay_mult: 1 2646 | } 2647 | convolution_param { 2648 | num_output: 352 2649 | pad: 0 2650 | kernel_size: 1 2651 | stride: 1 2652 | weight_filler { 2653 | type: "xavier" 2654 | } 2655 | bias_term: false 2656 | } 2657 | } 2658 | layer { 2659 | bottom: "inception_5a/1x1" 2660 | name: "inception_5a/1x1/bn" 2661 | top: "inception_5a/1x1/bn" 2662 | type: "BatchNorm" 2663 | } 2664 | layer { 2665 | bottom: "inception_5a/1x1/bn" 2666 | top: "inception_5a/1x1/bn/sc" 2667 | name: "inception_5a/1x1/bn/sc" 2668 | type: "Scale" 2669 | scale_param { 2670 | bias_term: true 2671 | } 2672 | } 2673 | layer { 2674 | bottom: "inception_5a/1x1/bn/sc" 2675 | top: "inception_5a/1x1/bn/sc" 2676 | name: "inception_5a/1x1/bn/sc/relu" 2677 | type: "ReLU" 2678 | } 2679 | layer { 2680 | bottom: "inception_4e/output" 2681 | top: "inception_5a/3x3_reduce" 2682 | name: "inception_5a/3x3_reduce" 2683 | type: "Convolution" 2684 | param { 2685 | lr_mult: 1 2686 | decay_mult: 1 2687 | } 2688 | convolution_param { 2689 | num_output: 192 2690 | pad: 0 2691 | kernel_size: 1 2692 | stride: 1 2693 | weight_filler { 2694 | type: "xavier" 2695 | } 2696 | bias_term: false 2697 | } 2698 | } 2699 | layer { 2700 | bottom: "inception_5a/3x3_reduce" 2701 | name: "inception_5a/3x3_reduce/bn" 2702 | top: "inception_5a/3x3_reduce/bn" 2703 | type: "BatchNorm" 2704 | } 2705 | layer { 2706 | bottom: "inception_5a/3x3_reduce/bn" 2707 | top: "inception_5a/3x3_reduce/bn/sc" 2708 | name: "inception_5a/3x3_reduce/bn/sc" 2709 | type: "Scale" 2710 | scale_param { 2711 | bias_term: true 2712 | } 2713 | } 2714 | layer { 2715 | bottom: "inception_5a/3x3_reduce/bn/sc" 2716 | top: "inception_5a/3x3_reduce/bn/sc" 2717 | name: "inception_5a/3x3_reduce/bn/sc/relu" 2718 | type: "ReLU" 2719 | } 2720 | layer { 2721 | bottom: "inception_5a/3x3_reduce/bn/sc" 2722 | top: "inception_5a/3x3" 2723 | name: "inception_5a/3x3" 2724 | type: "Convolution" 2725 | param { 2726 | lr_mult: 1 2727 | decay_mult: 1 2728 | } 2729 | convolution_param { 2730 | num_output: 320 2731 | pad: 1 2732 | kernel_size: 3 2733 | stride: 1 2734 | weight_filler { 2735 | type: "xavier" 2736 | } 2737 | bias_term: false 2738 | } 2739 | } 2740 | layer { 2741 | bottom: "inception_5a/3x3" 2742 | name: "inception_5a/3x3/bn" 2743 | top: "inception_5a/3x3/bn" 2744 | type: "BatchNorm" 2745 | } 2746 | layer { 2747 | bottom: "inception_5a/3x3/bn" 2748 | top: "inception_5a/3x3/bn/sc" 2749 | name: "inception_5a/3x3/bn/sc" 2750 | type: "Scale" 2751 | scale_param { 2752 | bias_term: true 2753 | } 2754 | } 2755 | layer { 2756 | bottom: "inception_5a/3x3/bn/sc" 2757 | top: "inception_5a/3x3/bn/sc" 2758 | name: "inception_5a/3x3/bn/sc/relu" 2759 | type: "ReLU" 2760 | } 2761 | layer { 2762 | bottom: "inception_4e/output" 2763 | top: "inception_5a/double3x3_reduce" 2764 | name: "inception_5a/double3x3_reduce" 2765 | type: "Convolution" 2766 | param { 2767 | lr_mult: 1 2768 | decay_mult: 1 2769 | } 2770 | convolution_param { 2771 | num_output: 160 2772 | pad: 0 2773 | kernel_size: 1 2774 | stride: 1 2775 | weight_filler { 2776 | type: "xavier" 2777 | } 2778 | bias_term: false 2779 | } 2780 | } 2781 | layer { 2782 | bottom: "inception_5a/double3x3_reduce" 2783 | name: "inception_5a/double3x3_reduce/bn" 2784 | top: "inception_5a/double3x3_reduce/bn" 2785 | type: "BatchNorm" 2786 | } 2787 | layer { 2788 | bottom: "inception_5a/double3x3_reduce/bn" 2789 | top: "inception_5a/double3x3_reduce/bn/sc" 2790 | name: "inception_5a/double3x3_reduce/bn/sc" 2791 | type: "Scale" 2792 | scale_param { 2793 | bias_term: true 2794 | } 2795 | } 2796 | layer { 2797 | bottom: "inception_5a/double3x3_reduce/bn/sc" 2798 | top: "inception_5a/double3x3_reduce/bn/sc" 2799 | name: "inception_5a/double3x3_reduce/bn/sc/relu" 2800 | type: "ReLU" 2801 | } 2802 | layer { 2803 | bottom: "inception_5a/double3x3_reduce/bn/sc" 2804 | top: "inception_5a/double3x3a" 2805 | name: "inception_5a/double3x3a" 2806 | type: "Convolution" 2807 | param { 2808 | lr_mult: 1 2809 | decay_mult: 1 2810 | } 2811 | convolution_param { 2812 | num_output: 224 2813 | pad: 1 2814 | kernel_size: 3 2815 | stride: 1 2816 | weight_filler { 2817 | type: "xavier" 2818 | } 2819 | bias_term: false 2820 | } 2821 | } 2822 | layer { 2823 | bottom: "inception_5a/double3x3a" 2824 | name: "inception_5a/double3x3a/bn" 2825 | top: "inception_5a/double3x3a/bn" 2826 | type: "BatchNorm" 2827 | } 2828 | layer { 2829 | bottom: "inception_5a/double3x3a/bn" 2830 | top: "inception_5a/double3x3a/bn/sc" 2831 | name: "inception_5a/double3x3a/bn/sc" 2832 | type: "Scale" 2833 | scale_param { 2834 | bias_term: true 2835 | } 2836 | } 2837 | layer { 2838 | bottom: "inception_5a/double3x3a/bn/sc" 2839 | top: "inception_5a/double3x3a/bn/sc" 2840 | name: "inception_5a/double3x3a/bn/sc/relu" 2841 | type: "ReLU" 2842 | } 2843 | layer { 2844 | bottom: "inception_5a/double3x3a/bn/sc" 2845 | top: "inception_5a/double3x3b" 2846 | name: "inception_5a/double3x3b" 2847 | type: "Convolution" 2848 | param { 2849 | lr_mult: 1 2850 | decay_mult: 1 2851 | } 2852 | convolution_param { 2853 | num_output: 224 2854 | pad: 1 2855 | kernel_size: 3 2856 | stride: 1 2857 | weight_filler { 2858 | type: "xavier" 2859 | } 2860 | bias_term: false 2861 | } 2862 | } 2863 | layer { 2864 | bottom: "inception_5a/double3x3b" 2865 | name: "inception_5a/double3x3b/bn" 2866 | top: "inception_5a/double3x3b/bn" 2867 | type: "BatchNorm" 2868 | } 2869 | layer { 2870 | bottom: "inception_5a/double3x3b/bn" 2871 | top: "inception_5a/double3x3b/bn/sc" 2872 | name: "inception_5a/double3x3b/bn/sc" 2873 | type: "Scale" 2874 | scale_param { 2875 | bias_term: true 2876 | } 2877 | } 2878 | layer { 2879 | bottom: "inception_5a/double3x3b/bn/sc" 2880 | top: "inception_5a/double3x3b/bn/sc" 2881 | name: "inception_5a/double3x3b/bn/sc/relu" 2882 | type: "ReLU" 2883 | } 2884 | layer { 2885 | bottom: "inception_4e/output" 2886 | top: "inception_5a/pool" 2887 | name: "inception_5a/pool" 2888 | type: "Pooling" 2889 | pooling_param { 2890 | pool: AVE 2891 | kernel_size: 3 2892 | stride: 1 2893 | pad: 1 2894 | } 2895 | } 2896 | layer { 2897 | bottom: "inception_5a/pool" 2898 | top: "inception_5a/pool_proj" 2899 | name: "inception_5a/pool_proj" 2900 | type: "Convolution" 2901 | param { 2902 | lr_mult: 1 2903 | decay_mult: 1 2904 | } 2905 | convolution_param { 2906 | num_output: 128 2907 | pad: 0 2908 | kernel_size: 1 2909 | stride: 1 2910 | weight_filler { 2911 | type: "xavier" 2912 | } 2913 | bias_term: false 2914 | } 2915 | } 2916 | layer { 2917 | bottom: "inception_5a/pool_proj" 2918 | name: "inception_5a/pool_proj/bn" 2919 | top: "inception_5a/pool_proj/bn" 2920 | type: "BatchNorm" 2921 | } 2922 | layer { 2923 | bottom: "inception_5a/pool_proj/bn" 2924 | top: "inception_5a/pool_proj/bn/sc" 2925 | name: "inception_5a/pool_proj/bn/sc" 2926 | type: "Scale" 2927 | scale_param { 2928 | bias_term: true 2929 | } 2930 | } 2931 | layer { 2932 | bottom: "inception_5a/pool_proj/bn/sc" 2933 | top: "inception_5a/pool_proj/bn/sc" 2934 | name: "inception_5a/pool_proj/bn/sc/relu" 2935 | type: "ReLU" 2936 | } 2937 | layer { 2938 | bottom: "inception_5a/1x1/bn/sc" 2939 | bottom: "inception_5a/3x3/bn/sc" 2940 | bottom: "inception_5a/double3x3b/bn/sc" 2941 | bottom: "inception_5a/pool_proj/bn/sc" 2942 | top: "inception_5a/output" 2943 | name: "inception_5a/output" 2944 | type: "Concat" 2945 | } 2946 | layer { 2947 | bottom: "inception_5a/output" 2948 | top: "inception_5b/1x1" 2949 | name: "inception_5b/1x1" 2950 | type: "Convolution" 2951 | param { 2952 | lr_mult: 1 2953 | decay_mult: 1 2954 | } 2955 | convolution_param { 2956 | num_output: 352 2957 | pad: 0 2958 | kernel_size: 1 2959 | stride: 1 2960 | weight_filler { 2961 | type: "xavier" 2962 | } 2963 | bias_term: false 2964 | } 2965 | } 2966 | layer { 2967 | bottom: "inception_5b/1x1" 2968 | name: "inception_5b/1x1/bn" 2969 | top: "inception_5b/1x1/bn" 2970 | type: "BatchNorm" 2971 | } 2972 | layer { 2973 | bottom: "inception_5b/1x1/bn" 2974 | top: "inception_5b/1x1/bn/sc" 2975 | name: "inception_5b/1x1/bn/sc" 2976 | type: "Scale" 2977 | scale_param { 2978 | bias_term: true 2979 | } 2980 | } 2981 | layer { 2982 | bottom: "inception_5b/1x1/bn/sc" 2983 | top: "inception_5b/1x1/bn/sc" 2984 | name: "inception_5b/1x1/bn/sc/relu" 2985 | type: "ReLU" 2986 | } 2987 | layer { 2988 | bottom: "inception_5a/output" 2989 | top: "inception_5b/3x3_reduce" 2990 | name: "inception_5b/3x3_reduce" 2991 | type: "Convolution" 2992 | param { 2993 | lr_mult: 1 2994 | decay_mult: 1 2995 | } 2996 | convolution_param { 2997 | num_output: 192 2998 | pad: 0 2999 | kernel_size: 1 3000 | stride: 1 3001 | weight_filler { 3002 | type: "xavier" 3003 | } 3004 | bias_term: false 3005 | } 3006 | } 3007 | layer { 3008 | bottom: "inception_5b/3x3_reduce" 3009 | name: "inception_5b/3x3_reduce/bn" 3010 | top: "inception_5b/3x3_reduce/bn" 3011 | type: "BatchNorm" 3012 | } 3013 | layer { 3014 | bottom: "inception_5b/3x3_reduce/bn" 3015 | top: "inception_5b/3x3_reduce/bn/sc" 3016 | name: "inception_5b/3x3_reduce/bn/sc" 3017 | type: "Scale" 3018 | scale_param { 3019 | bias_term: true 3020 | } 3021 | } 3022 | layer { 3023 | bottom: "inception_5b/3x3_reduce/bn/sc" 3024 | top: "inception_5b/3x3_reduce/bn/sc" 3025 | name: "inception_5b/3x3_reduce/bn/sc/relu" 3026 | type: "ReLU" 3027 | } 3028 | layer { 3029 | bottom: "inception_5b/3x3_reduce/bn/sc" 3030 | top: "inception_5b/3x3" 3031 | name: "inception_5b/3x3" 3032 | type: "Convolution" 3033 | param { 3034 | lr_mult: 1 3035 | decay_mult: 1 3036 | } 3037 | convolution_param { 3038 | num_output: 320 3039 | pad: 1 3040 | kernel_size: 3 3041 | stride: 1 3042 | weight_filler { 3043 | type: "xavier" 3044 | } 3045 | bias_term: false 3046 | } 3047 | } 3048 | layer { 3049 | bottom: "inception_5b/3x3" 3050 | name: "inception_5b/3x3/bn" 3051 | top: "inception_5b/3x3/bn" 3052 | type: "BatchNorm" 3053 | } 3054 | layer { 3055 | bottom: "inception_5b/3x3/bn" 3056 | top: "inception_5b/3x3/bn/sc" 3057 | name: "inception_5b/3x3/bn/sc" 3058 | type: "Scale" 3059 | scale_param { 3060 | bias_term: true 3061 | } 3062 | } 3063 | layer { 3064 | bottom: "inception_5b/3x3/bn/sc" 3065 | top: "inception_5b/3x3/bn/sc" 3066 | name: "inception_5b/3x3/bn/sc/relu" 3067 | type: "ReLU" 3068 | } 3069 | layer { 3070 | bottom: "inception_5a/output" 3071 | top: "inception_5b/double3x3_reduce" 3072 | name: "inception_5b/double3x3_reduce" 3073 | type: "Convolution" 3074 | param { 3075 | lr_mult: 1 3076 | decay_mult: 1 3077 | } 3078 | convolution_param { 3079 | num_output: 192 3080 | pad: 0 3081 | kernel_size: 1 3082 | stride: 1 3083 | weight_filler { 3084 | type: "xavier" 3085 | } 3086 | bias_term: false 3087 | } 3088 | } 3089 | layer { 3090 | bottom: "inception_5b/double3x3_reduce" 3091 | name: "inception_5b/double3x3_reduce/bn" 3092 | top: "inception_5b/double3x3_reduce/bn" 3093 | type: "BatchNorm" 3094 | } 3095 | layer { 3096 | bottom: "inception_5b/double3x3_reduce/bn" 3097 | top: "inception_5b/double3x3_reduce/bn/sc" 3098 | name: "inception_5b/double3x3_reduce/bn/sc" 3099 | type: "Scale" 3100 | scale_param { 3101 | bias_term: true 3102 | } 3103 | } 3104 | layer { 3105 | bottom: "inception_5b/double3x3_reduce/bn/sc" 3106 | top: "inception_5b/double3x3_reduce/bn/sc" 3107 | name: "inception_5b/double3x3_reduce/bn/sc/relu" 3108 | type: "ReLU" 3109 | } 3110 | layer { 3111 | bottom: "inception_5b/double3x3_reduce/bn/sc" 3112 | top: "inception_5b/double3x3a" 3113 | name: "inception_5b/double3x3a" 3114 | type: "Convolution" 3115 | param { 3116 | lr_mult: 1 3117 | decay_mult: 1 3118 | } 3119 | convolution_param { 3120 | num_output: 224 3121 | pad: 1 3122 | kernel_size: 3 3123 | stride: 1 3124 | weight_filler { 3125 | type: "xavier" 3126 | } 3127 | bias_term: false 3128 | } 3129 | } 3130 | layer { 3131 | bottom: "inception_5b/double3x3a" 3132 | name: "inception_5b/double3x3a/bn" 3133 | top: "inception_5b/double3x3a/bn" 3134 | type: "BatchNorm" 3135 | } 3136 | layer { 3137 | bottom: "inception_5b/double3x3a/bn" 3138 | top: "inception_5b/double3x3a/bn/sc" 3139 | name: "inception_5b/double3x3a/bn/sc" 3140 | type: "Scale" 3141 | scale_param { 3142 | bias_term: true 3143 | } 3144 | } 3145 | layer { 3146 | bottom: "inception_5b/double3x3a/bn/sc" 3147 | top: "inception_5b/double3x3a/bn/sc" 3148 | name: "inception_5b/double3x3a/bn/sc/relu" 3149 | type: "ReLU" 3150 | } 3151 | layer { 3152 | bottom: "inception_5b/double3x3a/bn/sc" 3153 | top: "inception_5b/double3x3b" 3154 | name: "inception_5b/double3x3b" 3155 | type: "Convolution" 3156 | param { 3157 | lr_mult: 1 3158 | decay_mult: 1 3159 | } 3160 | convolution_param { 3161 | num_output: 224 3162 | pad: 1 3163 | kernel_size: 3 3164 | stride: 1 3165 | weight_filler { 3166 | type: "xavier" 3167 | } 3168 | bias_term: false 3169 | } 3170 | } 3171 | layer { 3172 | bottom: "inception_5b/double3x3b" 3173 | name: "inception_5b/double3x3b/bn" 3174 | top: "inception_5b/double3x3b/bn" 3175 | type: "BatchNorm" 3176 | } 3177 | layer { 3178 | bottom: "inception_5b/double3x3b/bn" 3179 | top: "inception_5b/double3x3b/bn/sc" 3180 | name: "inception_5b/double3x3b/bn/sc" 3181 | type: "Scale" 3182 | scale_param { 3183 | bias_term: true 3184 | } 3185 | } 3186 | layer { 3187 | bottom: "inception_5b/double3x3b/bn/sc" 3188 | top: "inception_5b/double3x3b/bn/sc" 3189 | name: "inception_5b/double3x3b/bn/sc/relu" 3190 | type: "ReLU" 3191 | } 3192 | layer { 3193 | bottom: "inception_5a/output" 3194 | top: "inception_5b/pool" 3195 | name: "inception_5b/pool" 3196 | type: "Pooling" 3197 | pooling_param { 3198 | pool: MAX 3199 | kernel_size: 3 3200 | stride: 1 3201 | pad: 1 3202 | } 3203 | } 3204 | layer { 3205 | bottom: "inception_5b/pool" 3206 | top: "inception_5b/pool_proj" 3207 | name: "inception_5b/pool_proj" 3208 | type: "Convolution" 3209 | param { 3210 | lr_mult: 1 3211 | decay_mult: 1 3212 | } 3213 | convolution_param { 3214 | num_output: 128 3215 | pad: 0 3216 | kernel_size: 1 3217 | stride: 1 3218 | weight_filler { 3219 | type: "xavier" 3220 | } 3221 | bias_term: false 3222 | } 3223 | } 3224 | layer { 3225 | bottom: "inception_5b/pool_proj" 3226 | name: "inception_5b/pool_proj/bn" 3227 | top: "inception_5b/pool_proj/bn" 3228 | type: "BatchNorm" 3229 | } 3230 | layer { 3231 | bottom: "inception_5b/pool_proj/bn" 3232 | top: "inception_5b/pool_proj/bn/sc" 3233 | name: "inception_5b/pool_proj/bn/sc" 3234 | type: "Scale" 3235 | scale_param { 3236 | bias_term: true 3237 | } 3238 | } 3239 | layer { 3240 | bottom: "inception_5b/pool_proj/bn/sc" 3241 | top: "inception_5b/pool_proj/bn/sc" 3242 | name: "inception_5b/pool_proj/bn/sc/relu" 3243 | type: "ReLU" 3244 | } 3245 | layer { 3246 | bottom: "inception_5b/1x1/bn/sc" 3247 | bottom: "inception_5b/3x3/bn/sc" 3248 | bottom: "inception_5b/double3x3b/bn/sc" 3249 | bottom: "inception_5b/pool_proj/bn/sc" 3250 | top: "inception_5b/output" 3251 | name: "inception_5b/output" 3252 | type: "Concat" 3253 | } 3254 | layer { 3255 | bottom: "inception_5b/output" 3256 | top: "pool5/7x7_s1" 3257 | name: "pool5/7x7_s1" 3258 | type: "Pooling" 3259 | pooling_param { 3260 | pool: AVE 3261 | kernel_size: 7 3262 | stride: 1 3263 | } 3264 | } 3265 | --------------------------------------------------------------------------------