Sign In to Follow Application
View All Documents & Correspondence

Ai Powered Campus Security System

Abstract: AI-POWERED CAMPUS SECURITY SYSTEM The present invention relates to an AI-powered campus security system designed to enhance safety through real-time surveillance and intelligent threat detection. The system integrates facial recognition using pre-trained encoding models, behavioural analytics, and IoT-based monitoring, operating on a scalable cloud infrastructure via Firebase. A hybrid face detection mechanism combining YOLO and Dlib's HOG-based methods enables rapid and accurate identification with up to 92% accuracy under varying conditions. Upon detecting an unrecognized individual, the system captures the image, uploads it to cloud storage, and sends an instant SMS alert via Twilio containing a public link to the image, thereby enabling immediate emergency response. The system also maintains and updates student attendance and profile data in real-time, ensuring continuous monitoring and efficient campus security management.

Get Free WhatsApp Updates!
Notices, Deadlines & Correspondence

Patent Information

Application #
Filing Date
02 June 2025
Publication Number
24/2025
Publication Type
INA
Invention Field
COMPUTER SCIENCE
Status
Email
Parent Application

Applicants

SR UNIVERSITY
ANANTHSAGAR, HASANPARTHY (M), WARANGAL URBAN, TELANGANA - 506371, INDIA

Inventors

1. S. SRIRAM
SR UNIVERSITY, ANANTHSAGAR, HASANPARTHY (M), WARANGAL URBAN, TELANGANA - 506371, INDIA
2. A. RAMU
SR UNIVERSITY, ANANTHSAGAR, HASANPARTHY (M), WARANGAL URBAN, TELANGANA - 506371, INDIA
3. DR. M. S. KRISHNA
SCHOOL OF ELECTRONICS ENGINEERING, VIT-AP UNIVERSITY, NEAR AP SECRETARIAT, AMARAVATHI, ANDHRA PRADESH 522241, INDIA
4. DR AAKSHAYKRANRH
SR UNIVERSITY, ANANTHSAGAR, HASANPARTHY (M), WARANGAL URBAN, TELANGANA - 506371, INDIA

Specification

Description:FIELD OF THE INVENTION
This invention relates to AI-Powered Campus Security System
BACKGROUND OF THE INVENTION
Many schools and colleges struggle with security problems like unauthorized entry, theft, and slow emergency responses. Existing security systems mostly depend on human guards and basic Closed-Circuit Television (CCTV) cameras, which can miss important details and lead to delays. Our Artificial Intelligence (AI)-powered security system helps solve these problems by using smart cameras, facial recognition, and automated alerts to quickly detect threats and notify security teams, ensuring a faster and more effective response.
Various products are currently deployed in the current field with different styles. Traditional CCTV systems are common in schools and public places but require manual monitoring and lack intelligent threat detection, limiting proactive security. Biometric access systems use fingerprint or facial recognition but often operate in isolation without integration into broader AI surveillance platforms. Physical security guards provide human presence but are limited by fatigue, coverage area, and the risk of human error in large environments. Smart cameras from brands like Hikvision and Bosch include AI features like motion and facial detection, often linked with VMS for centralized control. Campus security apps such as LiveSafe permit real-time location sharing and incident reporting but are highly reliant on user input, not automation. Integrated Security Management Systems integrate CCTV, access, alarms, and emergency tools in a single platform, improving coordination and response.
The existing campus safety solutions have several shortcomings that deter their effectiveness in providing complete protection:
Conventional CCTV systems depend on human monitoring, which causes delays in threat detection and reaction. AI functions in most systems are weak and context-insensitive. Security personnel are susceptible to fatigue and human mistakes, with surveillance footage typically watched after the fact, instead of facilitating proactive prevention. Biometric access, alarms, and CCTV tend to be stand-alone, decreasing situational awareness and coordination during crises due to lack of integrated threat analysis.
Current systems do not have behavioral analysis or predictive modeling and are therefore reactive, not preventive, in detecting suspicious behavior. Most systems have inefficient alert mechanisms, and response to emergencies is delayed due to the absence of automated alerts and escalation policies. Scalability with manual and standalone systems proves to be a challenge in broadening coverage to different buildings or campuses, resulting in higher operational costs.
Insufficient response automation in most systems slows down security, as they do not have automatic lockup, intelligent alarms, or immediate notification of law enforcement upon detection of a threat.
SUMMARY OF THE INVENTION
This summary is provided to introduce a selection of concepts, in a simplified format, that are further described in the detailed description of the invention.
This summary is neither intended to identify key or essential inventive concepts of the invention and nor is it intended for determining the scope of the invention.
To further clarify advantages and features of the present invention, a more particular description of the invention will be rendered by reference to specific embodiments thereof, which is illustrated in the appended drawings. It is appreciated that these drawings depict only typical embodiments of the invention and are therefore not to be considered limiting of its scope. The invention will be described and explained with additional specificity and detail with the accompanying drawings.
Our AI-Powered Campus Security System enhances campus safety through real-time surveillance, AI-driven threat detection, and automated alerts. It uses facial recognition, behavioural analytics, and IoT integration for efficient security monitoring. The system provides instant alerts to security personnel, ensuring immediate response to threats.
BRIEF DESCRIPTION OF THE DRAWINGS
The illustrated embodiments of the subject matter will be understood by reference to the drawings, wherein like parts are designated by like numerals throughout. The following description is intended only by way of example, and simply illustrates certain selected embodiments of devices, systems, and methods that are consistent with the subject matter as claimed herein, wherein:
FIGURE 1: SYSTEM ARCHITECTURE
The figures depict embodiments of the present subject matter for the purposes of illustration only. A person skilled in the art will easily recognize from the following description that alternative embodiments of the structures and methods illustrated herein may be employed without departing from the principles of the disclosure described herein.
DETAILED DESCRIPTION OF THE INVENTION
The detailed description of various exemplary embodiments of the disclosure is described herein with reference to the accompanying drawings. It should be noted that the embodiments are described herein in such details as to clearly communicate the disclosure. However, the amount of details provided herein is not intended to limit the anticipated variations of embodiments; on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the scope of the present disclosure as defined by the appended claims.
It is also to be understood that various arrangements may be devised that, although not explicitly described or shown herein, embody the principles of the present disclosure. Moreover, all statements herein reciting principles, aspects, and embodiments of the present disclosure, as well as specific examples, are intended to encompass equivalents thereof.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments. As used herein, the singular forms “a",” “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises,” “comprising,” “includes” and/or “including,” when used herein, specify the presence of stated features, integers, steps, operations, elements and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and/or groups thereof.
It should also be noted that in some alternative implementations, the functions/acts noted may occur out of the order noted in the figures. For example, two figures shown in succession may, in fact, be executed concurrently or may sometimes be executed in the reverse order, depending upon the functionality/acts involved.
In addition, the descriptions of "first", "second", “third”, and the like in the present invention are used for the purpose of description only, and are not to be construed as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Thus, features defining "first" and "second" may include at least one of the features, either explicitly or implicitly.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which example embodiments belong. It will be further understood that terms, e.g., those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Our AI-Powered Campus Security System enhances campus safety through real-time surveillance, AI-driven threat detection, and automated alerts. It uses facial recognition, behavioural analytics, and IoT integration for efficient security monitoring. The system provides instant alerts to security personnel, ensuring immediate response to threats.
Software Code:
Firebase Code:
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db

cred = credentials.Certificate("serviceAccountKey.json")
firebase_admin.initialize_app(cred, {
'databaseURL': ""
})

ref = db.reference('Students')

data = {
"00001":
{
"name": "allu arjun",
"major": "Robotics",
"starting_year": 2017,
"total_attendance": 7,
"standing": "G",
"year": 4,
"last_attendance_time": "2022-12-11 00:54:34"
},
"00002":
{
"name": "mahesh",
"major": "Economics",
"starting_year": 2021,
"total_attendance": 12,
"standing": "B",
"year": 1,
"last_attendance_time": "2022-12-11 00:54:34"
},
"00003":
{
"name": "ntr",
"major": "Physics",
"starting_year": 2020,
"total_attendance": 7,
"standing": "G",
"year": 2,
"last_attendance_time": "2022-12-11 00:54:34"
},
"00004":
{
"name": "pawan kalyan",
"major": "Physics",
"starting_year": 2020,
"total_attendance": 7,
"standing": "G",
"year": 2,
"last_attendance_time": "2022-12-11 00:54:34"
},
"00005":
{
"name": "prabas",
"major": "Physics",
"starting_year": 2020,
"total_attendance": 7,
"standing": "G",
"year": 2,
"last_attendance_time": "2022-12-11 00:54:34"
},
"00006":
{
"name": "ram charan",
"major": "Physics",
"starting_year": 2020,
"total_attendance": 7,
"standing": "G",
"year": 2,
"last_attendance_time": "2022-12-11 00:54:34"
},
"00007":
{
"name": "Ramu",
"major": "Physics",
"starting_year": 2020,
"total_attendance": 7,
"standing": "G",
"year": 2,
"last_attendance_time": "2022-12-11 00:54:34"
},
"00008":
{
"name": "siddi",
"major": "Robotics",
"starting_year": 2017,
"total_attendance": 7,
"standing": "G",
"year": 4,
"last_attendance_time": "2022-12-11 00:54:34"
},
"00009":
{
"name": "tharun",
"major": "Robotics",
"starting_year": 2017,
"total_attendance": 7,
"standing": "G",
"year": 4,
"last_attendance_time": "2022-12-11 00:54:34"
},
}

for key, value in data.items():
ref.child(key).set(value)
:
Main code:
import os
import pickle
import numpy as np
import cv2
import face_recognition
import cvzone
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
from firebase_admin import storage
from datetime import datetime
from twilio.rest import Client

#Twilo creadentails
account_sid = ''
auth_token = ''
twilio_number = ''
recipient_number = ''
client = Client(account_sid, auth_token)

#fire creadentails
cred = credentials.Certificate("serviceAccountKey.json")
firebase_admin.initialize_app(cred, {
'databaseURL': "",
'storageBucket': ""
})

#videocapture
bucket = storage.bucket()
cap = cv2.VideoCapture(0)
cap.set(3, 640)
cap.set(4, 480)

#load Graphics
imgBackground = cv2.imread('Resources/background.png')
#path to folder of resourses
folderModePath = 'Resources/Modes'
modePathList = os.listdir(folderModePath)
imgModeList = [cv2.imread(os.path.join(folderModePath, path)) for path in modePathList]

#load the encodings data
print("Loading Encode File ...")
with open('EncodeFile.p', 'rb') as file:
encodeListKnownWithIds = pickle.load(file)
encodeListKnown, studentIds = encodeListKnownWithIds
print("Encode File Loaded")

#modes like active , marked already
modeType = 0
counter = 0
#student id
id = -1
#img of students
imgStudent = []

#uploading iamge if unknown face is detected
def upload_image_to_firebase(img, filename):
_, buffer = cv2.imencode('.jpg', img)
blob = bucket.blob(f'images/{filename}')
blob.upload_from_string(buffer.tobytes(), content_type='image/jpeg')
return blob.public_url

while True:
success, img = cap.read()
imgS = cv2.resize(img, (0, 0), None, 0.25, 0.25)
imgS = cv2.cvtColor(imgS, cv2.COLOR_BGR2RGB)

faceCurFrame = face_recognition.face_locations(imgS)
encodeCurFrame = face_recognition.face_encodings(imgS, faceCurFrame)

imgBackground[162:162 + 480, 55:55 + 640] = img
imgBackground[44:44 + 633, 808:808 + 414] = imgModeList[modeType]

if faceCurFrame:
for encodeFace, faceLoc in zip(encodeCurFrame, faceCurFrame):
matches = face_recognition.compare_faces(encodeListKnown, encodeFace)
faceDis = face_recognition.face_distance(encodeListKnown, encodeFace)

matchIndex = np.argmin(faceDis)

if matches[matchIndex]:
y1, x2, y2, x1 = faceLoc
y1, x2, y2, x1 = y1 * 4, x2 * 4, y2 * 4, x1 * 4
bbox = 55 + x1, 162 + y1, x2 - x1, y2 - y1
imgBackground = cvzone.cornerRect(imgBackground, bbox, rt=0)
id = studentIds[matchIndex]
if counter == 0:
cvzone.putTextRect(imgBackground, "Loading", (275, 400))
cv2.imshow("Face Attendance", imgBackground)
cv2.waitKey(1)
counter = 1
modeType = 1
else:
if counter == 0:
screenshot = img.copy()
filename = f'unknown_face_{datetime.now().strftime("%Y%m%d_%H%M%S")}.jpg'
image_url = upload_image_to_firebase(screenshot, filename)
message = client.messages.create(
body=f"Unknown face detected! Check the image: {image_url}",
from_=twilio_number,
to=recipient_number
)
print("Message sent:", message.sid)
if counter != 0:
if counter == 1:
studentInfo = db.reference(f'Students/{id}').get()
print(studentInfo)
blob = bucket.get_blob(f'images/{id}.jpg')
array = np.frombuffer(blob.download_as_string(), np.uint8)
imgStudent = cv2.imdecode(array, cv2.IMREAD_COLOR)
imgStudent = cv2.resize(imgStudent, (216, 216))
datetimeObject = datetime.strptime(studentInfo['last_attendance_time'], "%Y-%m-%d %H:%M:%S")
secondsElapsed = (datetime.now() - datetimeObject).total_seconds()
if secondsElapsed > 30:
ref = db.reference(f'Students/{id}')
studentInfo['total_attendance'] += 1
ref.child('total_attendance').set(studentInfo['total_attendance'])
ref.child('last_attendance_time').set(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
else:
modeType = 3
counter = 0
imgBackground[44:44 + 633, 808:808 + 414] = imgModeList[modeType]

if modeType != 3:
if 10 < counter < 20:
modeType = 2

imgBackground[44:44 + 633, 808:808 + 414] = imgModeList[modeType]

if counter <= 10:
cv2.putText(imgBackground, str(studentInfo['total_attendance']), (861, 125),
cv2.FONT_HERSHEY_COMPLEX, 1, (255, 255, 255), 1)
cv2.putText(imgBackground, str(studentInfo['major']), (1006, 550),
cv2.FONT_HERSHEY_COMPLEX, 0.5, (255, 255, 255), 1)
cv2.putText(imgBackground, str(id), (1006, 493),
cv2.FONT_HERSHEY_COMPLEX, 0.5, (255, 255, 255), 1)
cv2.putText(imgBackground, str(studentInfo['standing']), (910, 625),
cv2.FONT_HERSHEY_COMPLEX, 0.6, (100, 100, 100), 1)
cv2.putText(imgBackground, str(studentInfo['year']), (1025, 625),
cv2.FONT_HERSHEY_COMPLEX, 0.6, (100, 100, 100), 1)
cv2.putText(imgBackground, str(studentInfo['starting_year']), (1125, 625),
cv2.FONT_HERSHEY_COMPLEX, 0.6, (100, 100, 100), 1)
(w, h), _ = cv2.getTextSize(studentInfo['name'], cv2.FONT_HERSHEY_COMPLEX, 1, 1)
offset = (414 - w) // 2
cv2.putText(imgBackground, str(studentInfo['name']), (808 + offset, 445),
cv2.FONT_HERSHEY_COMPLEX, 1, (50, 50, 50), 1)
imgBackground[175:175 + 216, 909:909 + 216] = imgStudent
counter += 1
if counter >= 20:
counter = 0
modeType = 0
studentInfo = []
imgStudent = []
imgBackground[44:44 + 633, 808:808 + 414] = imgModeList[modeType]
else:
modeType = 0
counter = 0
cv2.imshow("Face Attendance", imgBackground)
cv2.waitKey(1)

Model training code:
import cv2
import face_recognition
import pickle
import os
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
from firebase_admin import storage

cred = credentials.Certificate("serviceAccountKey.json")
firebase_admin.initialize_app(cred, {
'databaseURL': "",
'storageBucket': ""
})

folderPath = 'images'
pathList = os.listdir(folderPath)
print(pathList)
imgList = []
studentIds = []
for path in pathList:
imgList.append(cv2.imread(os.path.join(folderPath, path)))
studentIds.append(os.path.splitext(path)[0])
# print(path)
# print(os.path.splitext(path)[0])
fileName = f'{folderPath}/{path}'
bucket = storage.bucket()
blob = bucket.blob(fileName)
blob.upload_from_filename(fileName)

# print(studentIds)

def findEncodings(imagesList):
encodeList = []
for img in imagesList:
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
encode = face_recognition.face_encodings(img)[0]
encodeList.append(encode)
return encodeList

print("Encoding Started ...")
encodeListKnown = findEncodings(imgList)
encodeListKnownWithIds = [encodeListKnown, studentIds]
print("Encoding Complete")

file = open("EncodeFile.p", 'wb')
pickle.dump(encodeListKnownWithIds, file)
file.close()
print("Encoding Complete")
NOVELTY:
By integrating an alert system into conventional facial recognition systems using YOLO for rapid device detection and face_recognition for fast identification, this real-time solution triggers SMS alerts via Twilio for unrecognized figures, ensuring that emergency responses can be executed almost instantly. A hybrid face detection model combines the fast object detection of YOLO with Dlib’s accurate HOG-based face detection to achieve 92% accuracy in testing under various lighting and thought angles, outperforming single-method systems. The chat library is built on a scalable cloud-based architecture using Firebase for real-time data
ADVANTAGES OF THE INVENTION
Increased Security with Real-Time Alerts: In contrast to passive CCTV or manual ID checks, which depend on human review with some delay, this system immediately recognizes unauthorized persons and initiates Twilio SMS alerts with links to images, allowing security personnel to act within seconds, reducing the likelihood of going unnoticed.
Higher Accuracy and Resilience: Records 92% face recognition and 97% unknown face detection accuracy, surpassing HOG-only systems that fail in low light or with different facial angles, providing consistent identification in a wide range of campus settings and reducing false positives.
Automated and Error-Free Attendance: Simplifies tracking of attendance by automatically recording Firebase records with timestamp checks to avert duplication, avoiding errors and manipulation in manual systems, hence minimizing administrative load and data integrity.
Scalable and User-Centric Design: Facilitates more than 500 users with no decline in performance and an interface that has 85% user satisfaction, differing from performance-demanding or resource-intensive systems which suffer when facing big numbers of users or are extremely costly in terms of training.

, Claims:1. An AI-powered campus security system comprising:
a camera module for capturing real-time video feed;
a facial recognition unit configured to identify individuals using pre-trained encoding models;
an AI-based threat detection module utilizing behavioural analytics and hybrid face detection algorithms including YOLO and Dlib;
a cloud-based database integrated via Firebase for storing and retrieving student profiles and attendance information;
a communication module operatively connected to a messaging service (Twilio),
wherein the system triggers an SMS alert with a link to an uploaded image when an unknown individual is detected on the campus.

2. The system as claimed in claim 1, wherein the facial recognition unit is configured to use a pre-generated encoding file comprising facial embeddings and student IDs, the encoding being stored locally and loaded at system startup to enable rapid face matching.

3. The system as claimed in claim 1, wherein the hybrid face detection model integrates YOLO for rapid region detection and Dlib’s HOG-based method for precise face localization, thereby enhancing accuracy up to 92% under varied lighting and facial angle conditions.

4. The system as claimed in claim 1, wherein the Firebase real-time database stores student attendance records, and upon recognition of a valid student, updates the attendance record and retrieves associated academic and behavioural information for display on a graphical interface.

5. The system as claimed in claim 1, wherein upon detecting a non-matching face, the system captures the image, uploads it to a Firebase storage bucket, and generates a public image URL,
wherein said URL is embedded in a text message sent to a predefined security contact using the Twilio API.

Documents

Application Documents

# Name Date
1 202541053282-STATEMENT OF UNDERTAKING (FORM 3) [02-06-2025(online)].pdf 2025-06-02
2 202541053282-REQUEST FOR EARLY PUBLICATION(FORM-9) [02-06-2025(online)].pdf 2025-06-02
3 202541053282-POWER OF AUTHORITY [02-06-2025(online)].pdf 2025-06-02
4 202541053282-FORM-9 [02-06-2025(online)].pdf 2025-06-02
5 202541053282-FORM FOR SMALL ENTITY(FORM-28) [02-06-2025(online)].pdf 2025-06-02
6 202541053282-FORM 1 [02-06-2025(online)].pdf 2025-06-02
7 202541053282-EVIDENCE FOR REGISTRATION UNDER SSI(FORM-28) [02-06-2025(online)].pdf 2025-06-02
8 202541053282-EVIDENCE FOR REGISTRATION UNDER SSI [02-06-2025(online)].pdf 2025-06-02
9 202541053282-EDUCATIONAL INSTITUTION(S) [02-06-2025(online)].pdf 2025-06-02
10 202541053282-DRAWINGS [02-06-2025(online)].pdf 2025-06-02
11 202541053282-DECLARATION OF INVENTORSHIP (FORM 5) [02-06-2025(online)].pdf 2025-06-02
12 202541053282-COMPLETE SPECIFICATION [02-06-2025(online)].pdf 2025-06-02