Digital Image Processing
(Spring 2013)


Final Project    

Building Recognition in Xianlin Campus
    
    In our final project, you are required to develop a building recognition program which should return a label to a picture, using whatever you have learned/read in/after the course. 
    We collect pictures of 8 buildings in Xianlin campus, and provide some of them for you to build a classifier model. With this model you could predict any pictures. We keep the rest as test images to verify your program.
    The training images includes:

label
number of training images
Descritopn
0
43
北大楼
1
64
大活
2
43
杜厦图书馆
3
41
计算机系楼
4
48
食堂
5 47 体育馆
6 49 文学院楼
7 55 游泳馆

    You need to train a model from these training images, so for any other images, you can use your model to predict its label.                                                                          

    Requirement
          1. Complete the function  train_br.m.
          2Complete the function  predict_br.m.
          3. Build and save your model by runing your  train_br.m, the produced model file (model.mat) needs to be submitted.
          (All the materials can be found in Download section)

    Limitations
       1. Each invoking of  predict_br.m should take at most 20 seconds.
       2. Do not wirte any imshow/plot in your code
       3. Do not pack the dataset in your submission. All you can use in predict_br function is the model file and the test image.   

    Download
           1. Code.
           2. Training data (about 23MB).
            (The last line in train_br.m should be save('model.mat','model');, thanks Kai Tang for pointing this error out )

    Sepecification of submission
           1. Submission directory: ftp://lamda.nju.edu.cn/dip13/final
           2. The format: A zip file, which has the structure as: (--x means a directory named as x)
                    xxx.zip
                        --code:  train_br.m, predict_br.m, model.mat
                        --doc:  a pdf/doc file which describes the idea, method and implementation in your experiment. 
                Here we provide a sample submission file. (Your submitted file should be organised as the same structure as this file)
           3. Use your student number as the name of the submitted file, such as b111221001.zip. If you have multiple submissions, add an extra '_' with a number, such as b111221001_1.zip. We will use the the version with the largest number as your final submission.

    Tip
     We will test your code like this:
        ---------------------------------------------------------------
         % load test images
[images, labels] = load_test_data('xx/dataset_test/'); % this data is blind to you

% load your model
model =  load('model.mat');

% test your model on test data
num_test= length(labels);
num_correct = 0;
for i=1:num_test
if predict_br(model.model, images{i}) == labels(i)
    num_correct = num_correct + 1; 
end
end

% calculate your accuracy
accuracy = num_correct / num_test;
----------------------------------------------------------------