This is a Flask-based web application designed to detect potential scam calls in real-time using speech recognition with the Vosk model and phone number lookup via a Telegram bot. The app monitors audio input for scam-related keywords in Hindi and alerts users if a threshold is exceeded. It also allows users to look up phone numbers for additional details.
scam-detection-app/
├── app.py
├── vosk-model-small-hi-0.22/
│ └── [Vosk model files]
├── static/
│ └── style.css
├── templates/
│ └── index.html
└── README.md
- Python 3.8+
- Vosk model (
vosk-model-small-hi-0.22
) downloaded and placed in the project root - Telegram API credentials (API_ID, API_HASH, PHONE_NUMBER)
- Node.js (for SocketIO client, if needed)
- Git for version control
-
Clone the Repository
git clone https://github.com/shreyash729/Kavach---ReTime-Phone-Scam-Detection-System.git cd Kavach---ReTime-Phone-Scam-Detection-System
-
Install Dependencies Install the required Python packages:
pip install flask flask-socketio eventlet vosk pyaudio numpy telethon
-
creates a virtual environment:
python -m venv venv
-
Configure Telegram environment Variables:
- Obtain your Telegram API credentials from my.telegram.org.
set TELEGRAM_API_ID=YOUR_TELEGRAM_API_ID # your telegram api ID
set TELEGRAM_API_HASH=YOUR_TELEGRAM_API_HASH # your telegram api hash
set PHONE_NUMBER=PHONE_NUMBER # Your phone number Include country code (e.g., +91xxxxxx)
-
Run the Application
python app.py
The app will start on
http://localhost:5000
.
- Access the Web Interface: Open
http://localhost:5000
in a browser. - Phone Number Lookup: Enter a phone number and click "Lookup" to fetch details via the Telegram bot.
- Call Monitoring: Click "Accept Call" to start real-time audio monitoring. The app will detect scam keywords and alert if the threshold (2 keywords) is reached.
- Reject Call: Stops the audio monitoring.
- Real-time scam detection using Vosk speech recognition for Hindi keywords.
- Phone number lookup via Telegram bot integration.
- Responsive UI with SocketIO for real-time alerts.
- Customizable scam keyword list and detection threshold.
- Flask: Web framework
- Flask-SocketIO: Real-time communication
- Eventlet: Asynchronous I/O
- Vosk: Speech recognition
- PyAudio: Audio input
- NumPy: Audio data processing
- Telethon: Telegram API client
- Ensure a working microphone for audio input.
- The Vosk model path must be correctly set in
app.py
. - Telegram bot (
@TrueCaller_Z_Bot
) must be accessible and responsive. - Replace
vosk-model-small-hi-0.22
withvosk-model-hi-0.22
for better Accuracy - Download Vosk NLP model from
https://alphacephei.com/vosk/models
- Fork the repository.
- Create a feature branch (
git checkout -b feature-branch
). - Commit changes (
git commit -m "Add feature"
). - Push to the branch (
git push origin feature-branch
). - Create a pull request.
This project is licensed under the MIT License.