Sign inSign up

lpoclin/hybrid-controller-mlp

By lpoclin

Updated 5 months ago

MLP Inference Engine — proactive per-slice UPF scaling classifier

Image
Machine learning & AI
0

122

lpoclin/hybrid-controller-mlp repository overview

MLP Inference Engine — Proactive Scaling Classifier for Hybrid Per-Slice UPF Autoscaling

Sidecar container running alongside the Hybrid Controller in 5G standalone Kubernetes deployments. Receives a normalized 8-dimensional feature vector from the Control Loop Coordinator and classifies the current UPF operational state into a scaling decision with Softmax confidence, evaluated by the proactive scheduler before dispatching to the Reactive Control Engine.

Model

Multilayer Perceptron — f(x) : ℝ⁸ → ℝ³ — 5,187 trainable parameters — CPU-only inference

Input (8) → Linear → BN1d → LeakyReLU(0.1) → Dropout(0.2)
         → Linear → BN1d → LeakyReLU(0.1) → Dropout(0.2)
         → Linear → logits ℝ³ → Softmax (service.py only)

Weights initialized with Kaiming He. Softmax applied at inference time by service.py, not inside model.py.

Input vector — produced by vectorizer.go

[cpu, mem, pps/100k, thr/1000, drop/100, lat/100, jitter/50, sliceID]
sliceID: 0=eMBB · 1=URLLC · 2=mMTC

Output classes

ClassMeaning
scale_outUPF overloaded — deploy new instance
scale_inUPF idle — drain and terminate
no_actionUPF stable — no action required

Training

ParameterValue
OptimizerAdam lr=0.001
LossCrossEntropyLoss — inverse class-frequency weights + ×1.2 no_action boost
Epochs140 — full batch — torch.manual_seed(42)
Dataset14,100 synthetic samples — 3 slices × 3 classes — aligned with faultinjection.go offsets

Evaluation — 2,820 samples (20% holdout)

ClassF1Mean confidence
scale_in0.9980.985
no_action0.9840.923
scale_out0.9660.937

Global accuracy: 98.44% — PCA variance explained: 93.8% (PC1=71.2%, PC2=22.6%) — >95% predictions above 0.60 confidence threshold

Endpoints

EndpointPortOriginPurpose
POST /predict5000Control Loop CoordinatorReceives [float64×8] → returns {action, confidence}
GET /health5000Bootstrap & Control ManagerGates proactive scheduler activation on pod startup
GET /metrics8001Prometheus scraperExposes mlp_total_predictions counter

/predict and /healthlocalhost only. /metrics — exposed via Kubernetes Service.

Build

Single-stage — python:3.11-slim-bookworm — PyTorch 2.0 CPU-only — no CUDA
Entrypoint: python3 service.py → Uvicorn on :5000

Source

MLP Inference Engine: github.com/5gc-hybrid-upf-autoscaling-system/hybrid-controller-mlp
Full project: github.com/5gc-hybrid-upf-autoscaling-system

Tag summary

Content type

Image

Digest

sha256:699c04b16

Size

379 MB

Last updated

5 months ago

docker pull lpoclin/hybrid-controller-mlp:v1