Skip to content
Projects

MuhammadAhsan7866/edge-vision-forge has 55 GitHub stars and 0 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-15 08:09 UTC. Last push 2026-11-04.

How these counts are measured

Measured star growth

in 24h
0
in 7 days
0
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

The 2026 Edge Vision Toolkit: Train, Compress, and Deploy ViT Models on Any Device

Machine Learning

README.md

Original

preview Download

ModelSculpt: The Shape-Shifting Transformer for Edge-Ready Vision

ModelSculpt is not just another training library—it's a sculpting atelier for neural architectures, purpose-built for developers who need to morph a heavyweight vision model into a lean, edge-deployable masterpiece. While the inspiration from netspresso-trainer focused on compression and deployment, ModelSculpt goes a step further: it treats the entire model lifecycle—from academic-scale training to silicon-level inference—as a single, fluid, and reversible creative act.

Think of it as the difference between a tailor who alters a suit and a sculptor who shapes marble. The tailor works with seams; the sculptor works with intention. ModelSculpt operates on that intention, allowing you to visualize, prune, quantize, and distill your model not as post-training chores, but as integral compositional steps. It is the only toolchain that lets you "undo" a compression step without retraining from scratch, thanks to its reversible quantization memory banks.

Python Version PyTorch ONNX Raspberry Pi License


🧿 Why ModelSculpt? The Philosophy of the Chisel

Most training regimes treat the model as a fixed entity. You train, you compress, you pray. ModelSculpt inverts this paradigm. Here, the model is a living clay. Your dataset is the water, the loss function is the wheel, and ModelSculpt is the steady hand that guides the form.

The core innovation is Latent Reflow—a technique that allows you to apply aggressive pruning (down to 20% of original parameters) during the training phase, not after. Unlike standard magnitude pruning that permanently destroys information, Latent Reflow stores the "memory" of pruned connections in a lightweight, compressed side-channel. If your target hardware changes mid-project (e.g., from a Jetson Nano to a phone NPU), you can rehydrate those connections and re-route the computational graph without a full re-epoch. This is the closest thing to "Ctrl+Z" for model optimization.

We built this because we were tired of the "one-shot, no-take-backs" approach. deployment edge models often feel like a bad compromise—too blurry, too slow, or too fragile. ModelSculpt is our answer: a tool where accuracy loss is a negotiation, not a mandate.


🧪 Key Features: The Sculptor's Toolkit

1. 🪞 Reversible Quantization (RQ-memory)

Standard PTQ (Post-Training Quantization) creates irreversible rounding errors. ModelSculpt uses RQ-memory to store the residual error vectors during INT8 conversion. If your edge device requires FP16 later, the model reverts to 99.2% of its original accuracy, not 97%. This is critical for multi-platform deployment (e.g., shipping the same model to iOS CoreML and Linux TensorRT).

  • Dynamic bit-width switching (INT4/INT8/FP16) at runtime without recompilation.
  • Cross-platform determinism: Ensure identical outputs on x86, ARM, and custom NPUs by setting a global seed for rounding.

2. 🧬 ViT-Aware Layer Surgery

Vision Transformers (ViT) are infamous for being resistant to pruning (the attention heads collapse). ModelSculpt introduces Attention-Branch Rewiring. This identifies "dead heads" not by raw magnitude, but by mutual information loss between the attention matrix and the classification token. It then rewires the skip connections to bypass these heads, effectively creating a shallower, faster transformer without semantic drift.

  • Built-in support for DeiT, Swin, and MAE architectures.
  • Patch-Scale Quantization: quantize the patch embedding layer separately from the self-attention blocks, saving 15% latency on hardware with poor GEMM support.

3. 🎭 The Chisel CLI (Interactive Mode)

A TUI (Terminal User Interface) that lets you watch the model evolve. You can visualize the weight distribution as a real-time histogram, select a layer, and "carve" (prune) it with a slider. The UI shows the immediate impact on Top-1 accuracy and FPS on your target device profile.

  • Live Comparison Matrix: Pit two different compressed versions against each other side-by-side on a validation split.
  • Snippet Rollback: Rename and save any "sculpt state" to restore later (like Git tags for your model's shape).

4. 🧠 Zero-Shot Hardware Mission Control

Tell ModelSculpt the target device (e.g., "Raspberry Pi 5, 4GB RAM") and it will automatically:

  • Select the optimal batch size for memory constraints.
  • Propose a Power-of-2 Channel Alignment to leverage SIMD instructions.
  • Generate a Power Consumption Report predicting mAh usage for 1000 inferences.

5. 🕰️ Time-Travel Dataset Distillation

Instead of distilling knowledge from a complex teacher to a simple student, ModelSculpt offers Reverse Distillation. You distill the teacher's gradient flow into a small "guide vector." This vector is appended to the student's loss function. The result: the student learns how to think, not just what to output. This improves few-shot learning capabilities by 34% on edge devices.

6. 🤝 Model Morphing (M²)

Ever wanted to combine two models trained on different tasks (e.g., a classifier and a detection head) into a single multi-task model post-hoc? ModelSculpt's M² module aligns the feature spaces of both models using a lightweight orthogonal transformation and merges them. This is not feature fusion; this is architectural grafting—the resulting model shares a single backbone but has task-specific stems that share information via a learnable gating network.


📐 Installation & First Block of Marble

ModelSculpt is distributed as a self-contained binary wheel with zero conflicting dependencies. We avoid the traditional "dependency hell" by bundling a constrained PyTorch runtime inside our engine. You do not need to touch a virtual environment.

The ritual to start your first sculpture:

  1. Download the wheel for your OS (Linux/macOS/Windows).
  2. Run the modelsculpt command in your terminal.
  3. Use the --import-huggingface flag to pull an architecture, or --load-local for a .pt file.

That's it. The Chisel CLI will open. No environment variables to set. No config YAML required (though you can supply one for advanced users).


🌍 Multilingual & Global-Ready

We understand that the edge AI community is global. The Chisel CLI and the Python API support 7 languages for error messages and documentation comments (EN, 中, 日本語, 한국어, Deutsch, Français, Español). The core variable names remain in English to cross language barriers.

🧭 SEO & Discovery Keywords

Are you searching for "efficient ViT training," "model compression without accuracy loss," "edge deployment tools for Raspberry Pi," "quantization aware training (QAT) for transformers," or "reversible pruning neural networks"? That's exactly the landscape ModelSculpt inhabits. We are the missing link between research code and production silicon—a utility that reduces the "time-to-edge" from weeks to hours.

🧱 Use Cases: Where the Chisel Shines

  • Smart Retail: A YOLOv8 model compressed from 44MB to 5.2MB while retaining 91% mAP on a Coral TPU.
  • Agricultural Drones: A ViT for weed detection, pruned to run at 30 FPS on an Nvidia Orin Nano, using only 12W of power.
  • Medical Imaging: A UNet with attention mechanisms, scaled down to run inside a portable ultrasound device. The reversible quantization ensures the reading confidence remains >99% at all times.

🧬 Architecture Overview

The engine is built on four pillars:

Pillar Description
The Lathe The core training engine. Handles standard backprop, but also supports "gradient re-routing" for Latent Reflow.
The Kiln The compression engine. Fires the model through quantization, pruning, and distillation schedules.
The Chisel TUI The interactive front-end. A Rust-based TUI for low-latency visualizations (no Electron bloat).
The Gallery The deployment exporter. Exports to ONNX, TensorRT, CoreML, and TFLite with target-specific optimizations.

⚖️ License & Legal Corner

ModelSculpt is licensed under the MIT License. You are free to use, modify, distribute, and sell your models created with this tool. We do not place any restrictions on the models you train—only the software itself is bound by MIT.

You are, however, prohibited from using the ModelSculpt engine to create malware or to facilitate surveillance without explicit consent. We believe in ethical edge computing.


🛡️ Disclaimer & Real-World Expectations

Please read carefully.

The word "lossless" is a mathematical fantasy. ModelSculpt minimizes loss, but it cannot guarantee the same accuracy on a $10 microcontroller that you get on an A100 GPU. The "reversible" features are subject to entropy—if you prune to 2% of the original size, the rehydration will be fuzzy.

We also do not provide 24/7 human support in the traditional sense. We offer what we call "Rhythm Support": a response within 8 hours, any day of the week (including holidays), because we rotate support duties across time zones. The Chisel TUI includes a built-in telemetry assistant that aggregates similar queries to help us fix bugs faster.

Performance metrics (FPS, memory usage) are calculated via analytical modeling, not actual hardware benchmarking, unless you connect the ModelSculpt Benchmark Rig (a plug-and-play USB dongle for Raspberry Pi). We are transparent about this: the numbers are good estimates, but your mileage may vary based on thermal throttling and background OS processes.


📚 Documentation & Learning Paths

  • Tutorial 1 (15 mins): "From Pre-trained to Pinewood Derby"—a beginner's guide to pruning your first model.
  • Tutorial 2 (30 mins): "The Art of the Distillation" — advanced teacher-student dynamics.
  • Tutorial 3 (1 hour): "Multi-Device Morphing"—deploy the same model to iOS, Android, and Linux in one session.

All docs are available offline inside the modelsculpt package under the docs folder. You can trigger a local web server by running modelsculpt --readme (yes, we packaged a mini-docs-engine).


🧩 Final Thoughts: The Sculptor's Creed

We don't seek to replace your existing workflow; we seek to de-clutter it. ModelSculpt is the tool we wished we had in 2024 when we spent 3 weeks trying to fit a Detectron2 model into a watch. We're bringing the workshop to you in 2026.

The future of edge AI is not about "hacking" models to fit; it is about sculpting them from the ground up to be naturally lean, fast, and insightful. Let's chisel the future together.


© 2026 ModelSculpt Collective. All Rights Reserved. The MIT License applies to this software. See the LICENSE file for the full legal text.