Skip to content

SomdattaNag/Security-Screening-System

Repository files navigation

Real-Time Security Screening System

License GSSoC'25 Open Issues

Open Source

Thanks Banner Typing SVG

πŸ“Š Project Insights

🌟 Stars 🍴 Forks πŸ› Issues πŸ”” Open PRs πŸ”• Closed PRs πŸ› οΈ Languages πŸ‘₯ Contributors
Stars Forks Issues Open PRs Closed PRs Languages Count Contributors Count

πŸ“‘ Table of Contents

🌟 Exciting News...

πŸš€ This project is an official part of GirlScript Summer of Code – GSSoC'25! πŸ’ƒπŸŽ‰πŸ’» We're thrilled to welcome contributors from all over India and beyond to collaborate, build, and grow Security-Screening-System! Let’s make learning and career development smarter – together! πŸŒŸπŸ‘¨β€πŸ’»πŸ‘©β€πŸ’»

πŸ‘©β€πŸ’» GSSoC is one of India’s largest 3-month-long open-source programs that encourages developers of all levels to contribute to real-world projects 🌍 while learning, collaborating, and growing together. 🌱

🌈 With mentorship, community support, and collaborative coding, it's the perfect platform for developers to:

  • ✨ Improve their skills
  • 🀝 Contribute to impactful projects
  • πŸ† Get recognized for their work
  • πŸ“œ Receive certificates and swag!

πŸŽ‰ I can’t wait to welcome new contributors from GSSoC 2025 to this Security-Screening-System project family! Let's build, learn, and grow together β€” one commit at a time. πŸ”₯πŸ‘¨β€πŸ’»πŸ‘©β€πŸ’»

🧩 Problem Statement

In places like airports, hotels, and event venues, security checks are usually done by humans. They check ID cards and watch people manually. But this process takes a lot of time and can have many mistakes. For example, someone might use a fake ID, or look very similar to another person, and the security team might not notice. It’s also hard for them to quickly find people who are dangerous or not allowed to enter. Because of this, there is a growing need for a better system. We need a smart, automatic solution that can check people’s identities using their face (facial recognition). This system should work smoothly without stopping the normal flow of people. It should also be safe, accurate, and easy to use in many places.

-----------------------------------------------------

πŸ’‘ Proposed Solution

We are creating a smart security system that uses facial recognition with the help of OpenCV. This system will work in real-time using a webcam at places like airports or hotels. When a person walks in front of the camera, the system will scan their face and compare it with a database of known criminals, wanted people, or other threats. If it finds a match, it will quickly raise a threat alert and send warning messages or phone alerts to the authorities, depending on how serious the threat is. If there’s no match and the person is safe, a safe signal will be shown, and they can move ahead without any issues.This makes security faster, smarter, and more reliable.

-----------------------------------------------------

πŸ‘₯ Contributors and Learning Resources

As of July 2025, this project is a part of GirlScript Summer of Code 2025. Please read the README file carefully to understand the project workflow. For contribution tips and extended documentation, see the Learn Guide. Only the issue with the label gssoc25 are open for GSSoC contributors right now.

-----------------------------------------------------

✨ Features

  1. The system uses a webcam to scan each person and detect their face.
  2. Before running face recognition, the system now uses a YOLOv5-based Accessory Detection Module to check if the person is wearing any mask, sunglasses, or cap.
  3. If any accessory is detected:
    • A GUI warning is shown telling the individual to remove it.
    • Face recognition is paused (frames keep running, no freezing).
    • Once the accessory is removed for a few consecutive frames, normal face recognition resumes.
  4. Once a clear face is detected, it checks the system’s database to see if the person is on a list of wanted, banned, or runaway individuals.
  5. The system takes around 10 seconds to carefully analyze the face and decide if it matches someone in the database.
  6. If the person is not in the database, a safe signal is shown, and they can continue without any problem.
  7. If the system does find a match: A threat alert is activated. An email or SMS is sent to the authorities based on how serious the threat is (low, medium, or high). If the match is very strong (over 90% confidence), a call alert is also triggered for urgent action.
  8. The system automatically saves the image and details of the matched person for legal and verification records.
  9. To improve accuracy, the system supports data augmentation. You can run a file called data_augmentation.py after adding new images to make the face recognition work better.

-----------------------------------------------------

πŸ” Workflow

The system starts by organizing images into foldersβ€”one for each wanted person. More images improve accuracy. These images are then encoded using the face_recognition library, converting facial features into numerical values and labeling them based on folder names.

During real-time scanning with OpenCV, the webcam detects and extracts faces, which are then compared with stored encodings. If the similarity is below 0.4, the person is considered a match. The system waits 10 seconds to confirm identity and avoids duplicate alerts within 30 seconds.

If no match is found, a safe_alarm is triggered. If a match is found, a threat_alarm is activated, followed by email and SMS alerts containing the individual’s name, photo, time, and IP location. If the threat is major (confidence > 90%), a call alert is also triggered.

Matched faces and related data (name, time, confidence) are saved to a .csv file for tracking and verification. To improve recognition accuracy, users can run data_augmentation.py after adding new images.

-----------------------------------------------------

Technology UsedπŸš€

Python, OpenCV, Face Recognition, SMTPLib, playsound, PyTorch, Tkinter, Twilio, Pillow.

-----------------------------------------------------

Getting Started

1. Start by forking the Security-Screening-System repository.

2. Clone your forked repository:

git clone https://github.com/<your-github-username>/Security-Screening-System

3. Navigate to the new project directory:

cd Security-Screening-System

4. Set upstream command:

git remote add upstream https://github.com/SomdattaNag/Security-Screening-System

5. Create a new branch:

git checkout -b YourBranchName

or

git branch YourBranchName
git switch YourBranchName

6. Sync your fork or local repository with the origin repository:

In your forked repository, click on the Fetch upstream button. Then select Fetch and merge to sync changes from the original repo.

Alternatively, use Git CLI to sync with the original repository:

git fetch upstream
git merge upstream/main

7. After syncing, go ahead and make your changes in the codebase.

8. Before Running main.py, Install Requirements

pip install -r requirements.txt

9. Stage your changes and commit them:

⚠️ Make sure not to commit sensitive files like .env or any files listed in .gitignore.

⚠️ Make sure not to run the commands git add . or git add *. Instead, stage your changes for each file/folder

git add file/folder
git commit -m "<your_commit_message>"

10. Push your changes to GitHub: Use the command below to push your branch to your GitHub repository:

git push origin YourBranchName

11. Create a Pull Request!

πŸŽ‰ Congratulations! You've successfully made your first contribution!

-----------------------------------------------------

Rules for Contributors

1. Assignement to contributors is on a FCFS ( First Come First Serve basis), whoever comments first gets assigned first.

2. The contributors who comes next, gets assigned if the previous assignee doesn't complete their task.

3. General deadline for each level of assignment: 1. level 1: maximum 2-3 days 2. level 2: maximum 5-6 days 3. level 3: maximum 7-8 days 4. If contributors want more days to work, deadline can be extended.

-----------------------------------------------------

πŸ“ Note

  1. This project is a working prototype built for security checkpoint scenarios. It showcases the core logic of real-time facial recognition and threat detection. The system is modular and can be expanded with IoT devices or a GUI if needed.

  2. The matching threshold is set lower to avoid false positives. As a result, a few false negatives may occur.

  3. For better accuracy, it's advised to include a large and diverse set of images for each individual in the dataset.

  4. The system only stores data of individuals flagged as threats or confirmed matches for legal verification. No data is stored for safe or non-matching individuals, ensuring user privacy. All stored data is handled with strict confidentiality.

  5. Because YOLOv5 is licensed under AGPL-3.0, any modifications or distribution of this project that include YOLOv5 must also comply with the same license terms.

-----------------------------------------------------

Acknowledgments

  • This project uses Ultralytics YOLOv5 (AGPL-3.0) for training an accessory-detection model.
  • Dataset annotations were created using RoboFlow.
  • The trained model weights (yolov5n_best.pt) are derived from YOLOv5’s pretrained yolov5n.pt.
  • The folder yolov5 contains necessary files from Ultralytics YOLOv5 needed to load model.

-----------------------------------------------------

Legal

  • Uses Ultralytics YOLOv5 (AGPL-3.0).
  • Custom weights (yolov5n_best.pt) trained via RoboFlow.
  • AGPL-3.0 applies to all derivative works.

-----------------------------------------------------

πŸ“œ Code of Conduct

Please refer to the Code of Conduct for details on contributing guidelines and community standards.

πŸ€πŸ‘€ Contribution Guidelines

We love our contributors! Please read the Readme and Learn Guide carefully.

Thank you once again to all our contributors who has contributed to Security-Screening-System! Your efforts are truly appreciated. πŸ’–πŸ‘

Contributors

Contributors

See the full list of contributors and their contributions on the GitHub Contributors Graph.

Show some Red Heart by starring this awesome repository!

πŸ’‘ Suggestions & Feedback

Feel free to open issues or discussions if you have any feedback, feature suggestions, or want to collaborate!

πŸ™Œ Support & Star

If you find this project helpful, please give it a star ⭐ to support more such educational initiatives!

πŸ“„ License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).

The project includes code derived from the YOLOv5 repository, which is also licensed under AGPL-3.0.

By using this project, you agree to comply with the terms of the AGPL-3.0 license.

This project is licensed under the MIT License - see the License file for details.

⭐ Stargazers

🍴 Forkers

Forkers

Glowing Star Give us a Star and let's make magic! Glowing Star

Mirror Ball

πŸ‘¨β€πŸ’» Built with ❀️ by the Security-Screening-System Team

❀️ Somdatta Nag and Contributors ❀️ open an issue | Report Bug

Ready to show off your coding achievements? Get started with Security-Screening-System today! πŸš€