Metadata Representations for Queryable ML Model Zoos

Ziyu Li, Rihan Hai, Alessandro Bozzon, Asterios KatsifodimosarXiv 2022

Abstract

Machine learning (ML) practitioners and organizations are building model zoos of pre-trained models, containing metadata describing properties of the ML models and datasets that are useful for reporting, auditing, reproducibility, and interpretability purposes. The metadata is currently not standardized; its expressivity is limited; and there is no interoperable way to store and query it. Consequently, model search, reuse, comparison, and composition are hindered. In this paper, we advocate for standardized ML model metadata representation and management, proposing a toolkit to help practitioners manage and query that metadata.

Introduction: The Discovery Gap in Model Zoos

We are currently in the era of the "Model Zoo." Platforms like HuggingFace, TensorFlow Hub, and PyTorch Hub host thousands of pre-trained models. However, these repositories suffer from a significant "discovery gap." Currently, model metadata is either too coarse (limited to name and version) or designed solely for human consumption, such as "Model Cards."

If a developer needs a model trained on a specific subset of the COCO dataset, with no gender bias, that runs in under 50ms on a specific edge device, they must typically find candidates manually and perform their own benchmarks. There is no standardized way to programmatically query these repositories for complex, multi-dimensional requirements.

Methodology: A Structured Meta-Model

To address this, we propose a structured meta-model designed to make model zoos searchable like a database. This approach breaks metadata into four interconnected packages:

  1. Configuration: Details the model’s architecture, hyperparameters, and specific data transformation pipelines.
  2. Dataset: Includes specific data instances and versions, enabling better data provenance and auditing.
  3. Execution: Links model predictions to "Semantic Concepts" in a knowledge graph, allowing queries for specific capabilities (e.g., identifying a "wheel") even if they weren't explicit top-level classes.
  4. Evaluation: Stores performance metrics (accuracy, F1, etc.) tied specifically to the hardware used, recognizing that latency and throughput are hardware-dependent.
The proposed meta-model schema, organized into Configuration, Execution, Evaluation, and Dataset packages.

To support this, we developed a prototype toolkit that crawls existing model hubs, ingests their metadata into this structured format, and provides a Query API for practitioners.

Key Insights

  • Machine-Queryable Standards: Moving from human-readable Model Cards to a formal UML-based schema allows model selection to be treated as a database optimization problem.
  • Hardware-Aware Performance: By explicitly linking evaluation metrics to hardware profiles, we enable critical queries for MLOps and edge deployment.
  • Semantic Reasoning: Linking model outputs to a knowledge base allows the system to handle complex inference queries. For instance, a system can identify that a model detecting "tires" is relevant to a query for "vehicle parts."

Results: Demonstrating Query Capability

The primary contribution of this work is the formalization of metadata and the demonstration of its queryability. Our prototype successfully implemented a tool that crawls external zoos (HuggingFace, PyTorch Hub) and translates unstructured information into the queryable meta-model.

The system can answer complex queries that current hubs cannot support, ranging from dataset provenance to hardware suitability.

Examples of complex queries supported by the proposed metadata framework across different properties.

Limitations and Future Work

While the system provides powerful query capabilities, extracting metadata from existing unstructured model cards remains a challenge. Future work will focus on using Natural Language Processing (NLP) to automate the extraction of structured data from text-heavy descriptions. Additionally, industry-wide adoption of these standards is necessary for large-scale impact. We also aim to incorporate "dynamic" metadata to handle real-world performance decay and concept drift.

Summary updated

BibTeX
@misc{li2022metadata,
  author = {Ziyu Li and Rihan Hai and Alessandro Bozzon and Asterios Katsifodimos},
  title = {{Metadata Representations for Queryable ML Model Zoos}},
  year = {2022},
  eprint = {2207.09315},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2207.09315},
}
Figure