The journey of deploying machine learning models has evolved significantly over the past decade. In the early days of modern deep learning (circa 2012), researchers primarily used a single framework—often Caffe or later PyTorch—and deployed models on similar infrastructure where they were trained. This homogeneous environment simplified deployment but limited flexibility and collaboration.
As the AI ecosystem matured, several challenges emerged:
These challenges gave rise to the need for standardized model exchange formats and protocols—the focus of this book and the WIA-AI-008 standard.
Model exchange refers to the process of transferring machine learning models between different:
A comprehensive model exchange system encompasses several interconnected components:
| Component | Description | Example |
|---|---|---|
| Serialization | Saving model architecture and weights to disk | torch.save(), tf.saved_model.save() |
| Conversion | Translating between different formats | PyTorch → ONNX → TensorFlow Lite |
| Optimization | Reducing model size and improving performance | Quantization, pruning, distillation |
| Packaging | Bundling model with metadata and dependencies | Model cards, version info, schemas |
| Distribution | Sharing models via registries and protocols | Hugging Face Hub, TensorFlow Hub, MLflow |
| Serving | Deploying models for inference | TorchServe, TF Serving, Triton |
Understanding and implementing proper model exchange practices provides significant benefits across the ML lifecycle:
When researchers train a model in PyTorch but the production team uses TensorFlow, seamless conversion enables faster iteration and deployment. Teams can choose the best tool for each task without creating silos.
Different deployment targets have vastly different resource constraints. A model running on a datacenter GPU might have 100x more memory and compute than the same model on a smartphone. Model exchange enables optimization for each target through techniques like quantization, pruning, and architecture search.
Proper model packaging includes metadata about training data, hyperparameters, framework versions, and performance metrics. This enables reproducible science and easier debugging when models behave unexpectedly in production.
The philosophy of 弘益人間 (Benefit All Humanity) is embodied in open model sharing. Platforms like Hugging Face have democratized access to state-of-the-art models, enabling researchers worldwide to build upon each other's work.
Let's examine several real-world scenarios that require effective model exchange:
A data science team trains a computer vision model in PyTorch using Jupyter notebooks. The MLOps team needs to deploy it to a TensorFlow Serving cluster for production inference at scale. The exchange process involves:
# 1. Export PyTorch model to ONNX
import torch.onnx
torch.onnx.export(model, dummy_input, "model.onnx")
# 2. Convert ONNX to TensorFlow SavedModel
import onnx
from onnx_tf.backend import prepare
onnx_model = onnx.load("model.onnx")
tf_model = prepare(onnx_model)
tf_model.export_graph("saved_model")
# 3. Deploy to TF Serving
# Model is now ready for production serving
A language model runs efficiently on cloud GPUs but needs to run on mobile devices with limited resources. The exchange process includes aggressive optimization:
# 1. Quantize model to INT8
import tensorflow as tf
converter = tf.lite.TFLiteConverter.from_saved_model('model')
converter.optimizations = [tf.lite.Optimize.DEFAULT]
tflite_model = converter.convert()
# 2. Reduce model size by 75%
# 3. Deploy to mobile app
# Model now runs 4x faster with minimal accuracy loss
An organization maintains dozens of models across multiple teams. They need centralized storage, version control, and access management:
# Using MLflow Model Registry
import mlflow
mlflow.set_tracking_uri("https://registry.company.com")
# Register new model version
mlflow.pytorch.log_model(model, "models/sentiment-analysis")
# Transition to production
client = mlflow.tracking.MlflowClient()
client.transition_model_version_stage(
name="sentiment-analysis",
version=5,
stage="Production"
)
While model exchange offers tremendous benefits, several challenges must be addressed:
Different frameworks use different computational graphs, operator sets, and data formats. Not all operations in PyTorch have direct equivalents in TensorFlow, and vice versa. Custom operations and dynamic control flow pose particular challenges.
Converting between formats or applying optimizations can introduce numerical errors. Quantization from FP32 to INT8 might reduce accuracy by 1-3%. Ensuring acceptable accuracy after conversion requires careful validation.
Simple serialization formats save only weights and architecture, losing crucial information about training data, preprocessing pipelines, and expected input formats. Comprehensive model cards address this challenge.
Sharing models via public registries raises concerns about intellectual property, data privacy (models can leak training data), and security (malicious models can contain backdoors). Authentication, encryption, and audit logs are essential.
The WIA-AI-008 standard provides a comprehensive framework for model exchange, addressing these challenges through four phases:
The Open Neural Network Exchange (ONNX) format plays a central role in model exchange. Created by Microsoft and Facebook (now Meta) in 2017, ONNX provides a framework-agnostic intermediate representation for neural networks.
# PyTorch to ONNX
import torch
dummy_input = torch.randn(1, 3, 224, 224)
torch.onnx.export(
model,
dummy_input,
"model.onnx",
opset_version=14,
input_names=['input'],
output_names=['output'],
dynamic_axes={'input': {0: 'batch_size'}}
)
# ONNX Runtime inference
import onnxruntime as ort
session = ort.InferenceSession("model.onnx")
outputs = session.run(None, {'input': input_data})
Model cards, introduced by Google researchers in 2019, provide structured documentation for machine learning models. They address transparency, accountability, and reproducibility.
Several platforms and tools have emerged to facilitate model exchange:
| Platform | Focus | Key Features |
|---|---|---|
| Hugging Face Hub | NLP & Multimodal | 100k+ models, Git-based versioning, model cards |
| TensorFlow Hub | TensorFlow models | Reusable model components, transfer learning |
| PyTorch Hub | PyTorch models | One-line model loading, pretrained weights |
| MLflow | MLOps platform | Experiment tracking, model registry, deployment |
| ONNX Model Zoo | ONNX models | Reference implementations, benchmarks |
The remaining chapters of this book dive deep into each aspect of model exchange:
Korea operates a comprehensive standards governance system through inter-ministerial cooperation. National Standards Council (under Prime Minister's Office, per Framework Act on National Standards Article 5) coordinates KATS (Korean Agency for Technology and Standards), MFDS (Ministry of Food and Drug Safety), MOTIE (Ministry of Trade, Industry and Energy), MSIT (Ministry of Science and ICT), MOIS (Ministry of the Interior and Safety), MOE (Ministry of Environment), MOHW (Ministry of Health and Welfare), MND (Ministry of National Defense), MCST (Ministry of Culture, Sports and Tourism), MOFA (Ministry of Foreign Affairs), MOJ (Ministry of Justice), and FSC (Financial Services Commission). Accreditation and Testing: KOLAS (Korea Laboratory Accreditation Scheme) accredits 800+ testing laboratories. KAS (Korea Accreditation System) accredits 50+ certification bodies. KTC (Korea Testing Certification), KTR (Korea Testing & Research Institute), KTL (Korea Testing Laboratory), and KCL (Korea Conformity Laboratories) provide conformance testing. Telecom and Cyber: KCC (Korea Communications Commission), KCA (Korea Communications Agency), TTA (Telecommunications Technology Association), IITP (Institute for Information & Communications Technology Planning & Evaluation), NIPA (National IT Industry Promotion Agency), KISA (Korea Internet & Security Agency), KCMVP (Korea Cryptographic Module Validation Program), NIS (National Intelligence Service), NSR (National Security Research Institute), and NCSC (National Cyber Security Center). National R&D Centers: KIST, ETRI, KAIST, Seoul National University, Yonsei University, Korea University, POSTECH, UNIST, GIST, DGIST, KISTI, KIER, KIMM, KRICT, KFRI, KRIBB. International Standards Cooperation: ISO TC/SC Korean secretariats, IEC TC/SC Korean secretariats, ITU-T Study Group Korean chairs, 3GPP RAN/SA Korean chairs, IEEE 802 Korean chairs, W3C Korea office, OASIS Korea office, IETF Korea cooperation, OECD CSTP, UN ESCAP, APEC SCSC Korean cooperation. Korean Industrial Standards (KS) Catalog: KS X (Information) 25,000+, KS A (Basic) 15,000+, KS B (Machinery) 25,000+, KS C (Electrical) 18,000+, KS D (Metallurgy) 12,000+, KS E (Mining) 5,000+, KS F (Construction) 18,000+, KS H (Food) 8,000+, KS I (Environment) 5,000+, KS J (Biology) 3,000+, KS K (Textile) 15,000+, KS L (Ceramics) 7,000+, KS M (Chemistry) 12,000+, KS P (Medical) 5,000+, KS Q (Quality Mgmt) 4,000+, KS R (Transport) 12,000+, KS S (Service) 3,000+, KS T (Packaging) 4,000+, KS V (Shipbuilding) 5,000+, KS W (Aerospace) 3,000+ — totaling 220,000+ Korean Industrial Standards. Key Acts: Personal Information Protection Act (Act 19234, effective Sept 15, 2024), Electronic Government Act, Electronic Signature Act, Act on Promotion of Information and Communications Network Utilization and Information Protection, Information and Communications Infrastructure Protection Act, Data Industry Act, Public Data Act, AI Framework Act (Act 20212, effective July 2026), Industrial Technology Innovation Promotion Act, Framework Act on Science and Technology — 70+ Korean standardization-related laws.
Korea operates digital transformation through a comprehensive governance system. Digital Government: Digital Platform Government Committee (established September 2022, under the President)·Ministry of the Interior and Safety Digital Government Bureau·e-Government Support Center·Gov.kr·National Citizen Service·KDIS (Korea Digital Information Society)·NIA (National Information Society Agency)·MOIS (Ministry of the Interior and Safety). K-DNS Infrastructure: Korea Internet & Security Agency (KISA) Korea Internet Center·KISA DNS Root Server·KRNIC (Korea Network Information Center)·BGP Korea·National Cyber Security Center (NCSC)·KCC (Korea Communications Commission)·MSIT (Ministry of Science and ICT)·NIA·NIPA. Korean Cloud Infrastructure: KT Cloud·NAVER Cloud (NCloud)·Samsung SDS Cloud·LG U+ Cloud·NHN Cloud·Kakao Enterprise Cloud·SK Telecom Cloud·KISA Cloud Security Assurance Program (CSAP)·KCMVP-validated cloud·ISMS-P (Information Security & Personal Information Management System). Korean Security Certifications: KISA ISMS-P certification·KCMVP (Korean Cryptographic Module Validation Program)·NIS (National Intelligence Service) "National Cryptographic Technology Operation Standards"·NCSC "National Cyber Security Strategy 2024-2028"·CC (Common Criteria) Korean evaluation bodies·EAL4·EAL5·KS X ISO/IEC 15408·19790·24759 Korean Profile. Korean Data Standards: NIA AI Hub·National Data Standardization Committee·Statistics Korea (KOSTAT)·MyData 4 Designated Combination Specialists (Samsung SDS, KICI, KOSTAT, KFTC)·National Institute of Korean Language·National Law Information Center·National Spatial Information Platform·National Spatial Data Center·Korean Spatial Information Standards. Finance and Fintech Standards: FSC (Financial Services Commission)·FSS (Financial Supervisory Service)·FIU (Financial Intelligence Unit)·BOK (Bank of Korea)·FSEC (Financial Security Institute)·KFTC (Korea Financial Telecommunications)·KSD (Korea Securities Depository)·KRX (Korea Exchange) 8-agency cooperation. 5G/6G Communications Infrastructure: 5G subscribers 35 million (2024)·5G base stations 350,000·6G commercialization target 2028·5G dedicated networks 16 operators·6G Acceleration Council (MSIT, 2024). K-Content: KOCCA (Korea Creative Content Agency)·MCST (Ministry of Culture, Sports and Tourism)·KCA (Korea Communications Agency)·Korea Culture Information Service Agency·Korean Film Archive·Korea Publishing Industry Promotion Agency. Data 3 Acts (Personal Information Protection Act·Credit Information Act·Telecommunications Network Act, 2020 enforcement)·Data Industry Act (2021)·Public Data Act (2013)·AI Framework Act (2026)·Digital Platform Government Framework Act (2024 proposed) — Korea digital transformation core legislation.