Skip to content
Back to skills

Openvision Unified Visual Encoder

ASecurity

Learn a single visual representation supporting both image understanding and generation by combining VAE-based generative training with contrastive learning objectives. Use when building multimodal systems that need unified image representations for both comprehension and generation tasks.

  • 6 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
developmentpythongoperformance

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add ADu2021/skillXiv --skill openvision-unified-visual-encoder --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openvision Unified Visual Encoder?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openvision Unified Visual Encoder
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adu2021-openvision-unified-visual-encoder/badge)](https://www.skillsdirectory.com/skills/adu2021-openvision-unified-visual-encoder)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: openvision-unified-visual-encoder
title: "OpenVision 3: A Family of Unified Visual Encoder for Both Understanding and Generation"
version: 0.0.2
engine: skillxiv-v0.0.2-claude-opus-4.6
license: MIT
url: "https://arxiv.org/abs/2601.15369"
keywords: [visual-encoder, image-understanding, image-generation, unified-representation, contrastive-learning]
description: "Learn a single visual representation supporting both image understanding and generation by combining VAE-based generative training with contrastive learning objectives. Use when building multimodal systems that need unified image representations for both comprehension and generation tasks."
---

# OpenVision 3: Unified Visual Encoder

This skill demonstrates how to train a single visual encoder that excels at both image understanding (comprehension) and generation (creation) tasks, unifying two typically separate concerns through combined VAE and contrastive objectives.

## When to Use
- Building multimodal models needing both image understanding and generation
- Creating unified representations for efficiency (one encoder, multiple tasks)
- Systems where image generation and understanding must be aligned
- Vision-language models requiring rich image representations
- Scenarios where parameter efficiency is valuable (single encoder vs. dual)

## When NOT to Use
- Specialized tasks where separate decoders outperform unified approaches
- Real-time systems where combined training adds overhead
- Domains where separate encoders are already well-established
- Simple classification (unified encoder may be overkill)

## Key Concept
Traditionally, image understanding and generation require separate encoders:
- **Understanding**: Discriminative encoders (contrastive learning, classification)
- **Generation**: Generative encoders (VAE, diffusion models)

OpenVision 3 achieves both with a unified encoder through joint training:

1. **Contrastive Learning**: Learn discriminative features for understanding
2. **VAE Reconstruction**: Maintain generative capability through reconstruction
3. **Shared Representation**: Single latent space for both tasks

The encoder learns representations that are both discriminative (good for classification/matching) and generative (good for reconstruction/synthesis).

## Implementation Pattern

Combine VAE and contrastive losses for unified encoder:

```python
# Pseudocode for unified visual encoder training
class UnifiedVisualEncoder:
    def __init__(self, encoder, decoder):
        self.encoder = encoder
        self.decoder = decoder  # VAE decoder for generation

    def forward(self, image):
        # Encode image
        latent = self.encoder(image)
        return latent

    def compute_unified_loss(self, batch_images):
        loss = 0

        # Component 1: Contrastive learning (understanding)
        # Use pairs or triplets of similar/different images
        contrastive_loss = self.contrastive_loss(batch_images)
        loss += contrastive_loss

        # Component 2: VAE reconstruction (generation)
        # Reconstruct images from latent representation
        reconstruction_loss = self.vae_reconstruction_loss(batch_images)
        loss += reconstruction_loss

        # Component 3: Optional KL divergence (for generative modeling)
        kl_loss = self.kl_divergence_loss()
        loss += 0.1 * kl_loss  # Weight KL component

        return loss

    def contrastive_loss(self, batch_images):
        # Get encodings for batch
        latents = self.encoder(batch_images)

        # Contrastive learning: maximize similarity within augmentation,
        # minimize across different images
        # Using NT-Xent loss or similar

        similarities = compute_pairwise_similarity(latents)
        loss = contrastive_criterion(similarities, labels)
        return loss

    def vae_reconstruction_loss(self, batch_images):
        # Reconstruct images from latent
        latents = self.encoder(batch_images)
        reconstructed = self.decoder(latents)

        # MSE or perceptual loss
        loss = mse_loss(reconstructed, batch_images)
        return loss

    def generate_image(self, latent_code):
        # Use decoder for generation
        return self.decoder(latent_code)

    def understand_image(self, image):
        # Use encoder for understanding
        latent = self.encoder(image)
        return latent  # Use for downstream tasks
```

## Key Results
- Single encoder achieves strong performance on both understanding and generation
- Parameter efficiency: one encoder vs. separate understanding/generation models
- Learned representations capture both discriminative and generative aspects
- Scalable across multiple model sizes

## Research Context
OpenVision 3 challenges the assumption that understanding and generation require separate encoders. By jointly training on both objectives, the encoder learns richer representations that capture essential visual information across both domains, enabling efficient unified vision systems.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.