Operationalization of Machine Learning with Serverless Architecture: An Industrial Operationalization of Machine Learning with Serverless Architecture: An Industrial Implementation for Harmonized System Code Prediction
Organizations: Governance Schneider Electric U.S.A Boston, USA · Tax and Customs Schneider Electric Mexico Mexico city, Mexico · Governance Schneider Electric Paris, France
Abstract
This paper presents a serverless MLOps framework orchestrating the complete ML lifecycle from data ingestion, training, deployment, monitoring, and retraining to using event-driven pipelines and managed services. The architecture is model-agnostic, supporting diverse inference patterns through standardized interfaces, enabling rapid adaptation without infrastructure overhead. We demonstrate practical applicability through an industrial implementation for Harmonized System (HS) code prediction, a compliance-critical task where short, unstructured product descriptions are mapped to standardized codes used by customs authorities in global trade. Frequent updates and ambiguous descriptions make classification challenging, with errors causing shipment delays and financial losses. Our solution uses a custom text embedding encoder and multiple deep learning architectures, with Text-CNN achieving 98 percent accuracy on ground truth data. Beyond accuracy, the pipeline ensures reproducibility, auditability, and SLA adherence under variable loads via auto-scaling. A key feature is automated A/B testing, enabling dynamic model selection and safe promotion in production. Cost-efficiency drives model choice; while transformers may achieve similar accuracy, their long-term operational costs are significantly higher. Deterministic classification with predictable latency and explainability is prioritized, though the architecture remains extensible to transformer variants and LLM-based inference. The paper first introduces the deep learning architectures with simulations and model comparisons, then discusses industrialization through serverless architecture, demonstrating automated retraining, prediction, and validation of HS codes. This work provides a replicable blueprint for operationalizing ML using serverless architecture, enabling enterprises to scale while optimizing performance and economics.
Figures & tables
| FEATURES | DESCRIPTION |
|---|---|
| Short Description | Technical description of each item or product along with information about product hierarchy and product name |
| Medium Description | Description about product family that contains similar products, and also includes product dimensions and technical specifications |
| ETIM | International classification standard for technical products |
| Hyper-parameters | Range | DNN base model | DNN up-sampled model | LSTM (base & up-sampled) |
|---|---|---|---|---|
| Initial neurons | 11- 174 | 11.01 | 168.01 | 25.0 |
| Neuron Pct | 0.35 - 1.0 | 0.44 | 0.95 | 1.0 |
| Dropout | 0.10 - 0.75 | 0.37 | 0.1 | 0.1 |
| Neuron Shrink | 0.25 - 0.95 | 0.31 | 0.466 | 0.95 |
| Embedding Dim | 11.0 - 87.0 | 65.74 | 43.3 | 78.0 |
| N_layer | 1.0 - 15.0 | 8.02 | 7.89 | 3.0 |
| Model | Accuracy | Precision | Recall | F1 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 90 | 80 - 90 | 80 | 90 | 80 - 90 | 80 | 90 | 80 - 90 | 80 | ||||||||||||
| B | U | B | U | B | U | B | U | B | U | B | U | B | U | B | U | B | U | B | U | |
| DNN | 89% | 95% | 15 | 19 | 5 | 1 | 3 | 3 | 12 | 20 | 5 | 2 | 6 | 1 | 14 | 19 | 5 | 2 | 4 | 2 |
| LSTM | 93% | 97.50% | 19 | 20 | 2 | 0 | 2 | 3 | 16 | 22 | 5 | 1 | 2 | 0 | 18 | 21 | 3 | 1 | 2 | 2 |
| Text-CNN | 98% | 98% | 19 | 20 | 2 | 1 | 2 | 2 | 20 | 21 | 2 | 2 | 1 | 0 | 19 | 20 | 2 | 2 | 2 | 1 |
| Model | Accuracy | Precision | Recall | F1 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 90 | 80 - 90 | 80 | 90 | 80 - 90 | 80 | 90 | 80 - 90 | 80 | ||||||||||||
| B | U | B | U | B | U | B | U | B | U | B | U | B | U | B | U | B | U | B | U | |
| DNN | 89% | 95% | 15 | 19 | 5 | 1 | 3 | 3 | 12 | 20 | 5 | 2 | 6 | 1 | 14 | 19 | 5 | 2 | 4 | 2 |
| LSTM | 92% | 97.00% | 19 | 20 | 2 | 0 | 2 | 3 | 16 | 22 | 5 | 1 | 2 | 0 | 18 | 21 | 3 | 1 | 2 | 2 |
| Text-CNN | 98% | 98% | 19 | 20 | 2 | 1 | 2 | 2 | 20 | 21 | 2 | 2 | 1 | 0 | 19 | 20 | 2 | 2 | 2 | 1 |
| Hyper-parameters | Range | Values |
|---|---|---|
| Filter Size | [64,128,256] | 128 |
| Kernel Size | 1 - 10 | [5] |
| Embedding Dim | 50 - 150 | [100] |
| N_layer | 1.0 - 5.0 | 1.0 |
| Precision | Recall | Evaluation | Type of F Score |
|---|---|---|---|
| High | High | Best case scenario - model detects HS code and predicts well with less misclassifications performs well on train and test | F0 |
| High | Low | Model detects HS codes but with some misclassifications model performs better on training but not that well on tests | between F1-F2 |
| Low | High | Over fitting -model predicts well on train but not on test set | between F0-F1 |
| Low | Low | Model is not learning as Precision and recall are low in both train and test | between F1-F2 |
| Model | Hyper-parameter Tuning | Training | Total Time Taken | |||
|---|---|---|---|---|---|---|
| Base Model | up-sampled Model | Base Model | up-sampled Model | Base Model | up-sampled Model | |
| DNN | 36 mins | 2 hours 55 mins | 15 mins | 27 mins | 51 mins | 3 hours 36 mins |
| LSTM | 4 hours | 4.2 hours | 1.5 hours | 1.2 hours | 5.5 hours | 5.4 hours |
| Text-CNN | 2 hours 20 min | 1 hour 50 mins | 55 mins | 1 hour 20 mins | 3 hours 15 mins | 3 hours 10 mins |
Text Classification
Text classification assigns text to categories such as topic, sentiment, intent, stance, or risk, supporting search, moderation, and decisions.
See all 226 papers