Skip to main content

Shield Gemma 2: Developing a Safe Image Classifier for AI

Google for DevelopersApril 2, 20256 min714 views
8 connections·9 entities in this video→

Introducing Shield Gemma 2

  • πŸš€ Shield Gemma 2 is announced as a new 4 billion parameter image safety classifier, built upon the Gemma 3 model.
  • πŸ’‘ The model is designed to address the evolving capabilities of open AI models by providing robust safety mechanisms.
  • πŸ”‘ Safety is emphasized not as a feature, but as a crucial investment in the AI ecosystem.

How Shield Gemma 2 Works

  • πŸ› οΈ The model is built using high-quality labels from a curated mix of synthetic and natural image data across key harm categories.
  • 🧠 It leverages in-context learning strategies to develop the 4 billion parameter model on top of Gemma 3.
  • βœ… The process involves feeding an input image and a defined, customizable policy into Shield Gemma 2 to receive probabilities indicating policy violations.

Applications and Use Cases

  • 🎯 Shield Gemma 2 can function as an input filter for vision-language models (like Gemma 3) or an output filter for image generation systems.
  • βš–οΈ Key harms addressed include sexually explicit content, violent content, and dangerous content, with customizable policies.
  • πŸ“ˆ Practical applications include online filtering, offline evaluation, model distillation, and adaptation for downstream use cases.

Performance and Customization

  • πŸ“Š Evaluation results show Shield Gemma 2 outperforms leading models like Lavagard 7B, GBD4 mini, and out-of-box Gemma 3 4B across key harm types, based on Okmon F1 scores.
  • πŸ“ A prompt instruction template guides the model, starting with problem definitions, incorporating a policy placeholder, and requesting a binary 'yes' or 'no' response for policy violations.
  • πŸ’» The model supports both default and customized policies, demonstrated through Python code examples for loading the model and obtaining predictions.

Community and Future Development

  • 🀝 The development of Shield Gemma 2 is attributed to the creativity and resilience of the open-source community.
  • ✨ Developers are encouraged to try Shield Gemma 2, adapt it, and provide feedback to help evolve the model further.
  • 🌟 The team expresses gratitude and excitement for continued evolution in AI safety.
Knowledge graph9 entities Β· 8 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
9 entities
Chapters3 moments

Key Moments

Transcript24 segments

Full Transcript

Topics14 themes

What’s Discussed

Shield Gemma 2Image Safety ClassifierGemma 3Responsible AIMultimodal AIVision-Language ModelsImage GenerationHarm CategoriesIn-Context LearningOpen Source AIAI PolicyPolicy ViolationModel EvaluationPython
Smart Objects9 Β· 8 links
MediasΒ· 2
ConceptsΒ· 3
ProductsΒ· 4