AI Content Moderation Pipeline
Automatically detect unsafe content across images, videos, and text. Flag NSFW material, violence, hate speech, and custom policy violations.
from mixpeek import Mixpeekclient = Mixpeek(api_key="YOUR_API_KEY", namespace="moderation")# 1. A bucket for user uploads, and a collection whose Gemini step answers your# policy questions as JSON. There is no dedicated NSFW or violence model; the# judgment comes from this structured description.bucket = client.buckets.create(bucket_name="user-uploads",bucket_schema={"properties": {"upload": {"type": "image"}}},)collection = client.collections.create(collection_name="user-uploads",source={"type": "bucket", "bucket_ids": [bucket["bucket_id"]]},feature_extractor={"feature_extractor_name": "multimodal_extractor","version": "v1","parameters": {"run_video_description": True,"description_prompt": "Review this image against a content policy.","response_shape": {"type": "object","properties": {"adult": {"type": "boolean"},"violence": {"type": "boolean"},"hate_symbols": {"type": "boolean"},"reason": {"type": "string"},},},},},)# 2. Upload and processclient.buckets.upload(bucket["bucket_id"],blobs=[{"property": "upload", "type": "image", "data": "https://example.com/user-upload.jpg"}],)client.collections.trigger(collection["collection_id"])# 3. Flag anything the policy check markeddocs = client.documents.list(collection["collection_id"], page_size=100)for doc in docs["results"]:verdict = doc.get("json_output") or {}if verdict.get("adult") or verdict.get("violence") or verdict.get("hate_symbols"):print("flagged", doc["document_id"], verdict.get("reason"))
Feature Extractors
Multimodal Extractor
Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.
Retriever Stages
Frequently asked questions
What safety categories are detected?
NSFW, violence, hate speech, self-harm, weapons, drugs, and custom categories you define via taxonomies.
Can I customize the sensitivity threshold?
Yes. Each category has an adjustable confidence threshold. You can also create custom moderation rules using Mixpeek taxonomies.
How fast is moderation?
Image moderation takes <1 second. Video moderation depends on length but processes at roughly 10x real-time speed.
Use Cases Using This Recipe
AI Content Moderation for User-Generated Content
Automatically detect and flag policy-violating content across text, images, and video
95%+ of violations flagged before going live
Pre-publication violation catch rate
UGC platforms, social media companies, marketplace operators, and community platforms processing 100K+ daily uploads requiring trust and safety review
Video Compliance Monitoring
Automatically verify regulatory and policy compliance across video content at scale
10x faster than manual review
Compliance review speed
Compliance teams, broadcast standards departments, advertising regulators, and enterprise communications teams reviewing video content for regulatory adherence
Related Recipes & Resources
Pages on the same stages, extractors and patterns.
Multimodal Extractor
Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.
Brand Safety & Ad Verification Pipeline
Brand safety pipeline for ad networks. Scores video and image creatives against the GARM brand safety floor and suitability categories, which vendors still use after GARM wound down in 2024, before an ad is served.
E-commerce Catalog Enrichment
Automatically enrich product listings with visual attributes, descriptions, and tags extracted from product images. Fill in missing catalog data at scale.
Face Search Pipeline
Detect, align, and embed faces across your image and video library, then search by face identity. Uses SCRFD for detection and ArcFace for 512-dimensional identity embeddings, enabling large-scale face recognition and matching.
Visual Product Search
Enable camera-based product discovery for e-commerce. Customers snap a photo of a product they like, and the pipeline returns visually similar items from your catalog along with pricing, availability, and product metadata.
Visual Similarity Search
Unified visual similarity search across both images and video frames. Query with a photo, screenshot, or frame to discover visually related content regardless of format, with MMR diversification to ensure variety in results.