Skip to content

hiroyuki-kasai/ClassifierToolbox

Repository files navigation

ClassifierToolbox : A Matlab toolbox for classifier.


Authors: Hiroyuki Kasai

Collaborator: Kohei Yoshikawa

Last page update: July 10, 2017

Latest library version: 1.0.3 (see Release notes for more info)

Introduction

This package provides various tools for classification, e.g., image classification, face recogntion, and related applicaitons.

List of algorithms


Folders and files

./                              - Top directory.
./README.md                     - This readme file.
./run_me_first.m                - The scipt that you need to run first.
./demo.m                        - Demonstration script to check and understand this package easily. 
|algorithm/                     - Algorithms for classifcations.
|auxiliary/                     - Some auxiliary tools for this project.
|demo_examples/                 - Some demonstration files.
|lib/                           - 3rd party tools.
|dataset/                       - Folder where datasets are stored.

First to do: configure path

Run run_me_first for path configurations.

%% First run the setup script
run_me_first; 

Second to do: download datasets and external libraries

Run download for downloading datasets and external libraries.

%% Run the downloading script
download; 
  • If your computer is behind a proxy server, please configure your Matlab setting. See this.

Usage example: ORL face dateset demo: 3 steps!

Now, just execute demo for demonstration of this package.

%% Execute the demonstration script
demo; 

The "demo.m" file contains below.

%% load data
load('./dataset/ORL_Face_img_cov.mat');

%% perform RCM k-NN classifier with 
% GRCM2 with eigenvalue-based distance
grcm_accuracy = rcm_knn_classifier(TrainSet, TestSet,'GRCM', '2', 'EV', 5);
% RCM4 with eigenvalue-based distance
rcm_accuracy = rcm_knn_classifier(TrainSet, TestSet, 'RCM', '4', 'EV', 5);

%% show recognition accuracy
fprintf('# GRCM2 Accuracy = %5.2f\n', grcm_accuracy);
fprintf('# RCM4 Accuracy = %5.2f\n', rcm_accuracy);

Let take a closer look at the code above bit by bit. The procedure has only 3 steps!

Step 1: Load data

First, we load datasets including train set and test set. This case uses a covariance dataset that is originally generated from ORL face dataset.

load('./dataset/ORL_Face_img_cov.mat');

Step 2: Perform solver

Now, you can perform optimization solvers, i.e., RCM-based kNN classifier, calling rcm_knn_classifier() function with appropriate paramters.

% GRCM2 with eigenvalue-based distance
grcm_accuracy = rcm_knn_classifier(TrainSet, TestSet, 'GRCM', '2', 'EV', 5);

% RCM4 with eigenvalue-based distance
rcm_accuracy = rcm_knn_classifier(TrainSet, TestSet, 'RCM', '4', 'EV', 5);

The first case performs the Gabor-wavelet-based region covariance matrix (CRCM) algorithm (type 4) with eigen-value based disctance followed by 5-NN classifier. The second cases peforms the standard region covariance matrix (RCM) algorithm (type 2) with the same setting as before. They return the final accuracy.

Step 3: Show recognition accuracy

Finally, the final recognition accuracis are shown.

fprintf('# GRCM2 Accuracy = %5.2f\n', grcm_accuracy);
fprintf('# RCM4 Accuracy = %5.2f\n', rcm_accuracy);

That's it!


License

  • This toobox is free, non-commercial and open source.
  • The code provided in this toobox should only be used for academic/research purposes.

Third party tools, libraries, and packages.


Problems or questions

If you have any problems or questions, please contact the author: Hiroyuki Kasai (email: kasai at is dot uec dot ac dot jp)


Release Notes

  • Version 1.0.3 (July 11, 2017)
    • Add and modify SDR-SLR etc.
  • Version 1.0.2 (July 07, 2017)
    • Add and modify RSR, SVM etc.
  • Version 1.0.1 (July 06, 2017)
    • Add and modify many items.
  • Version 1.0.0 (July 01, 2017)
    • Initial version.