I'm currently using the CIFAR-10 dataset, and I'm trying to run some dimensionality reduction algorithms on it. It's a bunch of 32x32 colour images, so I'm currently importing the data by putting each 32x32x3 image into one column, like so:
X = zeros(3072, num_data_points);
for i=1:num_data_points
filename = sprintf('train/%d.png', i)
X(:,i)=reshape(imread(filename), [], 1);
end
This gives me a data matrix of 3072x(number of images) where each column represents a different image. When I run dimensionality reduction techniques, such as PCA and KPCA, I get a terrible separation of the data. Is there a better way to import the data that would help me?