Skip to content

Latest commit

ย 

History

88 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฌ CNN Optimization Benchmark Platform

Live Production Python 3.10+ FastAPI React 19 TypeScript Vite TailwindCSS Pytest License: MIT

A Scientific Research Workstation & Laboratory Platform for Empirically Benchmarking Metaheuristic Optimization Algorithms on Deep CNN Compression

๐ŸŒ Visit Live Deployment: cnn.umeshlabs.in

Live Web App โ€ข Features โ€ข Architecture โ€ข Algorithms โ€ข Installation โ€ข API โ€ข Documentation โ€ข Author


๐ŸŽฏ Core Research Problem

โ€œWhich metaheuristic optimization algorithm achieves the superior multi-objective Pareto trade-off between Top-1 Accuracy, Inference Latency, Continuous Power Draw, Computational Complexity (FLOPs/TOPs), Model Footprint, and Energy Consumption under identical hardware and compression constraints?โ€

The CNN Optimization Benchmark Platform provides an empirical, reproducible, and standardized research workstation to compare 10 state-of-the-art metaheuristics (plus user-registered custom algorithms) across deep Convolutional Neural Networks (ResNet-18, MobileNetV2, ShuffleNetV2, VGG-16, EfficientNet-B0) on standardized vision benchmarks (CIFAR-10, CIFAR-100, MNIST, Fashion-MNIST, ImageNet-1k Subset) and custom dataset uploads.


โœจ Key Features

  • ๐ŸŽ›๏ธ Algorithm Comparison Workbench: Interactive side-by-side comparison with real-time dynamic objective re-weighting (Accuracy, Latency, Size, Energy sliders) and live score re-computation.
  • ๐Ÿ“ Scientific Workstation UI/UX: Designed following laboratory instrumentation principles using IBM Plex Sans and IBM Plex Mono typography, dense analytical data tables, and structured research navigation.
  • โšก Dual Compute Target (GPU & CPU): Full hardware telemetry for NVIDIA GPUs (torch.cuda with pynvml power sampling) and Multi-Core CPUs with high-resolution synchronized latency timings.
  • ๐Ÿ”Œ Continuous Power & Compute Throughput Profiling: Real-time measurement and analytical modeling of Average Power Draw ($\text{Watts} = \frac{\text{Joules}}{\text{Latency (s)}}$) and Compute Throughput ($\text{TOPs}$).
  • ๐Ÿ“‰ Multi-Objective Pareto Analysis: Automatic extraction and 6-axis interactive visualization of the empirical non-dominated frontier.
  • ๐Ÿ“ˆ Convergence & Stochastic Telemetry: Real-time WebSocket iteration tracking and multi-run statistical boxplots (Mean, Median, Std Dev, Min, Max, 95% Student's $t$ Confidence Intervals).
  • ๐Ÿงฉ 5-Stage Ablation Decomposition: Isolates the marginal contributions of Quantization (FP16/INT8), Pruning (Structured Channel / Filter), and Metaheuristic Optimization.
  • ๐Ÿ“Š Confusion Matrix & Per-Class Degradation Suite: Interactive $K \times K$ heatmaps (Raw Counts, Row-Normalized Recall %, Column-Normalized Precision %), Top Confusion Pairs ranking, Per-Class Sensitivity Analysis, Macro/Micro Average metrics, and Differential algorithm comparison grids ($\Delta \text{Cell} = A_{i,j} - B_{i,j}$).
  • ๐Ÿš€ 1-Click Local Laptop Automated Installer: Automated zero-friction scripts for Windows PowerShell (install.ps1), Command Prompt (install.bat), and macOS/Linux Bash (install.sh) with auto-dependency bootstrapping and local daemon launching.
  • ๐Ÿท๏ธ Data Provenance Badging: Explicit scientific provenance labeling (โ— MEASURED, โ—† CALCULATED, โ–ฒ ESTIMATED, DEMO DATA).
  • ๐Ÿ“ Custom Extensibility: 1-Click modal uploads for custom Python optimizers (BaseOptimizer), custom image dataset archives (.zip), and custom PyTorch CNN architectures.
  • ๐Ÿ“„ Publication-Ready Exports: 1-Click downloads in CSV, JSON, Markdown, Microsoft Word (.doc), and Plain Text (.txt) formats.

๐Ÿ”ฌ Benchmarked Metaheuristic Algorithms

All algorithms adhere to the standardized BaseOptimizer mathematical search contract over continuous decision spaces $\mathbf{x} \in [0.0, 1.0]^D$:

Key Algorithm Name Family Citation Search Complexity
GWO Grey Wolf Optimizer Swarm Intelligence Mirjalili et al. (2014) $\mathcal{O}(N \times D)$
WOA Whale Optimization Algorithm Swarm Intelligence Mirjalili & Lewis (2016) $\mathcal{O}(N \times D)$
ALO Ant Lion Optimizer Swarm Intelligence Mirjalili (2015) $\mathcal{O}(N \times D)$
MFO Moth-Flame Optimization Physics / Biology Mirjalili (2015) $\mathcal{O}(N \times D)$
GOA Grasshopper Optimization Algorithm Swarm Intelligence Saremi et al. (2017) $\mathcal{O}(N^2 \times D)$
MVO Multi-Verse Optimizer Physics / Cosmology Mirjalili et al. (2016) $\mathcal{O}(N \times D)$
SCA Sine Cosine Algorithm Mathematical Trigonometric Mirjalili (2016) $\mathcal{O}(N \times D)$
AOA Arithmetic Optimization Algorithm Mathematical Algebraic Abualigah et al. (2021) $\mathcal{O}(N \times D)$
MGO Mountain Gazelle Optimizer Swarm Intelligence Abdollahzadeh et al. (2022) $\mathcal{O}(N \times D)$
GMO Geometric Mean Optimizer Mathematical Geometric Mirrashid & Naderpour (2023) $\mathcal{O}(N \times D)$

๐Ÿ—๏ธ System Architecture & Workflow

graph TD
    subgraph ClientLayer [Client Interface - React 19 & TypeScript]
        UI[Dashboard Command Center]
        WB[Algorithm Comparison Workbench]
        Wiz[New Benchmark Wizard]
        Plots[Pareto & Convergence Visualizers]
    end

    subgraph BackendLayer [Backend Engine - FastAPI & Async Workers]
        API[REST Endpoints & WebSocket Broadcaster]
        Runner[Experiment Task Runner]
        Optimizers[10 Metaheuristic Optimizers]
        Eval[Hardware Evaluation Suite - Latency / Power / Accuracy]
        Analytics[Pareto Analysis & WSM Scoring]
    end

    subgraph StorageLayer [Persistence Layer - SQLite & Cloud DB]
        DB[(benchmark.db - Models / Runs / Metrics)]
    end

    UI --> API
    WB --> API
    Wiz --> API
    Plots --> API
    API --> Runner
    Runner --> Optimizers
    Runner --> Eval
    Eval --> Analytics
    Analytics --> DB
    DB --> API
Loading

๐Ÿ“ Mathematical Formulation

1. Weighted Sum Model (WSM) Composite Scoring

$$\text{Composite Score}_i = \left( w_{\text{acc}} \cdot \tilde{A}_i + w_{\text{lat}} \cdot \tilde{L}_i + w_{\text{size}} \cdot \tilde{S}_i + w_{\text{energy}} \cdot \tilde{E}_i \right) \times 100$$

Where $\tilde{A}_i, \tilde{L}_i, \tilde{S}_i, \tilde{E}_i \in [0, 1]$ are min-max normalized metrics across all algorithms with inverse transformation for minimization metrics (Latency, Size, Energy).

2. Multi-Objective Fitness Evaluation

$$f(\mathbf{x}) = w_{\text{acc}} \left(\frac{\Delta \text{Acc}(\mathbf{x})}{\text{Acc}_{\text{baseline}}}\right) + w_{\text{lat}} \left(\frac{\text{Lat}(\mathbf{x})}{\text{Lat}_{\text{baseline}}}\right) + w_{\text{size}} \left(\frac{\text{Size}(\mathbf{x})}{\text{Size}_{\text{baseline}}}\right) + w_{\text{energy}} \left(\frac{\text{Energy}(\mathbf{x})}{\text{Energy}_{\text{baseline}}}\right)$$

3. Compute Throughput Density (TOPs)

$$\text{TOPs} = \frac{\text{FLOPs (M)} \times 10^6}{\text{Latency (ms)} \times 10^{-3} \times 10^{12}} = \frac{\text{FLOPs (M)}}{\text{Latency (ms)} \times 10^6}$$


๐Ÿš€ Quick Start & Installation

Prerequisites

  • Python 3.10+ (Tested on Python 3.10, 3.11, 3.12, 3.14)
  • Node.js v18+ & npm
  • Git

1. Clone Repository & Setup Backend

# Clone the repository
git clone https://github.com/UmeshCode1/cnn-optimization-benchmark.git
cd cnn-optimization-benchmark

# Install Python dependencies
python -m pip install -r requirements.txt

# Launch FastAPI Backend Server
python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload

2. Setup & Launch Frontend Workstation

In a separate terminal window:

cd frontend
npm install
npm run dev

Visit http://localhost:5173 (or http://localhost:8000 for FastAPI production bundle).


๐Ÿงช Comprehensive Test Suite

Run full automated test verification covering API endpoints, evaluators, and all 10 optimizers:

python -m pytest tests backend/tests -v
======================== 35 passed, 1 warning in 1.50s ========================

๐Ÿ“š REST & WebSocket API Catalog

Method Endpoint Description
POST /api/experiments Create and trigger an asynchronous benchmark experiment
GET /api/experiments List all historical benchmark runs with metadata filters
GET /api/experiments/{id} Retrieve comprehensive results, statistics, Pareto points, and ablations
POST /api/experiments/{id}/cancel Cancel active benchmark execution
DELETE /api/experiments/{id} Delete experiment record and cascading runs/metrics
POST /api/experiments/{id}/clone Clone benchmark configuration for reproduction
POST /api/experiments/{id}/recalculate Live dynamic recalculation of scores and rankings with custom weights
GET /api/experiments/{id}/confusion-matrix Retrieve research-grade $K \times K$ confusion matrix & per-class error analytics
GET /api/reports/{id}/csv Export results in CSV format
GET /api/reports/{id}/json Export results in JSON format
GET /api/reports/{id}/markdown Export formatted Markdown research report
GET /api/reports/{id}/doc Export Microsoft Word (.doc) formatted report
GET /api/reports/{id}/txt Export formatted Plain Text (.txt) report
WS /api/experiments/{id}/ws Real-time WebSocket stream for live iteration telemetry
GET /api/installer/preflight Pre-flight diagnostics and automated 1-click install instructions
GET /install.ps1 / /install.sh / /install.bat Raw automated 1-click laptop installation scripts
GET /api/algorithms List all verified and custom metaheuristic optimizers
POST /api/algorithms Register a new custom metaheuristic optimizer plugin
GET /api/datasets List available datasets and resolution parameters
POST /api/datasets/upload Upload a custom image dataset archive
GET /api/models List supported CNN model architectures
GET /api/hardware Inspect host CPU/GPU hardware profile and telemetry

๐Ÿ“– Complete Documentation & GitHub Wiki


๐Ÿ‘จโ€๐Ÿ’ป Author & Maintainer

Umesh Patel

AI & Deep Learning Systems Researcher / Software Engineer


๐Ÿ“„ License & Citation

This project is licensed under the MIT License โ€” see the LICENSE file for details.

If you utilize this benchmark workstation in academic or industrial research, please cite:

@software{umesh_patel_cnn_benchmark_2026,
  author = {Umesh Patel},
  title = {CNN Optimization Benchmark: A Scientific Research Platform for Metaheuristics in Deep Convolutional Neural Network Compression},
  year = {2026},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://cnn.umeshlabs.in/}}
}

About

A Scientific Research Workstation & Laboratory Platform for Empirically Benchmarking Metaheuristic Optimization Algorithms on Deep CNN Compression

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages