Inspiration
In an era where technology is increasingly accessible, many vulnerable populations - especially the elderly - are becoming prime targets for malicious actors. Social media has become a breeding ground for sophisticated phishing and social engineering scams. We wanted to create a loyal digital companion that helps people navigate online interactions more mindfully and safely.
What it does
Watchdog is a browser extension that acts as a real-time security layer for Facebook Messenger. It "sniffs" out suspicious patterns in chat messages.
A custom-trained machine learning model identifies linguistic patterns common in fraud, highlighting messages in Yellow (Suspicious) or Red (Dangerous). When a user clicks an alert, Watchdog "fetches" an analysis from Google Gemini AI, providing a simple, one-sentence explanation of why the message was flagged, empowering users to understand the scam rather than just fearing it.
How we built it
We built a custom LSTM [long short-term memory] neural network using PyTorch, and utilized GloVe Twitter Word Embeddings to ensure the model understood the nuances of social media language.
The evaluation metrics on the test set are as followed:
Accuracy: 0.9761 Precision: 0.8651 Recall: 0.9732 F1 Score: 0.9160 PR-AUC: 0.9871 Risk Distribution on the Test Set Not Spam (0): 1421 (84.9%) Medium Risk (1): 17 (1.0%) High Risk (2): 235 (14.0%)
The backend is powered by FastAPI to orchestrate the communication between the ML model and Google Gemini API. It processes incoming messages, tokenizes the text, and returns both a threat level and human-readable reasoning for the assessment.
The frontend is a Chrome Extension [Manifest v3]. We used MutationObservers to watch for new message bubbles in the DOM and injected a Shadow DOM to host our UI to ensure consistent compatibility with Facebook's CSS.
Challenges we ran into
Finding a suitable training dataset was challenging. We initially trained our ML model for real-time scam detection on a dataset of non-spam and spam SMS messages. However, this model was too sensitive and flagged almost everything as suspicious.
Additionally, there were complications with connecting the front-end with the back-end; in particular, ensuring that the pop-up explanation would properly display the explanation provided by Gemini API.
Regarding the UI, settling on a cohesive and consistent design motif, as well as the practical implementation of these concepts, was challenging.
What we learned
For vulnerable populations such as the elderly, the communication of a threat is equally as important as the detection of the threat itself.
What's next for Watchdog
We hope to extend the detection functionality beyond just Facebook messenger, to other social media such as Instagram. Additionally, we would like to develop a more holistic and nuanced detection system which takes into account a wider context of previous messages (rather than only one message at a time) as well as profile analysis. This would allow detection of more subtle fraud tactics such as the "honeypot" scam, characterized by deceptive, seemingly normal interactions seeking to gain the victims' trust.
Log in or sign up for Devpost to join the conversation.