Real-time audio deepfake detection directly on your phone. Bye bye scam calls!

By Mihai Cosmin

Published: 2025-08-28

URL: https://thehyperplane.substack.com/p/deepfakes-at-the-edge-detect-scams


In this article, we continue where we left off in the 2-part series: Deepfake Audio Detection.

Quick pit stop! If you haven’t checked out the previous articles, now’s a great time to catch up.


Table of contents

  1. Solution overview: what we’ll build
  1. The platform that sped up building the usecase
  1. Data preparation
  1. Training the model
  1. Edge deployment

1. Solution overview: what we’ll build

In the last article we proposed some experiments for future work, one of which was a hybrid approach. It uses three feature extractions as input for the neural networks, making the model more generalised. We continue with this approach as follows:

Some key improvements from last time will be:

  • A new dataset comprising ASVspoof 2021, data samples generated using Coqui, Orpheus and ElevenLabs, and two phone calls from YouTube, 4h+ each;
  • Three feature extractions are given as input to our model: Mel spectrogram, MFCC and LFCC;
  • Deployment on Edge;

2. The platform that sped up building the usecase

When building the solution, I started out on Google Colab as always, however, the complexity was simply too hard to handle for their environment.

That’s when I tested out TractoAI. Let me show you why I made the switch.

What is TractoAI?

TractoAI is a data lake platform for AI data. Using TractoAI, you can:

  • Process massive volumes of data using SQL, Python, Java, Golang, C++ and more;
  • Run distributed training or fine-tuning using PyTorch, TensorFlow or other frameworks;
  • Use AI models in batch and real-time data pipelines;
  • Collaborate with your team members on the same data and models, using notebooks.
  • Build and re-use same containerized environments for development, notebooks, data processing and AI jobs.
  • Define and manage multi-step workflows to orchestrate data processing, model training and inference jobs.

It's similar to Google Colab, but on steroids. You can use your current environment without losing your data.

With Google Colab, you lose all your work when you log off and you’re limited to only one programming language.

To get an idea of what TractoAI is capable of, let's do a parallel with Google Colab. Have you ever encountered this problem?

And then you sign in… BAM! Everything’s gone and your progress resets? Or maybe you’ve run into this frustrating ‘connecting’ problem before?

Ever tried connecting to a hosted runtime, and it takes ages… only to finally connect and BAM!—it’s the wrong environment? Is there no GPU, or is the GPU not the one you tried to connect with? Is it nowhere near what you needed?

I think we've all had this problem at least once, and it's awful, especially if you've had a code running for a while (mine ran for about seven hours). The runtime disconnects, and the worst part is the idea that all the data and saved epochs are forever lost.

That's where TractoAI comes in handy. It's a cloud-based platform built on YTsaurus (we'll come back to this) that eliminates these problems once and for all.

How to get started

The team has a publicly available Playground which allows you to try out the platform. Read more about the Playground in the documentation.

For now, the free plan offers limited resources, including an hour of 2 H100 GPU for one hour usage, 10 CPU cores, 100 GB of disk space and a 24-hour environment — which is better than Google Colab.

Pricing

TractoAI is a net pay-as-you-go platform. You pay for the used compute time and storage quota.

In addition to that, there is a reservation model for medium-size teams that want to reserve a certain amount of compute time and storage with a discount. Higher tiers of the reservation model include additional features, such as a dedicated support of TractoAI developer team.

I personally used Google Colab very often, especially at college and university. One issue was that the free plan had very limited resources, so sometimes I had to purchase computational units to get more resources and a more lasting environment.

I was disappointed not by the fact that 10 dollars didn’t get you many resources, but that the computational units decreased even when I wasn’t using Colab, simply because I had it open. I know they don’t use many units in an hour, but I spent my money on using the resources, not on opening the environment.

That’s why TractoAI is a big game changer: you only pay for what you use, and you can use the resources efficiently.

How it works

TractoAI is built on top of YTsaurus, which is an open-source distributed storage and a computation runtime. It’s also a managed service, which means that it takes care of the underlying infrastructure maintenance.

On a high level, there are following components:

  • Hierarchial distributed storage for tables and files;
  • Compute runtime with a flexible resource management and scheduling;
  • Distributed training runtime Tractorun;
  • Data processing frameworks:
  • YQL engine for large-scale SQL queries;
  • MapReduce engine;
  • SPYT engine on top of Apache Spark;
  • CHYT engine on top of ClickHouse;
  • Integrated notebooks;
  • Workflow orchestrator;
  • Container registry integrated with data processing, training, inference and notebooks.

On a low level, TractoAI operates on Nebius bare metal infrastructure, which excludes a lot of the cloud provider pricing overhead. You may expect to pay up to 10x less than hyperscale cloud providers for the same amount of work done.

Transition from Google Colab to TractoAI

We will use the Orpheus fine-tuned inference Google Colab notebook (this notebook was used to generate some data samples).

As the main part of the implementation is to initialize the working\_directory for YTsaurus.

import yt.wrapper as yt import uuid username = yt.get_user_name() if yt.exists(f"//sys/users/{username}/@user_info/home_path"): home = yt.get(f"//sys/users/{username}/@user_info/home_path") working_dir = f"{home}/tmp/{uuid.uuid4().hex}" else: working_dir = f"//tmp/examples/{uuid.uuid4().hex}" yt.create("map_node", working_dir, ignore_existing=True) print(working_dir)

This is important because it acts as a tracker for each new run. You will have a new working directory with a different UUID for each run.

Afterwards, we will need to create a function that generates a table to which we can add all the requests that we want to give to Orpheus (as in the original notebook, but with the necessary YTaurus modification).

def prepare_tts_data(): """Prepare TTS requests data with various examples""" table_path = f"{working_dir}/tts_requests" yt.create("table", table_path, force=True)

# Add variety of requests with different voices and contexts

tts_requests = [

# Customer service examples

{ "request_id": "the name of the generate audio file", "text": "the text on which you'll do the TTS", "voice": "the name of the voice interpreter(tara, leah, leo, etc)", "model_name": "canopylabs/orpheus-3b-0.1-ft" #default }, . . . ] yt.write_table(table_path, tts_requests) print(f"Created {len(tts_requests)} TTS requests in {table_path}")

# Print summary by voice

voice_counts = {} for req in tts_requests: voice = req["voice"] voice_counts[voice] = voice_counts.get(voice, 0) + 1 print("\nRequests by voice:") for voice, count in sorted(voice_counts.items()): print(f" {voice}: {count} requests") return table_path

The only remaining step is to run the inference.

This part is pretty straightforward because we put this section of the code into a function with the necessary imported libraries and install the dependencies using subprocess.

We need to do the instalation and importing part separately in the function, because the hole running process is not done in the Tracto enviroment, but is done in the YTsaurus enviroment, so all the dependencies that we have locally are not taken into account inside the running process.

@yt.aggregator def bulk_tts_inference(records): """Bulk TTS inference aggregator for YTsaurus""" import sys import logging import time import io import base64 import os

# Setup logging to stderr (required for YT jobs)

logging.basicConfig(stream=sys.stderr, level=logging.INFO) logger = logging.getLogger(__name__) try:

# Install required packages in the job environment

import subprocess logger.info("Installing required packages...") subprocess.check_call([sys.executable, "-m", "pip", "install", "snac==1.2.0", "-q"]) subprocess.check_call([sys.executable, "-m", "pip", "install", "soundfile", "-q"])

# Now import the modules

from snac import SNAC import torch from transformers import AutoModelForCausalLM, AutoTokenizer import numpy as np import soundfile as sf from huggingface_hub import login logger.info("Packages installed successfully") except Exception as e: logger.error(f"Failed to install/import packages: {str(e)}")

# Yield error for all records

for record in records: yield { "request_id": record["request_id"], "success": False, "error": f"Package installation failed: {str(e)}", "audio_bytes": None, "duration_seconds": 0.0, "generation_time": 0.0 } return

# the rest of the code remains the same

...

# Run function with proper error handling

def run_bulk_tts_inference(): """Run bulk TTS inference with pre-installed dependencies"""

# 1. Prepare TTS data

table_path = prepare_tts_data()

# 2. Create result path

result_path = f"{working_dir}/results" print("🚀 Starting bulk TTS inference...") print(f"Input: {table_path}") print(f"Output: {result_path}")

# run the inference

yt.run_map( bulk_tts_inference, table_path, result_path, job_count=1, spec={ "pool_trees": ["hyperplane-gpu-h100"], "mapper": { "gpu_limit": 1, "memory_limit": 32 \* 1024 \* 1024 \* 1024, # 32GB in bytes "cpu_limit": 12,#you can't use more than 12 } } ) print("✅ Bulk TTS inference completed!")

# Display results

display_results(result_path) return result_path

The rest of the code has undergone some minor improvements, but these are all the major changes we need to make to enable us to use TractoAI to run our inference. Don't worry — all the code will be accessible to everyone.

Fact: To make a better comparison, I generated 20 audio samples with Colab and TractoAI, and the difference was outstanding. Colab crashed because it reached the GPU limit (even with a paid subscription), whereas TractoAI generated those 20 samples in about 4 minutes, compared to ~1 minute per sample with Google Colab. So this really is a game changer.


3. Data preparation

Now that we have a basic understanding of how to use TractoAI, we can move on to the next stage: preparing the data.

Although this part didn’t undergo major changes, we need to take it step by step to ensure it can be implemented in a Tracto way.

So, after initialising the working directory (as explained previously), we need to define the structure of our tables, into which we will add all the audio files with their corresponding labels.

schema = yt.schema.TableSchema() schema.add_column("data", type_info.String) schema.add_column("labels", type_info.String)

We now download the data locally from Kaggle and HuggingFace (we uploaded our generated dataset so that we can download it locally onto TractoAI)

For this part, we need to create a function that takes all the data, adds it together into a DataFrame after standardising the audio files from HF to six seconds, balances the whole dataset to prevent overfitting and adds it locally. This step is crucial because the two audio files taken from YouTube are over four hours long.

We need them locally because we can’t use them directly from HF; Tracto can’t handle data from outside YTsaurus.

!pip install pydub import os import pandas as pd import torch import torchaudio import random import numpy as np from sklearn.model_selection import train_test_split from torch.utils.data import Dataset, DataLoader from pathlib import Path from tractorun.backend.tractorch import TensorSerializer import soundfile as sf import io from tqdm import tqdm from datasets import load_dataset from pydub import AudioSegment def balance_dataset(audio_files, labels, margin = 5000):

# Separate by class

real_indices = [i for i, l in enumerate(labels) if l == 1] fake_indices = [i for i, l in enumerate(labels) if l == 0] n_fake_target = len(real_indices) + margin sampled_fake = np.random.choice(fake_indices, min(n_fake_target, len(fake_indices)), replace=False) sampled_indices = list(real_indices) + list(sampled_fake) audio_files = [audio_files[i] for i in sampled_indices] labels = [labels[i] for i in sampled_indices]

# Create DataFrame

data_df = pd.DataFrame({ 'path': audio_files, 'is_fake': labels }) return data_df def prepare_asvspoof_data(base_path): """Process ASVspoof 2021 dataset""" if not os.path.exists(base_path): raise FileNotFoundError(f"Dataset path does not exist: {base_path}")

# Load metadata file

metadata_files = [ 'DF-keys-full/keys/DF/CM/trial_metadata.txt', 'PA-keys-full/keys/PA/CM/trial_metadata.txt', 'LA-keys-full/keys/LA/CM/trial_metadata.txt' ] df_keys_paths = [] for metadata_file in metadata_files: test_path = os.path.join(base_path, metadata_file) if os.path.exists(test_path): df_keys_paths.append(test_path) if df_keys_paths is None: raise FileNotFoundError("Metadata file not found")

# Read metadata

data_entries = [] for df_keys_path in df_keys_paths: with open(df_keys_path, 'r') as f: for line in f: parts = line.strip().split() if len(parts) >= 6: data_entries.append(parts)

# Look for audio files

flac_dirs = [] for pattern in ['ASVspoof2021_DF_eval_part{}/ASVspoof2021_DF_eval/flac', 'ASVspoof2021_PA_eval_part{}/ASVspoof2021_PA_eval/flac', 'ASVspoof2021_LA_eval/ASVspoof2021_LA_eval/flac']: if '{}' in pattern: for part in ['00', '01', '02', '03']: flac_path = os.path.join(base_path, pattern.format(part)) if os.path.exists(flac_path): flac_dirs.append(flac_path) else: flac_path = os.path.join(base_path, pattern) if os.path.exists(flac_path): flac_dirs.append(flac_path) if not flac_dirs: raise FileNotFoundError(f"No audio directories found in {base_path}")

# Create file mapping

file_id_to_path = {} for flac_dir in flac_dirs: for file in os.listdir(flac_dir): if file.endswith('.flac'): file_id = os.path.splitext(file)[0] file_id_to_path[file_id] = os.path.join(flac_dir, file)

# Process files and labels

audio_files = [] labels = [] for entry in data_entries: file_id = entry[1] label = entry[5] if file_id in file_id_to_path: audio_files.append(file_id_to_path[file_id]) if label.lower() in ['spoof', 'fake', 'spoofed']: labels.append(0) elif label.lower() in ['bonafide', 'real', 'genuine']: labels.append(1) else: continue if len(audio_files) == 0: raise ValueError("No audio files could be matched with metadata") data_df = balance_dataset(audio_files, labels) if yt.exists("//home/hyperplane/audio_chunks_6s"): print("Found existing chunks directory!") data_hf_df = load_existing_chunks("//home/hyperplane/audio_chunks_6s") #function used to take data that was already dowloaded locally else: data_hf_df = download_and_split_to_chunks("CosminMihai02/real_fake_audio", hf_token) #This function is used to split the audio files.

The files are split into chunks of six seconds. The chunks are then downloaded locally. data_df = pd.concat([data_df, data_hf_df], ignore_index=True) return data_dfThe augmentation and data preparation remains the same as in this article:

We will not delve deeper into the code, but I will mention the minor improvements made.

We took three feature extractions: Mel Spectogram, LFCC and MFCC, and added them together so that we can give our model three input channels and have a more generalised context of our audio data.

We also modified the duration of each audio file to six seconds to gather more important information, while maintaining real-time inference response and avoiding overfitting due to added blank noise.

import torchaudio.transforms as transforms import random class AudioUtil: ...

# Same as before

@staticmethod def get_mfcc(aud, n_mfcc=64, n_fft=1024, hop_len=None): """Extract MFCC using torchaudio""" sig, sr = aud mfcc_transform = transforms.MFCC( sample_rate=sr, n_mfcc=n_mfcc, melkwargs={ 'n_fft': n_fft, 'hop_length': hop_len, 'n_mels': 128 # Standard value for MFCC } ) mfcc = mfcc_transform(sig) return mfcc @staticmethod def get_lfcc(aud, n_lfcc=64, n_fft=1024, hop_len=None): """Extract LFCC using torchaudio LFCC transform""" sig, sr = aud lfcc_transform = transforms.LFCC( sample_rate=sr, n_lfcc=n_lfcc, speckwargs={ 'n_fft': n_fft, 'hop_length': hop_len } ) lfcc = lfcc_transform(sig) return lfcc
from torch.utils.data import DataLoader, Dataset, random_split class MultiChannelSoundDS(Dataset): def __init__(self, dataframe, mode="original"): """ Args: dataframe: pandas DataFrame with 'path' and 'is_fake' columns mode: augmentation mode """ self.df = dataframe.reset_index(drop=True) self.duration = 6000 # milliseconds self.sr = 16000 self.channel = 1 # mono self.shift_pct = 0.4 self.mode = mode

# Feature extraction parameters

self.n_mels = 64 self.n_mfcc = 64 self.n_lfcc = 64 self.n_fft = 780 self.hop_len = 195 def __len__(self): return len(self.df) def __getitem__(self, idx): row = self.df.iloc[idx] audio_file = row['path'] class_id = row['is_fake']

# Load and preprocess audio

aud = AudioUtil.open(audio_file) aud = AudioUtil.resample(aud, self.sr) aud = AudioUtil.rechannel(aud, self.channel) aud = AudioUtil.pad_trunc(aud, self.duration)

# Apply the augmentations as described in the SoundDS implementation in the previous article.

...

# Extract 3 channels of features

mel_spec = AudioUtil.spectro_gram(aud, n_mels=self.n_mels, n_fft=self.n_fft, hop_len=self.hop_len) mfcc = AudioUtil.get_mfcc(aud, n_mfcc=self.n_mfcc, n_fft=self.n_fft, hop_len=self.hop_len) lfcc = AudioUtil.get_lfcc(aud, n_lfcc=self.n_lfcc, n_fft=self.n_fft, hop_len=self.hop_len)

# Ensure all features have the same dimensions

# mel_spec shape: (1, n_mels, time_frames)

# mfcc shape: (1, n_mfcc, time_frames)

# lfcc shape: (1, n_lfcc, time_frames)

# Get the minimum time frames to ensure consistency

min_frames = min(mel_spec.shape[-1], mfcc.shape[-1], lfcc.shape[-1]) mel_spec = mel_spec[:, :, :min_frames] mfcc = mfcc[:, :, :min_frames] lfcc = lfcc[:, :, :min_frames]

# Stack as 3-channel tensor

features = torch.cat([mel_spec, mfcc, lfcc], dim=0) # (3, n_features, time_frames)

# Apply spectrogram augmentation if needed

if self.mode in ["spectro_augment", "combined"]: features = AudioUtil.spectro_augment( features, max_mask_pct=0.1, n_freq_masks=random.randint(1, 3), n_time_masks=random.randint(1, 3) ) return features, class_id

And now we just need to gather everything, prepare the final dataset, and fill the tables that will be provided to the model during training.

Gathering it all up

We start by creating multiple dataset variations using MultiChannelSoundDS — for example, the original audio and a noise-augmented version. These are combined using ConcatDataset to form a single, unified dataset that includes diverse audio conditions.

Next, we split this full dataset into training and validation sets using random\split. Then, we define the output table paths where the data will be saved (dataset\train\path and dataset\test\_path).

To write the data in a format suitable for Tracto, we serialize each sample (only the input tensor) using TensorSerializer. We take these serialized records and write them to YT tables using yt.write\_table.

This step ensures that both training and validation datasets are efficiently stored and ready to be accessed by Tracto during model training.

from torch.utils.data import random_split, ConcatDataset from yt.wrapper import TablePath from tractorun.backend.tractorch import TensorSerializer from torch.utils.data import Subset, ConcatDataset original_ds = MultiChannelSoundDS(data, mode="original") noise_ds = MultiChannelSoundDS(data, mode="add_noise") time_shift_ds = MultiChannelSoundDS(data, mode="time_shift") pitch_shift_ds = MultiChannelSoundDS(data, mode="pitch_shift") spectro_aug_ds = MultiChannelSoundDS(data, mode="spectro_augment") combined_ds = MultiChannelSoundDS(data, mode="combined") full_augmented_dataset = ConcatDataset([original_ds])#here you can add the other datasets

# ── Prepare data loaders ───────────────────────────────────────────────────

dataset_size = len(full_augmented_dataset) val_size = int(0.2 \* dataset_size) train_size = dataset_size - val_size train_ds, val_ds = random_split(full_augmented_dataset, [train_size, val_size]) dataset_train_path = f"{working_dir}/dataset_train" dataset_test_path = f"{working_dir}/dataset_test" print(dataset_train_path) print(dataset_test_path) def write_dataset_in_batches(dataset, table_path_str, batch_size=10, append=False): ts = TensorSerializer() def row_generator(): for data, label in dataset: serialized_data = ts.serialize(data) yield AudioRow( data=serialized_data, # store as bytes labels=ts.serialize(torch.tensor(int(label), dtype=torch.long)) ) table_path = TablePath(table_path_str, append=append) total_written = 0 i = 0 for batch in tqdm(batcher(row_generator(), batch_size), desc=f"Writing to {table_path_str}"): yt.write_table_structured(table_path, AudioRow, batch) total_written += len(batch) i+=1 print(f"Total rows written to {table_path_str}: {total_written}") return total_written

# Create tables

yt.create("table", dataset_train_path, force=True, attributes={"schema": schema.to_yson_type()}) yt.create("table", dataset_test_path, force=True, attributes={"schema": schema.to_yson_type()})

# Write in batches

write_dataset_in_batches(train_ds, dataset_train_path, append=True) write_dataset_in_batches(val_ds, dataset_test_path, append=True)

4. Training the model

If you read our previous article about implementing the Deepfake audio detector, much of this will look familiar. If you didn't read it, you can find it here:

Therefore, we will skip the explanation of why we chose this approach and focus only on the key differences and main implementations from the original code.

The key differences:

  • We're now using Tracto to run distributed jobs over YT datasets;
  • We updated the model to accept 3-channel inputs instead of a single channel (stacked features);
  • The training loop has been adapted to work within the Tracto pipeline, using YtTensorDataset, TensorSerializer, and toolbox.save\_model() for state management.

What's the same?

  • We still use a ResNet18 + BiGRU + Attention pooling architecture (CRNNWithAttn);
  • The training logic (loss computation, optimizer, early stopping, and accuracy tracking) mirrors the original setup;
  • Inputs are normalized using ImageNet mean/std values.

The link to the full implementation of the notebook and modifications made for the TractoAI environment are here.


5. Edge deployment

Before we jump right into edge deployment, we first need to save our model in a format compatible with Android or edge applications. For this, I have chosen to convert the .pth file into a .pt file (TorchScript), as this maintains the model's accuracy pretty well and is a very good approach.

# Load a real audio file

wav_path = "the/path/to/your/wav/file" # put your audio file here audio_bytes = yt.read_file(wav_path).read() sig, sr = torchaudio.load(io.BytesIO(audio_bytes))

# Use same feature extraction as in MultiChannelSoundDS

...

# Get example input

example_input = extract_features(waveform, sample_rate)

# Paths

pth_path = f"{training_dir}/models/your_model.pth" # your .pth file state_dict_bit = yt.read_file(pth_path).read() state_dict_io = io.BytesIO(state_dict_bit)

# Load model

model = CRNNWithAttn() state_dict = torch.load(state_dict_io, map_location="cpu") model.load_state_dict(state_dict) model.eval()

# TorchScript trace

traced = torch.jit.trace(model, example_input) buffer = io.BytesIO() torch.jit.save(traced, buffer) buffer.seek(0) model_bytes = buffer.read()

# Save to local path

pt_path = f"{training_dir}/models/my_model.pt" yt.write_file(pt_path,model_bytes) print(f"✅ TorchScript model saved at {pt_path}")

Now it's time for the show.

Imagine receiving a call from a random number. You answer, and everything seems normal. Maybe the caller has the same voice as your manager, and coincidentally, you don't even have their phone number. You talk, and they tell you about a transaction that needs to be made to a customer. Everything seems normal and natural; there's nothing suspicious.

But the truth is that the caller is not your manager; it's a deepfake audio that mimics your manager perfectly.

How can you tell? Your phone doesn't have a built-in application that can detect this, nor do you have the option to install an application that can detect deepfake callers.

So what can we do? We have created a fully local application that can do just that. It can detect whether a caller is or isn't a deepfake, and it can even analyze audio files that you might receive via WhatsApp or email to determine whether they are deepfakes. Simply download the files and send them to the analyzer part of the application.

And now for the implementation we leveraged PyTorch Mobile for on-device inference, eliminating the need for cloud connectivity and ensuring privacy.

The results are immediately available for real-time decision making, with detection confidence used to trigger appropriate user alerts during active calls.

Detection Result Processing and Alert Triggering:

// Interpret results - model outputs single value, > 0.5 means fake val fakeProb = if (sigmoidOutput.isNotEmpty()) sigmoidOutput[0] else 0f val realProb = 1f - fakeProb val isFake = fakeProb > 0.5f val result = DetectionResult( timestamp = System.currentTimeMillis(), isFake = isFake, confidence = fakeProb, audioChunkId = chunkId ) detectionResults.add(result) // Update UI overlay withContext(Dispatchers.Main) { updateOverlay(result) } // Log significant detections if (isFake && fakeProb > 0.7f) { Timber.w("HIGH CONFIDENCE DEEPFAKE DETECTED: ${fakeProb \* 100}% (Real: ${realProb \* 100}%)") }

Real time visual alert system:

private fun drawMainStatus(canvas: Canvas, width: Float, height: Float) { val (statusText, statusColor) = when { isAnalyzing -> "🔍 ANALYZING" to colorYellow currentResult == null -> "⏳ WAITING" to colorGray currentResult!!.isFake && currentResult!!.confidence > CONFIDENCE_THRESHOLD -> "⚠️ DEEPFAKE" to colorRed currentResult!!.isFake -> "⚠️ SUSPICIOUS" to colorYellow else -> "✅ AUTHENTIC" to colorGreen } // Apply pulse effect based on threat level statusPaint.textSize = 48f \* pulseScale statusPaint.color = statusColor canvas.drawText(statusText, centerX, statusY, statusPaint) } private fun updatePulseAnimation(isFake: Boolean, confidence: Float) { val (scale, duration) = when { isFake && confidence > CONFIDENCE_THRESHOLD -> 1.4f to 400L // Urgent alert isFake -> 1.2f to 800L // Suspicious warning else -> 1.1f to 2000L // Normal authentic } }

The only limitation is that we were unable to access the caller's voice or the entire call audio. However, we have implemented an alternative approach based on our device speakers. It requires the speaker to be activated so that the application can capture the other side of the call and detect whether it is real or not.

To demonstrate what the application can do, we have prepared a short demo.

P.S. Everything has been uploaded to GitHub for anyone who wants to contribute and try out the application. Don’t forget to show your appreciation to the TractoAI team, who did an amazing job with their environment and application.

For more help with using TractoAI, check out their GitHub, where they have lots of demo notebooks for you to try.

Thanks for reading Hyperplane! Subscribe for free to receive new posts and support our work.