Code for performing object recognition with the PC/BC-DIM algorithm.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
mwspratling 7c7daea1f5
1st release December 2016
2 months ago
ISMDIM_codebook_cars.mat 1st release December 2016 2 months ago
ISMDIM_codebook_carsScale.mat 1st release December 2016 2 months ago
LICENSE 1st release December 2016 2 months ago
README.md 1st release December 2016 2 months ago
best_subplot_rows_cols.m 1st release December 2016 2 months ago
calc_f1score.m 1st release December 2016 2 months ago
centroid.m 1st release December 2016 2 months ago
classify_images.m 1st release December 2016 2 months ago
convert_car_coordinates.m 1st release December 2016 2 months ago
convert_to_weights.m 1st release December 2016 2 months ago
cropimage.m 1st release December 2016 2 months ago
define_dictionary.m 1st release December 2016 2 months ago
dim_activation.m 1st release December 2016 2 months ago
dim_activation_conv_recurrent.m 1st release December 2016 2 months ago
dim_learn.m 1st release December 2016 2 months ago
distance_measure.m 1st release December 2016 2 months ago
extract_patch.m 1st release December 2016 2 months ago
extract_patches.m 1st release December 2016 2 months ago
figured.m 1st release December 2016 2 months ago
gauss2D.m 1st release December 2016 2 months ago
gauss3D.m 1st release December 2016 2 months ago
highest_integer_factors.m 1st release December 2016 2 months ago
imnorm.m 1st release December 2016 2 months ago
imsetsize.m 1st release December 2016 2 months ago
ismdim_matching.m 1st release December 2016 2 months ago
ismdim_training.m 1st release December 2016 2 months ago
ismdim_voting.m 1st release December 2016 2 months ago
isodd.m 1st release December 2016 2 months ago
iszero.m 1st release December 2016 2 months ago
load_classify_image_dataset.m 1st release December 2016 2 months ago
load_image_car.m 1st release December 2016 2 months ago
maxsubplot.m 1st release December 2016 2 months ago
normalise_dim_weights.m 1st release December 2016 2 months ago
odd.m 1st release December 2016 2 months ago
pad_to_make_odd.m 1st release December 2016 2 months ago
plot_RFPPI.m 1st release December 2016 2 months ago
plot_bounding_box.m 1st release December 2016 2 months ago
plot_codebook.m 1st release December 2016 2 months ago
plot_errors.m 1st release December 2016 2 months ago
plot_image.m 1st release December 2016 2 months ago
plot_misclassified.m 1st release December 2016 2 months ago
plot_precision_recall.m 1st release December 2016 2 months ago
plot_weights.m 1st release December 2016 2 months ago
postprocess_codebook.m 1st release December 2016 2 months ago
stats_ismdim_cars.m 1st release December 2016 2 months ago
stats_ismdim_carsScale.m 1st release December 2016 2 months ago
test_ismdim_cars.m 1st release December 2016 2 months ago
test_ismdim_carsScale.m 1st release December 2016 2 months ago
trimarray_symmetrically.m 1st release December 2016 2 months ago
weight_initialisation_random.m 1st release December 2016 2 months ago

README.md

This code implements the simulation results reported in:

M. W. Spratling (2017) A Hierarchical Predictive Coding Model of Object Recognition in Natural Images, Cognitive Computation, 9(2): 151-67.

Please cite this paper if this code is used in, or to motivate, any publications.


USAGE


This code was tested with MATLAB Version 9.0.0.341360 (R2016a) running on Ubuntu Linux version 16.04.

Simulations may run faster if you install the MATLAB function convnfft written by Bruno Luong, which is available here: http://www.mathworks.com/matlabcentral/fileexchange/24504-fft-based-convolution

The following MATLAB functions can be used to perfom the experiments described in the paper.

Fig. 2 can be reproduced using the command:

     classify_images('MNIST',4);
 Be warned this function requires about 25GB of free RAM to execute! If you
 don't have that much memory you can train a smaller network by using fewer
 training images, using the command: classify_images('MNISTXXXX',4); where
 XXXX=1000, 2000, 4000, or 5000. This number specifies the number of
 training images per class.

 To run this function you will need the MNIST dataset installed on your
 system, and you will need to edit the path in the file
 load_classify_image_dataset.m to point to the locations where this data is
 stored.

Fig. 3 can be reproduced using the command:

     classify_images('YALE1',1.25);
 To run this function you will need Extended Yale Face Database B installed
 on your system, and you will need to edit the path in the file
 load_classify_image_dataset.m to point to the locations where this data is
 stored.

Figs. 4 and 5 can be reproduced using the command:

     test_ismdim_cars(imageNum);
 where imageNum is the number of the image in the test set that is to be processed.

 The precision recall curve can then be generated by running:
     stats_ismdim_cars;
	 The previous two commands use the file ISMDIM_codebook_cars.mat which is
	 produced using the command:
		 ismdim_training('cars');
 To run this function you will need the UIUC cars dataset installed on your
 system, and you will need to edit the path in the file load_image_car.m to point
 to the locations where this data is stored.

Fig. 6 can be reproduced using the command:

     test_ismdim_carsScale(imageNum);
 where imageNum is the number of the image in the test set that is to be processed.

 The precision recall curve can then be generated by running:
     stats_ismdim_carsScale;
 The previous two commands use the file ISMDIM_codebook_carsScale.mat which
 is produced using the command:
     ismdim_training('carsScale');
 To run this function you will need the UIUC cars dataset installed on your
 system, and you will need to edit the path in the file load_image_car.m to point
 to the locations where this data is stored.