This project is inspired by the code snippets available from the ICCV of 2005. It implements a Bag of Features model for image classification in MATLAB. The model involves several steps including feature extraction, vector quantization, and classification using the intrinsic functions of MATLAB.
- Feature Extraction: Utilizes SIFT features to identify points of interest in images.
- Vector Quantization: Employs k-means clustering to quantize feature vectors.
- Classification: Uses a Support Vector Machine classifier with a grid search for the optimization of its parameters.
Bag_Of_Features.m
: The main script that orchestrates the model execution.BoW_final.mlx
: A MATLAB Live Script with detailed explanations and results.compute_descriptors.ln
,discrete_sampler.m
,vgg_*
: Various utility scripts for feature extraction and processing.Edge_Sampling_VN.m
: Scripts for edge sampling techniques.images/
: Directory containing image datasets for training and testing the model.
To run this project:
- Ensure MATLAB is installed on your system.
- Clone this repository to your local machine.
- Open MATLAB and navigate to the cloned project directory.
- Run the
Bag_Of_Features.m
script to start the image classification model. - During the
Bag_Of_Features.m
execution, select theimages/
folder to access the image data. - Select the folder where the
Edge_Sampling_VN.m
is located. - Let the script do its magic.
The produced data, meaning:
- The Codebook
- The Quantized vectors and
- The SIFT features of the interest points
Along with:
- The Interest points
- The Scale
- The Score and
- The x and y coordinates of the interest points
are located in the Workspace
file
This repository is a simple form of reproduction with quite a few changes compared to the initial files that are provided in the ICCV. In keeping with that theme, one can identify files, such as compute_descriptors.ln
, discrete_sampler.m
, vgg_*
, that belong in the initial draft of the contributors yet are important for the completion of this work. All acknowledgements for those files go to the authors!
Following the notion of the authors, this code is for teaching/research purposes only.