AI THREAT DETECTION
SMART AI FOR SAFER LOGIN
The problem AI THREAT DETECTION solves
AI Threat Detection Project
Project Description
I developed an AI-based Threat Detection system to identify and prevent cyber attacks in real time.
The main goal of this project is to make existing security systems smarter, faster, and safer using Artificial Intelligence.

What problem I am solving
Most traditional systems only check basic rules and fail to detect advanced or unusual attacks.
They cannot clearly differentiate between a legitimate user and a malicious attacker.
Because of this:
- Accounts get hacked
- Sensitive data is exposed
- Security response is slow
What my project does
My project continuously monitors user or system activity such as:
- Login attempts
- Failed authentications
- Location and device behavior
- Access patterns
Using AI models, the system analyzes this data and classifies activity as:
- Normal
- Suspicious
- High-risk threat
Based on the risk level, it triggers alerts or blocks access automatically.
How this project helps people
- Reduces manual security monitoring
- Detects threats in real time
- Prevents unauthorized access
- Improves overall system security
How it makes existing systems easier and safer
Instead of relying only on fixed rules, my system:
- Learns normal behavior patterns
- Adapts to new attack methods
- Responds instantly to threats
This reduces human error and increases protection.
Technologies used
- Frontend: HTML, CSS, JavaScript
- Backend: FastAPI (Python)
- AI/ML: Machine learning models for threat detection
- Alerts: Real-time notifications
Real-world use case
If a user usually logs in from one location and suddenly multiple failed login attempts occur from a different region,
the system identifies it as a high-risk threat and immediately restricts access.
Conclusion
This project demonstrates how AI can be used to strengthen cybersecurity by detecting threats early and responding automatically, making digital systems more reliable and secure.


Challenges we ran into
C
hallenges We Ran Into
- JavaScript
addEventListener
Null Error
One major issue we faced was the error:
Cannot read properties of null (reading 'addEventListener')
This happened because the JavaScript code was trying to access HTML elements before the page was fully loaded.
How we fixed it:
- Ensured the script was loaded at the end of the HTML file
or - Wrapped the JavaScript code inside
DOMContentLoaded
This ensured the elements were available before attaching event listeners.
- Connecting Frontend with Backend (FastAPI)
Initially, the frontend could not properly communicate with the FastAPI backend.
Requests were either failing or not returning responses.
How we fixed it:
- Verified API endpoints and request methods
- Enabled CORS in FastAPI
- Used proper JSON request and response formats
This allowed smooth communication between the website and the backend.
- Handling False Positives in That Detection
At first, the AI model was marking normal login attempts as suspicious due to limited data.
How we fixed it:
- Adjusted the threshold values
- Improved feature selection (failed attempts, login frequency, location change)
- Tested with more realistic sample data
This reduced incorrect threat detection.
- Real-Time Alert Triggering
Alerts were not triggering instantly when a high-risk threat was detected.
How we fixed it:
- Optimized the detection logic
- Triggered alerts immediately after risk classification
- Ensured the alert function was called only for high-risk cases
- Managing Project Structure
As the project grew, files became harder to manage.
How we fixed it:
- Organized the project into clear folders:
frontend
backend
model
- Added proper naming conventions and documentation
What We Learned
These challenges helped us understand real-world development issues such as debugging, system integration, and improving AI reliability. Overcoming them made the project more stable, secure, and production-ready.
Tracks Applied (2)
ELeven Labs
Eleven Labs
Gemini API
Gemini
