Skip to content

Krishi3/scamurai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scamurai Logo

Scamurai: Detecting fake voices before they fool you.

Scamurai is an AI-powered system that detects deepfake audio from voicemails or recordings. It uses a deep learning model (RawNet2) to analyze raw audio and determine whether a voice is real or AI-generated.


Inspiration

Due to the rise of AI-generated voices, scams have become a lot more convincing and harder to detect. It is especially harder for the elderly who are targeted through phone calls and voicemails. We wanted to build a tool that would help people verify whether a voice is real or fake, before they act on it.


Features

  • Upload or record audio
  • Detect deepfake vs real voice
  • Fast inference using trained model
  • Designed for mobile app integration (SwiftUI)

How It Works

We built Scamurai using RawNet2. It is a deep learning model that processes raw audio directly.

This is how the code works:

  • Upload an audio file (voicemail or recording)
  • Preprocessing of the file (resampling, trimming, normalization)
  • Deep learning model: Audio -> Sinc Filters -> Residual CNN -> GRU -> Prediction
  • Outputs Real or Fake with a confidence score

We trained the model using a gender-based labeled dataset of real and spoofed audio, and integrated the system with a mobile app where users can upload audio for analysis.


Tech Stack

  • PyTorch – Deep learning framework
  • RawNet2 – Deepfake audio detection model
  • FastAPI – Backend API
  • SwiftUI – iOS frontend

Audio Processing: NumPy, SciPy, SoundFile
Languages: Python, Swift


Setup

1. Install dependencies

pip install -r requirements.txt

2. Run the backend server

python server.py

Server will run at:

http://localhost:8000

3. Run the application through XCode

  • Go to settings in your iPhone and turn on Developer Mode
  • Open the application in XCode
  • Connect your iPhone through a USB cable and select it in Device Selector
  • Go to Signing & Capabilities and select your Apple ID under Team
  • Click the Run button

API Usage

Endpoint

POST /analyze

Input

Audio file (.wav)

Example (Python request):

import requests

files = {"file": open("sample.wav", "rb")}
response = requests.post("http://localhost:8000/analyze", files=files)

print(response.json())

Output

{
  "label": "bonafide",
  "confidence": 0.93
}

Running Inference Manually

python infer.py path/to/audio.wav

What's next for Scamurai

In the future, we plan to:

  • Improve accuracy even more with larger and more diverse datasets
  • Enable real-time call detection
  • Improve accessibility for elderly users

Final Thought

Scamurai helps make phone calls safer by giving users a simple way to verify authenticity in an age of AI-generated content.

Spot the fake. Trust the real.


Built @ MacHacks

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors