[PYTHON] I tried to implement PCANet

I implemented a neural network called PCANet.

PCANet Overview

As the name implies, PCANet is a type of CNN that calculates network weights by PCA (Principal Component Analysis).

advantage

PCANet has the following features.

Does not require a teacher label

PCANet regards the patch cut out from the image as a vector, and its main component is the weight of the network. In general CNN, learning is performed by back-propagating the difference between the target output and the network output throughout the network. On the other hand, PCANet does not require a teacher label because once an image is given, learning can be done simply by applying PCA.

Disadvantage

Since the model consists only of linear calculations and histogram calculations, it seems to be less expressive than a non-linear model. For example, Identification accuracy in CIFAR 10 has not reached 80%.

You may want to use PCANet when you say, "There is not enough calculation amount to do Deep Learning, but the accuracy is poor with HoG".

About implementation

There is something I don't understand in the paper

We then subtract patch mean from each patch

However, it is not known whether it is the average of the patches extracted from all the images in the dataset or the average of the patches extracted for each image. I think it's probably the latter because it can eliminate the difference in brightness between images.

I can't use mini-batch

Since PCA is basically batch processing, it is not possible to divide data into small batches and learn them like mini-batch. For this reason, memory will be insufficient when learning with very large data. As an implementation solution

Therefore, we will make improvements as necessary in the future.

Recommended Posts

I tried to implement PCANet
I tried to implement StarGAN (1)
I tried to implement Deep VQE
I tried to implement adversarial validation
I tried to implement hierarchical clustering
I tried to implement Realness GAN
I tried to implement PLSA in Python
I tried to implement Autoencoder with TensorFlow
I tried to implement permutation in Python
I tried to implement PLSA in Python 2
I tried to debug.
I tried to implement ADALINE in Python
I tried to implement PPO in Python
I tried to implement CVAE with PyTorch
I tried to paste
I tried to implement reading Dataset with PyTorch
I tried to implement TOPIC MODEL in Python
I tried to implement selection sort in python
I tried to implement the traveling salesman problem
I tried to learn PredNet
I tried to organize SVM.
I tried to reintroduce Linux
I tried to introduce Pylint
I tried to summarize SparseMatrix
I tried to touch jupyter
I tried to implement multivariate statistical process management (MSPC)
I tried to implement and learn DCGAN with PyTorch
I tried to implement Minesweeper on terminal with python
I tried to implement a pseudo pachislot in Python
I tried to implement a recommendation system (content-based filtering)
I tried to implement Dragon Quest poker in Python
I tried to implement an artificial perceptron with python
I tried to implement time series prediction with GBDT
I tried to implement GA (genetic algorithm) in Python
I tried to implement Grad-CAM with keras and tensorflow
I tried to implement SSD with PyTorch now (Dataset)
I tried to implement automatic proof of sequence calculation
I tried to touch Python (installation)
I tried to explain Pytorch dataset
I tried Watson Speech to Text
I tried to touch Tesla's API
I tried to organize about MCMC.
I tried to move the ball
I tried to estimate the interval.
I tried to implement a volume moving average with Quantx
I tried to implement a basic Recurrent Neural Network model
I tried to implement anomaly detection by sparse structure learning
I tried to implement a one-dimensional cellular automaton in Python
I tried to implement breakout (deception avoidance type) with Quantx
[Django] I tried to implement access control by class inheritance.
I tried to implement ListNet of rank learning with Chainer
I tried to implement the mail sending function in Python
I tried to implement Harry Potter sort hat with CNN
I tried to implement Perceptron Part 1 [Deep Learning from scratch]
I tried to implement blackjack of card game in Python
I tried to implement SSD with PyTorch now (model edition)
I tried to create a linebot (implementation)
I tried to summarize Python exception handling
I tried using Azure Speech to Text.
I tried to summarize the umask command
I tried to create a linebot (preparation)