For convolution / cross-correlation, we use kernels.
Application of an mXm kernel normally takes m2 operation. If the kernel is separable, then it takes only 2m operations.
Hence, some kernels K, can be split into UVT.
For any given K, we can determine if we can split it into separable kernel by taking its SVD.
Let u,z,v = SVD(K)
K is separable, if, Z!= 0 and Z[!=0]=0
Then, U = √(Z) X u1 and V = √(Z) X v1T
See the Jupyter Notebook to see the implementation in python :
We are going to use a Resnet-50 Model trained on ImageNet dataset, as a feature extractor, for a set of input images. The extracted features will be used by a Linear SVM to predict whether any random input image, is in either one of two classes that it belongs.
Steps are enumerated here: http://josephkj.in/wp-content/uploads/2017/01/Classifier.html
Jupyter Notebook Download (NB: Unzip before uploading to Jupyter. The notebook ran successfully on macOS Sierra.)
Pre-req: MxNet, OpenCV, ScikitLearn
I recommend you have the latest Anaconda installed, build the MxNet binary and link it with python that came with Anaconda. That would be perfect.