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:
- a Hong Kong scam scenario, such as a suspicious message or fake payment request
- the user entering the RPG or chat mode
- the scammer applying pressure or urgency
- the victim and recorder agents responding through Gemma 4 E4B
- the expert agent explaining the red flags
- 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
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.























