惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
博客园 - Franky
V
V2EX
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
博客园 - 叶小钗
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
About on SuperTechFans
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
D
Docker
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Anti-FraudX: Local Scam Defense Training Powered by Gemma...
Andy Mak · 2026-05-18 · via DEV Community

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

Anti-FraudX is a local anti-scam training platform designed for Hong Kong users. Instead of only showing static scam warnings, it lets people practise scam detection through interactive AI conversations, RPG-style training, and automated multi-agent simulations.

The project focuses on a real local problem: scams are fast, emotional, and often happen through familiar channels such as WhatsApp messages, phishing SMS, fake banking pages, fake police calls, romance scams, investment scams, and QR code payment traps. Anti-FraudX turns those risks into practice scenarios so users can learn how pressure, urgency, trust, and manipulation appear in real conversations.

The system includes:

  • an RPG-style training mode for scenario-based learning
  • a personal chat mode where users can test their reactions
  • an auto simulation mode with scammer, victim, expert, and recorder agents
  • multimodal scam review for suspicious screenshots or images
  • local model serving through Ollama for privacy-sensitive use

The goal is to make anti-fraud education more practical for schools, families, community centers, and privacy-sensitive training sessions.

Demo

Demo video: https://youtu.be/BLYm_VUpMUI

A good walkthrough should show:

  1. a Hong Kong scam scenario, such as a suspicious message or fake payment request
  2. the user entering the RPG or chat mode
  3. the scammer applying pressure or urgency
  4. the victim and recorder agents responding through Gemma 4 E4B
  5. the expert agent explaining the red flags
  6. the final trust score, risk explanation, and learning takeaway

Live demo: https://anti-fraudx-frontend-5gznvtwxga-uc.a.run.app/

Code

Repository: https://github.com/LamChingFung-2425/Anti-FraudX/tree/andy-v7(gemma-4.0)

Important implementation files:

  • backend/main.py — loads environment variables, applies startup checks, and serves the FastAPI app
  • backend/config.py — centralizes model defaults for each agent role
  • backend/services/vision_service.py — handles multimodal scam image analysis
  • docker-compose.yml — defines local deployment defaults for Ollama and the backend
  • backend/tests/test_environment.py — checks that the required Gemma 4 model is available
  • backend/tests/test_vision.py — verifies the vision flow against Gemma 4

Representative runtime configuration:

GEMINI_ENABLED=false
AGENT_MODEL=gemma4:e4b
AGENT_MODEL_VICTIM=gemma4:e4b
AGENT_MODEL_RECORDER=gemma4:e4b

Enter fullscreen mode Exit fullscreen mode

Anti-FraudX keeps the older fine-tuned scammer and expert models for specialist behavior, while Gemma 4 E4B powers the default local reasoning, victim simulation, recorder analysis, and multimodal review paths.

How I Used Gemma 4

I used "Gemma 4 E4B" as the main local reasoning model for Anti-FraudX.

Gemma 4 powers the parts of the system where general reasoning and user-facing explanation matter most:

  • Default model path: handles general local AI responses when no specialist model is selected
  • Victim agent: simulates realistic user reactions under scam pressure
  • Recorder agent: records the simulation, analyzes risk, and generates feedback
  • Vision path: reviews suspicious screenshots and scam-related images

I chose "E4B" because Anti-FraudX is meant to be deployable in realistic community environments. A larger model such as 31B Dense may offer stronger reasoning, but it also increases hardware cost and makes local deployment harder. Smaller models may be easier to run, but they may not provide enough reasoning depth for role-based simulation, trust scoring, and clear anti-fraud explanations.

E4B is the best balance for this project because it is:

  • practical for local Ollama deployment
  • strong enough for short multi-step reasoning
  • suitable for privacy-sensitive scam training data
  • useful for both conversation and moderation-style feedback
  • accessible enough for schools, homes, and community workshops

This makes Gemma 4 more than a chatbot model inside the project. It sits inside the training loop: users interact with scenarios, agents respond, the recorder explains what happened, and the system turns the interaction into a learning experience.