-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accuracy of Released Image Classification Models #59
Comments
Hi @ahkarami, thank you for your kind words. While I played my part, the dataset is a work of many people, and many thanks should also go to the Google management that funded the work and gave the permission to release that much internal knowledge. As for the accuracy of the most recently released models, I think @nalldrin has the most to say. After all, I left Google in May 2017, and no longer in the loop. |
Dear @rkrasin, |
@ahkarami after some thought, the answer to your question can be obtained in a dyi fashion:
I will do it myself on the weekend, unless someone gets the score published before that. |
So, as promised, I have started doing so, and realized that the images are not actually publicly released. The registration form at CVDF website has to be submitted before any pixels are released. I plan to document the steps required to get the access for the benefit of everyone else. The alternative way is to use Google Cloud Transfer Service. That will take about a week, so I will first try the CVDF hosted option. The first thing I did is to fill out the form as below:
|
Actually, I already have the email that says the request is approved:
Nice! |
And indeed, the access works:
Then I have copied the images on my Google Compute Engine instance. Not the most optimized chain of command-line commands, but here we are:
Note that test + validation sets are 50 GB in total. The next step is to run both classifiers (v1 and v2) on all images and produce two CSV files for later analysis. I will probably skip all further details until the scores are obtained. The critical step, getting the images, confirmed to be working. |
Hi, sorry for not noticing this thread sooner. A few points of clarification. First, we are providing the image classification checkpoints more as a courtesy than to serve as a competitive baseline model and we haven't provided any official guidance as to how to evaluate them. That said, internally we tracked the AP and mAP scores over the validation+test sets: .587 and .506 respectively for the v2 checkpoint. You should be able to approximately reproduce this by calculating it yourself over the test+val sets. |
For what it's worth, I downloaded the v2 checkpoint: #! /bin/bash
mkdir -p /tmp/open_image/checkpoint/
wget -nc -nv -O /tmp/open_image/checkpoint/oidv2-resnet_v1_101.ckpt.tar.gz\
https://storage.googleapis.com/openimages/2017_07/oidv2-resnet_v1_101.ckpt.tar.gz
cd /tmp/open_image/checkpoint
tar -xvf oidv2-resnet_v1_101.ckpt.tar.gz and simply ran these metrics on the predictions: from sklearn import metrics
metric_dict['micro_map'] = metrics.average_precision_score(labels.ravel(), scores.ravel())
average_precision = [metrics.average_precision_score(labels[:, i], scores[:, i]) for i in range(scores.shape[-1])]
average_precision = [np.nan_to_num(a) for a in average_precision]
metric_dict['macro_map'] = np.mean(average_precision) and I got losses and predictions with something like this: sess = tf.Session()
g = tf.get_default_graph()
with g.as_default():
saver = tf.train.import_meta_graph(checkpoint_path + '.meta')
saver.restore(sess, checkpoint_path)
input_values = g.get_tensor_by_name('input_values:0')
predictions = g.get_tensor_by_name('multi_predictions:0')
true_labels = tf.placeholder(
dtype=tf.float32, shape=[None, 5000], name='labels')
# using a TF Record generator here...
data = data_generator(_SPLITS_TO_PATHS[split], repeat=False, parser=parser)
stored_predictions = []
stored_labels = []
for idx, v in enumerate(data):
images = v['image']
labels = v['label']
preds = sess.run(predictions, feed_dict={
input_values: images,
true_labels: labels
})
stored_predictions.append(preds)
stored_labels.append(labels) I get AP of 0.423 and 0.424 on the validation and test sets respectively, and mAP of 0.088 and 0.0892. Would be good if someone else can confirm or validate these results/code? I was easily able to fine-tune the last layer of InceptionV3 and achieve mAP of 0.541 and 0.542 on validation/test and AP of 0.447 and 0.433. |
Dear @btaba, from sklearn.metrics import fbeta_score
beta = 1.0
fbeta_score(true_labels, predictions > threshold, beta, average='samples') |
@ahkarami I also computed F1 for a threshold of 0.5, but I think AP and mAP may be more useful since they don't depend on the threshold. Nevertheless, I get 0.423/0.424 on validation/test for micro F1 and 0.088/0.089 for macro F1 for the resnet checkpoint. For the fine-tuned Inception v3 I get 0.515/0.515 and 0.372/0.377 for micro and macro F1 respectively. |
Dear @btaba, |
Thanks for your test. Was "the fine-tuned Inception v3" trained on the validation dataset or train dataset? How many classes could it predict? I wonder why it could achieve much higher mAP than the released resnet101 model. Perhaps because many rare classes were missing in the val/test set and nan_to_num gave many zeros, which reduced the mean value significantly? But this cannot explain why your finetuned inception v3 was alright. |
Could you comment on why @btaba got a much smaller mAP? Used different mAP definition? Thanks. |
Just a note on the released checkpoint: it was trained primarily using the
machine generated labels (I used human verifications if available,
otherwise machine predictions). No fine-tuning on human verifications was
performed. So it's easy to see how the mAP and other metrics can be
massively improved by a little fine-tuning.
…-Neil
On Wed, Oct 10, 2018, 8:17 AM Mengye LYU ***@***.***> wrote:
Hi, sorry for not noticing this thread sooner. A few points of
clarification. First, we are providing the image classification checkpoints
more as a courtesy than to serve as a competitive baseline model and we
haven't provided any official guidance as to how to evaluate them. That
said, internally we tracked the AP and mAP scores over the validation+test
sets: .587 and .506 respectively for the v2 checkpoint. You should be able
to approximately reproduce this by calculating it yourself over the
test+val sets.
Could you comment on why @btaba <https://github.com/btaba> got a much
smaller mAP? Used different mAP definition? Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aa9xhSpSW5INUAlBQ4fdEQYfumR8QKqQks5ujg-UgaJpZM4Q3fKg>
.
|
I'm also doing training on the openimage v4 dataset with res50 for multi-label classification, but I got terrible results whose mAP is very low. |
Dear @MyYaYa, |
Dear @rkrasin,
Thank you for your fantastic Data Set. Would you please kindly inform us the accuracy (i.e., F1-Score) of your released models (i.e., ResNet 101 image classification model and Inception V3 model) on validation set?
The text was updated successfully, but these errors were encountered: