This project is an attempt to recreate the work done by Florent Perronnin: "Fisher Kernels on Visual Vocabularies for Image Categorization" by classifying a set of images with scenes that is available from Svetlana Lazebnik et al. in the SPM experiment. The main axis of this project consists of using Gaussian Mixture Models, the sufficient statistics of which are used to form a Dictionary for the features extracted by SIFT and the RGB planes of the data. With the Fisher kernel consisting of computing the gradient of the sufficient statistics and concatenating them in the form of a vector, the latter encodes the data into a vector representation that is normalized using an approximation of the diagonal of the Fisher Information Matrix. Finally, the vectors are feeded in a SVM classifier. With the metric of the project being Accuracy, it can be seen that Fisher Kernels manage to increase the descriptiveness thus yielding increased accuracy in the task of classification; proving to be a worthy successor of the SPM schematic.
Visualization of the density of four individual populations, as a part of an example
Visualization of the same four populations depicting their surface on the 3D space
2D Contour visualization of the assignment of points into four discrete clusters based on the results of the GMM. With red circles are marked the centers of the clusters
3D visualization of the surface of the density of the GMM with the corresponding points representing the centers of the clusters
- CalculateParamsNV.m: Calculates the parameters for the Gaussian Mixture Model (GMM).
- extractImageFeatures.m: Extracts image features from the dataset.
- FisherEncodingNV.m: Encodes features using Fisher encoding.
- GMM_NV.m: Implements the Gaussian Mixture Model (GMM) for the project.
- sEM.m: Implements the stochastic Expectation-Maximization algorithm.
- Final_project.m: Main script to run the project, including data loading, feature extraction, GMM parameter calculation, Fisher encoding, and classification.
- scene_categories/: Directory containing the dataset of scene categories.
To run this project:
- Ensure MATLAB is installed on your system.
- Clone this repository to your local machine.
- Place your dataset in the
scene_categories/
directory. - Open MATLAB and navigate to the cloned project directory.
- Run the
Final_project.m
script to start the image classification pipeline.
run('Final_project.m')
This code is for teaching/research purposes only.