{"action":"opened","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/1839","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/1839/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/1839/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/1839/events","html_url":"https://github.com/fchollet/keras/issues/1839","id":136910041,"number":1839,"title":"Increasing accuracy of multi-label image classification using Tensorflow inception's pool3 features","user":{"login":"eldor4do","id":5240449,"avatar_url":"https://avatars.githubusercontent.com/u/5240449?v=3","gravatar_id":"","url":"https://api.github.com/users/eldor4do","html_url":"https://github.com/eldor4do","followers_url":"https://api.github.com/users/eldor4do/followers","following_url":"https://api.github.com/users/eldor4do/following{/other_user}","gists_url":"https://api.github.com/users/eldor4do/gists{/gist_id}","starred_url":"https://api.github.com/users/eldor4do/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eldor4do/subscriptions","organizations_url":"https://api.github.com/users/eldor4do/orgs","repos_url":"https://api.github.com/users/eldor4do/repos","events_url":"https://api.github.com/users/eldor4do/events{/privacy}","received_events_url":"https://api.github.com/users/eldor4do/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-27T11:48:01Z","updated_at":"2016-02-27T11:48:01Z","closed_at":null,"body":"I want to do multi-label image classification. For this, I am currently getting the pool3 features for each of my images from tensorflow's inception model, and then using those to prepare my data set for classifying it into labels.\r\nCurrently, this is my code.\r\n`from sklearn.preprocessing import MultiLabelBinarizer\r\nfrom keras.models import Sequential\r\nfrom keras.layers.core import Dense\r\nimport pickle\r\nimport numpy as np\r\n\r\n    data = pickle.load(open('/data.p','rb'))  # contains pool3 feature vector\r\n    target = pickle.load(open('/target.p','rb'))  # contains multi label as text\r\n    data = np.array(data)\r\n    mlb = MultiLabelBinarizer()\r\n    mlbtarget = mlb.fit_transform(target)\r\n    # mlbtarget.shape is (1001, 238)\r\n    testdata = [data[2],data[3]]\r\n    testdata = np.array(testdata)\r\n    testtarget = [mlbtarget[2],mlbtarget[3]]\r\n\r\n    model = Sequential()\r\n\r\n    model.add(Dense(output_dim=2048, input_dim=2048, init='uniform', activation='tanh'))\r\n    model.add(Dense(output_dim=238, init='uniform', activation='sigmoid'))\r\n    model.compile(optimizer='adadelta', loss='binary_crossentropy')\r\n\r\n    model.fit(np.array(data), mlbtarget)\r\n    objective_score = model.evaluate(testdata, testtarget, batch_size=1)\r\n    print objective_score`  # currently objective_score is 0.0898\r\n\r\nIs this approach correct? What things should I be doing better?"}}