ClipMindClipMind
Back to blog
AI character recognitionentity clusteringvideo understandingface recognition

AI Character Recognition in Video: Building a Multi-Scene Identity Library

AI character recognition uses visual embeddings and HDBSCAN clustering to identify recurring faces and objects across hundreds of scenes. Learn how a project-level identity library forms the foundation for character-aware video editing.

ClipMind Team6 min read
ClipMind entity recognition clustering characters across multiple video scenes

A character in a film might appear in eighty scenes — different lighting, different angles, different expressions, sometimes in a crowd, sometimes alone. For an AI editing system to track who appears where and when, it needs more than face detection. It needs to know that the face in scene twelve is the same person as the face in scene forty-seven, even when the two shots look nothing alike. This is what a project-level identity library solves: persistent character recognition across an entire video project.

1. Why frame-by-frame face detection is not enough

Detecting faces in individual frames gives you a list of face locations. It does not tell you whether two faces in different frames belong to the same person. For editing workflows — especially story recaps and character-focused cuts — you need identity continuity. The system must answer: 'In which scenes does this character appear, and what do they say?' That requires clustering faces across frames into identity groups.

2. Visual embeddings: turning faces into searchable vectors

The first step is converting each detected face into a visual embedding — a high-dimensional vector that captures the visual characteristics of that face. ClipMind uses Tongyi Embedding Vision Plus to generate these embeddings. Two faces that look similar will have embeddings that are close together in vector space. Two faces that look different will be far apart. These embeddings become the raw material for identity clustering.

3. HDBSCAN clustering: grouping faces into identity clusters

HDBSCAN is a density-based clustering algorithm that groups embedding vectors without requiring you to specify how many clusters exist in advance. This is critical for video projects where you do not know ahead of time how many unique characters appear. HDBSCAN finds clusters of varying density, handles noise gracefully, and does not force every face into a cluster — lone appearances stay as unclustered points rather than being incorrectly assigned.

  • No need to pre-specify the number of characters — HDBSCAN discovers the natural groupings.
  • Outliers and single-appearance faces are not forced into wrong clusters.
  • The algorithm handles projects with anywhere from two to dozens of recurring characters.

4. The project-level identity library: persistence across sessions

Once HDBSCAN produces identity clusters, they are saved as a project-level library. Each cluster gets a label — Character A, Character B, and so on — with representative key frames, appearance counts, and timecoded scene references. When you add new footage to the same project, new face embeddings are matched against the existing library. Known characters are automatically labeled, and new characters create fresh clusters. This persistence is what makes multi-episode and batch workflows practical.

5. Beyond faces: object and location recognition

The same embedding-and-cluster pipeline works for objects and locations, not just faces. A recurring prop, a distinctive vehicle, a frequently shown location — these can all be detected, embedded, and clustered. The reverse script can then reference not just which characters appear in a scene, but which objects and settings are present. This richer context improves both narrative composition and clip search.

6. How character recognition improves editing decisions

With a populated identity library, the script planner agent can answer editing requests that depend on character presence. 'Make a reel of every scene with Character A and Character B together.' 'Cut a trailer that introduces each main character.' 'Find all dialogue where Character C is the speaker.' These are not keyword searches — they are identity-aware queries backed by the clustering results.

  • Character-co-occurrence filtering for scene selection.
  • Per-character dialogue extraction from the time-aligned transcript.
  • Character appearance timelines for pacing and balance decisions.

FAQ

How accurate is the character clustering?

Accuracy depends on scene diversity and face visibility. For well-lit, front-facing shots, clustering accuracy is high. For profile shots, partial occlusions, or extreme lighting, some faces may remain unclustered or require manual review.

Can I manually label or correct clusters?

Yes. The identity library supports manual review. You can merge clusters that should be the same character, split clusters that should be separate, and assign human-readable names to character labels.

Does character recognition work for animated or CGI content?

It is optimized for real-world footage. Stylized animation and CGI characters may produce less reliable embeddings, though the pipeline can still extract and cluster visual features from those sources.

How many characters can the system track in one project?

There is no hard limit. HDBSCAN scales to dozens of identity clusters. Projects with very large casts may benefit from occasional manual review of edge-case cluster assignments.