Gen AI Video — Building A Scalable Validation Framework

10 min read Original article ↗

Sagar Tekwani

We discuss building strong eval frameworks as part of our Generative AI studio to ensure that generated video maintains a high quality bar.

Press enter or click to view image in full size

Introduction

As JioHotstar scales to serve one of the world’s largest streaming audiences, generative AI(GenAI) offers a powerful opportunity to accelerate content creation, adapt stories across languages and regions, and unlock creative workflows that traditional pipelines cannot match.

Customers evaluate AI-generated video with the same standards they apply to premium productions; any drift in character identity, structural deformity, abrupt scene shift, or unsafe visual undermines realism instantly.

Generative models, being probabilistic, introduce such inconsistencies naturally, and at our scale even rare defects accumulate into meaningful quality gaps. Ensuring stable characters, coherent locations, and safe content therefore becomes a scientific challenge central to customer acceptance.

To address this, we built a Validation Framework that operates as a first-class component of the generation pipeline. This closed-loop system enforces quality, safety, and consistency at the same cadence as creation, enabling generative video to meet production-grade expectations on the JioHotstar platform.

System Overview: The Validation Layer

The video generation process starts with editorial scripts, from which the system extracts characters, locations, accessories, and context. These entities drive keyframe generation, which expands into video clips and assembles into the final video.

The Validation Framework (Fig. 1) spans all stages of this process and operates synchronously within the workflow. It evaluates intermediate outputs, flags issues early, and triggers targeted regeneration or parameter adjustments to maintain quality. Brand detection and safety checks act as hard gates, while other modules guide regeneration to preserve consistency and visual integrity.

Each module governs a specific quality dimension, character consistency, deformity, scene continuity, brand safety, content appropriateness, or story coherence and emits go/no-go signals that control progression. The system logs all validation outcomes and samples them for periodic human review to support ongoing calibration.

Together, these modules form the framework’s control surface, defining the quality of generative video. Most components operate at production readiness, while long-range story and concept continuity remains an active area of experimentation as we continue refining metrics and validation strategies.

Press enter or click to view image in full size

Fig.1: Overview of Developed Validation Framework

Character Consistency

Character consistency ensures that a character’s visual identity remains stable across all frames and scenes. Generative models, being stochastic, can drift subtly in facial features, proportions. These deviations break temporal realism and make the sequence unusable for production.

To quantify consistency, we represent each character through frame-level embeddings and compare them against a reference “hero character” image approved by the creative team. This hero image serves as the canonical visual anchor for that character.

We use an ensemble of independent facial similarity models (e.g., Buffalo-L, Antelope-v2, FaceNet, etc.), each fine-tuned for intra-character identity matching. Rather than representing a face with a single global embedding, these models extract multiple localised facial feature vectors corresponding to stable semantic regions of the face (such as eyes, nose bridge, jawline, and facial contours).

Sampling multiple localized descriptors improves robustness to pose changes, partial occlusion, lighting variation, and expression drift failure modes that are common in video generation but underrepresented in still-image similarity tasks. Each character, k, is represented in form of embeddings as f_hero^(k)

For a given frame i, each model m​ produces an embedding f_i^(k,m)​. We compute similarity using cosine similarity, which measures angular alignment in embedding space and remains invariant to feature magnitude.

This property is critical because generative models can alter contrast, illumination, and texture intensity without changing identity. Distance-based metrics (Euclidean or Manhattan) distance are sensitive to these magnitude shifts and empirically produce unstable thresholds across frames.

We also experimented with Jaccard similarity on facial embeddings but observed weaker alignment with human-in-loop evaluations. The similarity between the generated frame for a character k and its corresponding hero image for a model m, S_i^(k,m) is computed as:

Each model has a threshold m calibrated on human-labeled data. The binary decision per model m for each character k is:

The final consistency decision C uses an ensemble aggregation across all models (N) and characters, tuned for recall maximization:

where, m​ represents each model’s reliability weight and defines ensemble sensitivity.

This design ensures that every potential inconsistency is captured, even if one model fails, prioritizing recall over precision. Minor false positives are filtered through, ensuring consistency over short frame windows rather than isolated detections. Thresholds m and m are periodically re-calibrated using human-in-loop feedback. Annotators review flagged segments, refine labels, and feed corrections back into the validation loop. Thus, by fusing diverse fine-tuned models and anchoring every comparison to the hero reference, the system maintains stable character identity across the generation pipeline, regardless of lighting or scene transition.

For, side-profile consistency, which often reveals identity drift missed in frontal views. We generate strict left and right 90-degree profile references from the approved hero image, excluding frontal or angled views. We store the front, left, and right profiles as canonical anchors and compare generated frames against them to validate identity across viewing angles. This check surfaces profile-specific inconsistencies early and triggers regeneration when needed.

Press enter or click to view image in full size

Fig.2: Working of Character Consistency Framework

Press enter or click to view image in full size

Table-1: Comparison of Hero Image with different generations

Character Deformity Detection

Character deformities break visual realism immediately. Generative models can produce warped limbs, misaligned joints, or anatomically implausible body structures when spatial constraints fail during sampling. To detect these failures reliably, we built a deformity-classification pipeline grounded in curated abnormality data and a trained YOLO-family detector.

Get Sagar Tekwani’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

We first evaluated general-purpose multimodal models such as Gemini and Qwen-VL on deformity detection. These models achieved only ≈40% recall on our internal human-annotated deformity dataset, and they consistently failed to detect subtle or multi-region structural distortions. This baseline confirmed that deformity detection requires a dedicated model trained on explicit abnormality signals. To detect anatomical distortions reliably, we built a deformity-detection module optimized for high recall and early intervention during video generation.

  • Used Tencent’s Distortion dataset (Predicting Distortion in Real-World Human Images) as the base corpus and curated it using human-in-loop review to improve label reliability.
  • Applied a segmentation-guided cleaning pipeline to remove annotations outside the human region, discard low-confidence samples pseg​, and filter out deformity regions below a minimum area threshold Amin​; segmentation masks also provided body-part bounding boxes.
  • Trained a YOLO-family detector on the curated dataset to localize and classify deformities across full-body and body-part crops, explicitly optimizing for high recall., Achieving ~35% recall lift on the same human-annotated evaluation set in comparison to Gemini and Qwen.
  • Integrated the detector across all generation stages to flag anatomical failures early and trigger regeneration or parameter adjustments before outputs propagate downstream.

Press enter or click to view image in full size

Fig.3: Deformity Detection Framework for limb abnormalities

Press enter or click to view image in full size

Fig.4: Deformity Detection Framework for facial abnormalities

Location Consistency

Location consistency ensures that generated scenes remain faithful to the scripted description and stable across multiple scenes within the same location. This is extremely important since drift in layout, lighting, spatial structure, or persistent objects breaks continuity and degrades perceived quality.

Consistency with scripted location and object constraints: During script parsing, LLMs extract structured location descriptions that capture spatial layout, environmental cues, lighting intent, and object-level constraints. These descriptions define both the expected set of objects and a subset of mandatory elements whose presence must be preserved.

We evaluate object presence using vision language models (VLMs) and flag in case if required objects are missing. In parallel, we assess overall scene fidelity by aligning text embeddings derived from the location description with visual scene embeddings extracted from generated keyframes using our VLM stack (e.g., Gemini, Qwen).

We calibrate similarity thresholds through human-in-loop (HIL) evaluation, selecting cutoffs that best correlate with human judgments of scene correctness. Frames that fall below the calibrated threshold indicate semantic or structural violations and trigger regeneration or parameter adjustment. Figure 5 illustrates how alignment scores reflect adherence to scripted location and object constraints.

Scene Visualization: Interior. Police interrogation room. Dim overhead lighting. Metal table bolted to the floor. Two chairs facing each other. One-way mirror. No windows.

Press enter or click to view image in full size

Fig.5: Location Consistency with Script<>Object alignment

Consistency across scenes within the same location: For locations that recur across multiple scenes, we treat the first validated keyframe as the one achieving the highest text–image alignment score as the location anchor. Using our vision–language model (VLM) stack, we extract scene-level embeddings from subsequent frames and compare them against this anchor via cosine similarity to detect structural and stylistic drift. This formulation allows us to enforce consistency in spatial layout, lighting characteristics, and persistent background elements when the same room, street, or set reappears at different points in the video. Figure 6 illustrates this anchor-based consistency check.

Press enter or click to view image in full size

Fig.6: Location Consistency across scenes

LLMs provide strong priors when generating detailed location descriptions, but they do not yet reliably detect subtle spatial or geometric inconsistencies in generated frames. We are therefore exploring additional approaches, including embedding-based scene classifiers, layout-consistency models, and structure-aware validators, to strengthen this module. These efforts aim to convert location consistency into a fully measurable and enforceable dimension within the validation framework.

Brand Logo Detection/Safety Checks

Brand-logo/Safety violations act as hard safety gates in the generation pipeline. The system blocks any output containing such elements and triggers regeneration until the output passes all safety checks. The validation loop operates as follows: the detector scans each generated unit, flags any violation, the system regenerates the content with adjusted constraints, and the detector re-evaluates the regenerated output. If repeated attempts fail, the system escalates the case for manual review. This loop ensures no flagged safety issue propagates downstream.

We enforce these safety dimensions through prompt-level controls and automated detection. During script parsing, LLMs generate structured content descriptions, including required or disallowed visual categories. These descriptions guide the image-generation model to avoid branded items and unsafe content.

We curated datasets for both tasks: brand/logo samples across categories such as laptops, consumer electronics, apparel, etc. and safety violations across violence, child-abuse, racism, hate symbols, and other violation types.

Using these datasets, we optimized prompts and detection thresholds for high recall, achieving >95% recall on internal evaluations. When the detector identifies a brand or NSFW instance, the system regenerates the output with stricter constraints to remove the violation.

Press enter or click to view image in full size

Fig.7: Brand Logo Detection across categories

Engineering Controls to Prevent Recurrence of Violations

Context-Aware Decoding:
We add structured negative constraints that suppress brand names, logos, or unsafe categories during generation. These constraints adjust the decoding trajectory of the image-generation model and reduce the probability of producing forbidden visual elements.

Adaptive Prompt Rewriting:
When a violation is detected, the system rewrites the prompt by tightening constraints, clarifying allowed content, and removing ambiguous phrasing. These rewritten prompts condition the regeneration step and help eliminate repeated violations across attempts.

Summary and Future Directions

This work presents a validation framework for generative video that operates as a first-class component of the generation pipeline. By integrating validation directly into the workflow, the system detects and corrects character inconsistency, anatomical deformities, location drift, and safety violations during generation.

The framework applies recall-first validation, multi-model similarity checks, vision–language alignment, and thresholds calibrated through human feedback to convert qualitative notions of visual quality into enforceable signals. This design prevents narrative-breaking errors from propagating while allowing controlled creative variation.

Next, we will formalize a unified evaluation and metrics layer that measures video, audio, lip-sync, and temporal consistency and supports systematic optimization.

We will also extend the framework to address long-range scene and concept continuity, enforcing coherence across scenes, episodes, and story arcs. These extensions will complete the quality stack required to deploy generative video systems at production scale.

Want to be at the forefront of generative video in India? Do check out open roles if you want to build for millions of customers, who will use features that you build!