RESEARCH / EXPERIMENTAL

GENERATIVE AI LAB

Independent research into identity-consistent generative AI pipelines. Every quality threshold is statistically calibrated against measured data — not hand-tuned — and a guard-railed MCP layer lets an autonomous agent operate the pipeline within evidence-gated limits.

STATUS
ONGOING EXPERIMENT
STARTED
2025
PRODUCTION
EXPERIMENT
PROTOTYPE
RESEARCH EXHIBITS
01

MULTI-STAGE CV QUALITY GATE

A staged scoring engine sequencing four independent signal types — identity, anatomy, duplication, composition — so only one model is resident in memory at a time.

PRODUCTION
┌─────────────────────────────────────────┐
│  STAGE 1 — IDENTITY                      │
│  InsightFace · multi-reference weighted  │
│  prototype · top-k cosine aggregation    │
└──────────────────┬────────────────────────┘
                   ▼
┌─────────────────────────────────────────┐
│  STAGE 2 — ANATOMY                       │
│  MediaPipe hand-landmark geometry ·      │
│  finger-ratio & joint-bend checks        │
└──────────────────┬────────────────────────┘
                   ▼
┌─────────────────────────────────────────┐
│  STAGE 3 — DUPLICATES                    │
│  pHash + ArcFace + DINOv2 embedding      │
│  cosine similarity                       │
└──────────────────┬────────────────────────┘
                   ▼
┌─────────────────────────────────────────┐
│  STAGE 4 — COMPOSITION                   │
│  SigLIP · advisory only after measuring  │
│  weak separation power                   │
└─────────────────────────────────────────┘
   one model resident in memory at a time —
        RAM-bounded on constrained hardware

Each stage is staged deliberately, not just logically separated: only one scoring model is ever resident in memory, bounding peak RAM on constrained hardware. Composition scoring (SigLIP) was demoted from hard-reject to advisory after measuring that its separation power was too weak to gate on alone — evidence changed the architecture, not just a threshold.

02

STATISTICAL THRESHOLD CALIBRATION

Every gate threshold is derived from measured data — leave-one-out cross-validation and balanced-accuracy sweeps — not hand-guessed constants.

PRODUCTION
CALIBRATION RUNTIME — BEFORE~40 MIN
CALIBRATION RUNTIME — AFTER~2.5 MIN

≈15× FASTER — BATCHED SIGLIP FORWARD PASSES, NO REDUNDANT MODEL RELOADS

THE DIAGNOSIS

A production run once rejected 93 of 100 images. The cause traced to three independently miscalibrated face-detection gates — an uncalibrated confidence floor, raw face-count rejection instead of same-identity-aware competing-face detection, and an area-ratio gate fighting the pipeline’s own diversity targets. A separate class-imbalance trap was caught before shipping: a naive accuracy-maximizing sweep would have selected a threshold rejecting 97% of the pipeline’s own good output.

ADDITIONAL EXPERIMENTS
AEXPERIMENT

DUAL-BACKEND GENERATION ORCHESTRATION

RunPod-serverless and local ComfyUI generation behind one interface. The orchestrator enforces strict generate/score alternation — scoring is fully stopped before generation starts and vice versa — with OOM-aware retry and cross-process locking for safe resumability.

BEXPERIMENT

CUSTOM RUNPOD SERVERLESS GPU WORKER

A from-scratch Docker image pinning a specific ComfyUI core version and several custom node packages, deployed on a scale-to-zero serverless endpoint (L40S / RTX 6000 Ada 48GB class). FP8 vs. BF16 quality-parity and VRAM-headroom trade-offs evaluated before committing to an instance size.

CEXPERIMENT

GUARD-RAILED MCP AGENT INTEGRATION

A curated, write-restricted tool surface (10 tools — status, analysis, batch generation, calibration, drift analysis) lets an autonomous agent operate the pipeline. Config writes require justification strings, automatic backups, an audit log, and evidence-gated thresholds (n ≥ 8, lift ≥ 1.8) before any change is allowed.

DEXPERIMENT

LORA TRAINING & CHECKPOINT SELECTION

Character LoRA trained via Ostris ai-toolkit. Production checkpoint chosen by controlled multi-checkpoint comparison after discovering the automated identity-similarity metric declined monotonically with training steps — it would have selected a checkpoint with visible defects invisible to the metric alone.

THE FULL PIPELINE

INPUT → INFERENCE

  • Source media collection
  • Reference image curation
  • Diversity sampling
  • Raw dataset assembly
  • LoRA inference
  • Prompt engineering
  • Batch generation
  • Checkpoint management
  • Identity scoring (InsightFace)
  • Anatomy checks (MediaPipe)
  • Duplicate detection (embeddings)
  • Composition scoring (SigLIP)
  • Leave-one-out calibration
  • Balanced-accuracy sweeps
  • Recalibrated on every dataset change
  • Fixed a 93%-reject failure mode
  • Ostris ai-toolkit training runs
  • LoRA rank selection
  • Multi-checkpoint comparison
  • Retired a misleading single metric
  • Custom RunPod Serverless worker
  • Dual-backend: serverless + local fallback
  • FP8/BF16 VRAM tradeoff analysis
  • Guard-railed MCP agent operation
NEXT STEP

NEED SOMEONE WHO CAN OWN AN AI SYSTEM END TO END?