Hi all.
I'm trying to solve a fine-grained classification problem using Caffe. My first attempt is to extract CNN features from fully connected layers and train a linear SVM on top of the extracted features. I'm using the Caffenet Reference implementation, initially.
Literature says that fc6 or fc7 should contain good features to datasets others than Imagenet, such as Caltech-UCSD Birds 200.
The only problem is that the trained SVM produces predictions with accuracy pretty randomic (~22% with 5 classes).
I strongly suspect there is some mistake in my approach or in the code. Please, does someone have an hint?
Here are the steps I'm following (code is Python)
from sklearn.preprocessing import normalize
from sklearn.svm import LinearSVC
## checked if the data layer in train_val.prototxt contains the right path
net = caffe.Net('train_val.prototxt', 'reference_pretrained_model.caffemodel', caffe.TEST)
## for all training and testing data
net.forward()
features = net.blobs['fc7'].data
##
train_data = normalize(train_features)
test_data = normalize(test_features)
svc = LinearSVC(C=1.0)
svc.fit(train_data, train_labels)
svc.predict(test_data)