ScrollSafe is a full-stack system that flags likely AI-generated short-form videos in real time. It combines a Chrome extension, FastAPI services, Redis/Celery workers, residential resolvers, and a Hugging Face inference endpoint to overlay trustworthy signals on YouTube Shorts, Instagram Reels, and other feeds while you browse. This repository is the home for all future ScrollSafe development and the project I present to recruiters.
Recognition: Built for Google Developer Group Windsor’s Innovate with AI challenge (107 participants / 15 teams). ScrollSafe was selected as one of 6 finalists to demo live on Nov 7 and won 2nd place during GDG DevFest on Nov 8. Demo + write-up: Devpost.
Stable Release (YouTube-first): The publicly shared v1 Chrome extension-which is the version most recruiters will evaluate-focuses on YouTube Shorts and is proven stable there. It is available on GitHub releases as a packed
.rarfor manual loading: ScrollSafe Chrome Extension v1.0.0. Instagram Reels and TikTok adapters are in active development inside this monorepo. Once those implementations are production-ready, we plan to publish ScrollSafe to the Chrome Web Store so users can install updates seamlessly.
/api/analyze), deep-scan job orchestration, admin metrics, and caching (Redis/Postgres).
| Path | Description |
|---|---|
scrollsafe-frontend/ |
Chrome Extension (Manifest V3) content scripts, adapters (YouTube, Instagram, TikTok), badge UI, and background service worker that proxies API requests and captures frames. |
scrollsafe-backend/ |
FastAPI service exposing heuristics + deep scan APIs, admin metrics, and cache/database integration (Redis/Postgres). Includes Celery job helpers and heuristics. |
resolver/ |
Residential resolver tooling that runs yt-dlp → ffmpeg frame capture behind a Cloudflare tunnel to avoid cloud IP throttling; provides proxy-aware pipelines and local smoke tests. |
scrollsafe-doomscroller/ |
Discovery/analyzer workers, DB schema, and scripts that crawl trending shorts, run batch inference, and backfill caches (“doomscroller pipeline”). |
scrollsafe-inference-api/ |
FastAPI inference endpoint that batches frames and serves the fine-tuned haywoodsloan/ai-image-detector-dev-deploy SwinV2 model (GPU-friendly). |
scrollsafe-inference-api-cpu/ |
CPU-optimized variant of the inference API for low-cost deployments. |
out/, test/ |
Local artifacts and system tests (ignored in git). |
chrome.tabs.captureVisibleTab./api/analyze runs metadata heuristics (regex + rules)./api/deep-scan enqueues deep scans and returns job IDs./api/deep-scan/{job_id} polls Redis for status/results.yt-dlp → ffmpeg → inference → aggregation), discovery sweepers, analyzer jobs, and admin-label syncing.{"real": p, "artificial": q} per frame plus batch timings./extract-and-infer, ensuring reliable downloads even when cloud IPs are throttled.design.png (also embedded above) for end-to-end data flow.MutationObserver, OffscreenCanvas).yt-dlp, ffmpeg, residential proxies, cookie-based authentication for YouTube.| Challenge | Solution |
|---|---|
| Dynamic DOMs (YouTube/Instagram re-rendering) | Implemented modular adapters + MutationObservers. The pipeline re-attaches badges, refreshes metadata, and prevents result bleed-over. |
Cloud IP throttling of yt-dlp / ffmpeg |
Separated frame extraction into the resolver/ app running on a residential IP via Cloudflare Tunnel. Added progressive-MP4 preference, HLS/DASH fallbacks, cookie-aware retries, and idempotent deep-scan locks. |
| Balancing latency vs. accuracy | Debounced heuristics (2 s), cache-aside (Redis/Postgres), and asynchronous deep scans. Badge always shows immediate heuristics while deep scans run in the background. |
| Frame extraction robustness | Multi-stage extractor: metadata probe → fast path (yt-dlp pipe) → fallback B (direct ffmpeg with headers) → fallback C (temp download). Captures 16 evenly spaced frames per clip. |
git clone <repo-url>
cd Hackathon-project
python -m venv .venv && . .venv/Scripts/activate # or source .venv/bin/activate
pip install -r scrollsafe-backend/requirements.txt
.env.example files inside each subproject (frontend uses runtime config).YOUTUBE_API_KEY, HUGGING_FACE_API_KEY, INFER_API_URL, ADMIN_API_KEY.IPRoyal) and YTDLP_COOKIES_FILE.cd scrollsafe-backend
uvicorn main:app --reload
cd scrollsafe-backend
celery -A deep_scan.tasks worker -Q deep_scan -l info
cd ../resolver
python main_run.py # smoke-test pipeline / resolver connectivity
chrome://extensions, enable Developer Mode, “Load unpacked” → scrollsafe-frontend/.Tip: For production, deploy the inference API (
scrollsafe-inference-api), backend, and workers via Docker Compose. Residential resolver can run on a local machine usingstart-resolvers.ps1.
scrollsafe-backend/api_requests.log and performance.log capture heuristics latency (decorated via timing_logger.py)./api/admin/metrics) exposes queue depth, verdict counts per label, and recent analyses for dashboards.logger.info, logger.warning) across backend and workers for easy ingestion.design.png.scrollsafe-frontend/icons/ and design.png.“ScrollSafe is a Chrome extension and backend that flags likely AI-generated short-form videos in real time. I built it end-to-end—extension UI, FastAPI services, Redis/Celery queues,
yt-dlp → ffmpegframe extraction, and a SwinV2 inference endpoint. We engineered around cloud IP throttling by tunneling a trusted edge and added resilient fallbacks. The MVP achieved ~80% internal accuracy, 80% fewer heuristics calls via debouncing, and 100% badge attach reliability across QA. We placed 2nd at GDG Windsor’s Innovate with AI after live demos to judges and DevFest attendees.”
Thanks for checking out ScrollSafe! Let me know if you’d like a guided walkthrough or deployment assistance.