0

I am using Firebase Vision Image in one of my android apps. Whenever the android emulator takes a picture, Firebase Vision Image Labeler returns a list of labels for the bitmap that came from the camera's capture.

My problem is that the labels are barely close to accurate. For instance, if I take a picture of a face, it will return a 80% confidence label that says "dog". However, when I take a picture of a face and plug it in Google's Cloud Vision (which Firebase builds upon) Demo labeler on their website, it returns much more accurate responses.

Why are Firebase Vision responses/labels so much different from Google Cloud Vision responses/labels?

The pictures that I'm taking are on my laptop btw.

Ben Weiss
  • 17,182
  • 6
  • 67
  • 87
Mary X
  • 153
  • 2
  • 15

1 Answers1

1

The on-device label detection of Firebase ML Kit runs a lower resolution ML model than the Cloud Vision API does. As a result it can detect fewer labels, and may detect them with lower accuracy.

From the documentation on choosing between on-device and Cloud APIs:

Label coverage

On device: 400+ labels that cover the most commonly-found concepts in photos. See below.

Cloud: 10,000+ labels in many categories. See below.

If you want the highest accuracy in what the model detects, you should use Cloud Vision. But that does mean that the user will have to have an active internet connection, and that you'll be using the paid Cloud Vision API rather than the free on-device model.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Ahh ok, thanks for the clarification. I tried using Google Cloud Vision API before in my Android App and was advised to not do so and use Firebase ML Kit instead. You can see my previous issue [here](https://stackoverflow.com/questions/57407019/getting-the-application-default-credentials-are-not-available-error-in-android/57407577#57407577). I'm not sure which direction to take – Mary X May 09 '20 at 10:46
  • 1
    You can use Cloud Vision *though* ML Kit. See step 5 here: https://firebase.google.com/docs/ml-kit/android/recognize-text – Frank van Puffelen May 09 '20 at 13:36