Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 2.95 KB

20210817-firebase_ml_publisher_component.md

File metadata and controls

46 lines (34 loc) · 2.95 KB

SIG TFX-Addons

Project Proposal

Your name: Chansung Park

Your email: [email protected]

Your company/organization: Individual(ML GDE)

Project name: Firebase ML Publisher

Project Description

This project defines a custom TFX component to publish/update ML models to Firebase ML. This is another type of pusher component, and the input model is assumed to be a TFLite format.

Project Category

Component

Project Use-Case(s)

This project helps users to publish trained models directly to Firebase ML.

With Firebase ML, we can guarantee that mobile devices can be equipped with the latest ML model without explicitly embedding binary in the project compiling stage. We can even A/B test different versions of a model with Google Analytics when the model is published on Firebase ML.

Project Implementation

Firebase ML Publisher component will be implemented as Python function-based component. You can find the actual source code in my personal project. Please note this is a personal implementation, and it will be enhanced as a official TFX Addon component.

The implementation details

  • Define a custom Python function-based TFX component. It takes the following parameters from a previous component.
    • It should follow the standard Pusher's interface since this is another custom pusher.
    • Additionally, it takes meta information to manage published model for Firebase ML such as display name and tags.
  • Download saved TFLite model file by referencing the output from a previous component
    • Firebase SDK doesn't allow to publish models from GCS directly.
  • Initialize Firebase Admin with the credential and Firebase temporary-use GCS bucket.
  • Search if any models with the same display name has already been published.
    • if yes, update the existing Firebase ML mode, then publish it
    • if no, create a new Firebase ML model, then publish it
  • Return tfx.dsl.components.OutputDict to indicate if the job went successful, and if the job was about creating a new Firebase ML model or updating the exisitng Firebase ML model.

Project Dependencies

The implementation will use the following libraries.

Project Team

Project Leader : Chansung Park, deep-diver, [email protected]

  1. Sayak Paul, sayakpaul, [email protected]