SlideShare a Scribd company logo
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 57
Face Detection Using Artificial Intelligence and Machine Learning with
Python
P.V.K.S Varun1, Syed.Tasleem2, R.Sivateja3 T.Dheeraj Reddy4
1Department of Electronics and Computer Science Engineering, Mahindra University, Hyderabad
2,3Department of Computer Science and Engineering, Narayana Engineering College, Gudur
4Department of Computer Science and Engineering, Mahindra University, Hyderabad
---------------------------------------------------------------------***---------------------------------------------------------------------
Abstract - The primary objective of this research paper
was to develop a Python-based solution, in conjunction with
the OpenCV computer vision library, for the detection and
recognition of faces in images. The major focus of this study
revolved around face detection and recognition. To achieve
face detection, the algorithm used here is Haar Cascade
algorithm. The advancements in artificial intelligence and
machine learning technologies in the modern era have
significantly elevated the world to new levels. Moreover,
many impossible circumstances which might be challenged
by human beings can be solved with the useful resource of
the brand new technologies along with artificial intelligence
and gadget gaining knowledge of artificial intelligence and
system gaining knowledge of have wide applications in
distinct fields as an example, computer vision and robotics.
Data is essential for machine learning and artificial
intelligence as well as in lots of initiatives. To understand
artificial intelligence actually, by enabling the unlocking of
devices like smartphones through facial recognition, this
paper showcases the practical application of artificial
intelligence. As a result, this paper offers a comprehensive
package that combines theoretical knowledge with real-
world implementations of artificial intelligence and
machine learning technologies
Key Words: Artificial intelligence, Data, Machine learning,
OpenCV, Python, Algorithm
1. INTRODUCTION
In this modern era advanced technologies have become
ubiquitous, encompassing our lives. With compact devices
no larger than the palm of a hand, AI applications grant us
access to vast amounts of information from all corners of
the globe. Through artificial intelligent software, human
life has been streamlined and simplified in numerous
ways. Moreover, the presence of self-learning algorithms
and the abundance of online data, coupled with affordable
computation, have propelled machine learning to
unprecedented heights. Artificial intelligence's popularity
has rapidly grown, becoming necessary in everydays life
and fostering hope for humanity's future. Advancements
in computing power and data handling have demonstrated
AI's success. Machine intelligence, surpassing linear
programming, allows computers to learn from inputs. AI,
an interdisciplinary science, imitates human behaviors
and simplifies life. Despite various definitions, AI
significantly benefits society on a broad scale. This project
focuses on face detection and recognition, a well-known
technology in computer vision and image processing. It
aims to detect human faces in digital images and videos,
whether it's a single face or multiple faces. The main
objective is to use artificial intelligence and machine
learning, along with Python programming and the OpenCV
library, to detect and recognize faces in images. The
project begins with detecting a single face and progresses
to recognition using the same facial image dataset,
identifying the person in the image.
1.1 About Artificial Intelligence
Artificial intelligence (AI) is the ability of computers or
machines to understand and learn tasks, resembling
human intelligence. It encompasses a wide range of
human-like behaviors, such as memory, emotion,
reasoning, and communication, which can be simulated by
computer systems[1]. AI allows machines to learn from
experience and perform tasks like problem-solving,
language comprehension, and medical diagnosis. AI
involves the development of computer systems capable of
performing tasks that typically require human intelligence,
such as visual perception, speech recognition, decision-
making, and language translation.
AI-powered machines possess the capability to analyze
vast amounts of data rapidly and with minimal errors
compared to humans[2]. By utilizing real-world data and
recognizing patterns within it, AI machines can
continuously learn and adapt to new situations. AI has
found applications in various fields, including computer
vision, machine learning, natural language processing,
game theory, cognition, reasoning, and robotics.
Advancements in hardware and software technologies
have propelled the AI field to new heights since the digital
revolution, the advent of personal computers, and the rise
of the internet.
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 58
1.2 History of AI
Artificial Intelligence (AI) has been a captivating subject in
computer science, studied for decades by scientists in
Engineering, Mathematics, and Computer Science,
exploring the concept of artificial brains. The term
"artificial intelligence" was coined in 1956 by John
McCarthy during the first conference on the subject. In
1942, Isaac Asimov introduced the three laws of robotics,
inspiring future AI and robotics researchers. The official
naming of AI occurred during the Dartmouth Conference
in 1956, where the first AI system, the logical theory
program, was introduced.
From the 1970s onward, AI expanded into machine
learning, expert systems, pattern recognition, and
robotics. AI's growth since the 21st century has been
remarkable, transforming human society and evolving
across various disciplines. Advancements in machine
learning, big data, cloud computing, and AI algorithms
have accelerated its development[3]. AI is now extensively
used in search engines, voice recognition, autonomous
vehicles, home appliances, and more. The future promises
even greater AI advancements, benefiting businesses,
healthcare, public sectors, and social interactions with the
increasing use of machine learning for predictive analytics.
2. ARTIFICIAL INTELLIGENCE AND MACHINE
LEARNING
Over the past few years, the terms "artificial intelligence"
(AI) and "machine learning" (ML) have become popular
term. While many people use these terms interchangeably,
it's important to understand that machine learning is a
subset of artificial intelligence. AI encompasses the
development of intelligent computer systems capable of
performing tasks traditionally requiring human
intelligence. It's a vast field, with machine learning being
one application that trains machines to learn from data and
experiences. In machine learning, computer systems use
various algorithms and statistical modules to perform
specific tasks without explicit programming. It plays a
crucial role in achieving artificial intelligence. The
application of AI and ML has grown significantly in various
sectors, with machine learning being utilized to solve real-
world problems by learning from data and making
decisions with minimal human intervention.
Data is a crucial element for both AI and machine learning.
Building systems that understand human conversations,
recognize images, or learn from surroundings requires
ample data. Access to large quantities of data has become a
defining factor for the success of AI-driven companies.
Deep learning is a subset of machine learning, specifically
referring to the use of deep artificial neural networks. It
has gained popularity due to its power and effectiveness in
various applications, such as sound recognition, image
recognition, natural language processing, and
recommender systems.AI is no longer confined to big
companies; it is prevalent in our daily lives. Features like
Face ID on smart phones and automatic voice assistants
demonstrate how AI is integrated into everyday
technology. AI has found applications in various industries,
including finance, travel, healthcare, retail, transportation,
journalism, education, agriculture, entertainment, and
government. For instance, AI improves customer service,
security, and advertising in the finance sector, simplifies
hotel bookings and airport check-ins in the travel industry,
and aids in medical diagnoses and patient care in
healthcare. AI's impact is also evident in the retail industry
through automatic payment machines, inventory
management, and cashier-less shopping experiences. In the
gaming industry, AI is used to create intelligent agents
capable of challenging human players and continually
improving their strategies.
Overall, AI is rapidly changing our society and various
industries, leading to advancements in the smart education
system, agriculture, journalism, entertainment, and more.
Its widespread adoption is transforming everyday life, the
economy, and society as a whole.
Machine learning is an AI subfield that designs algorithms
for computers to learn from data and experiences without
explicit programming[4][5]. It enables AI to make
predictions, identify trends, and understand changes in
fields like finance and medicine. Reinforcement learning
involves trial and error to create consistent policies, as
seen in AI game strategies[6][7]. Machine learning finds
diverse applications in healthcare, automotive, cyber
security, and more. Real-life examples include virtual
assistants, dynamic pricing, email filtering, and fraud
detection.
3. DETECTION AND RECOGNITION OF FACE
USING PYTHON
Face detection and recognition stand out as prominent
computer vision technologies in the realm of artificial
intelligence due to their wide-ranging utility. Face
recognition involves identifying individuals by analyzing
facial attributes through various methodologies[8][9][10].
The human face is integral for communication, person-
specific information, identity validation, and emotional
comprehension via facial cues. The distinctiveness of facial
features and their numerous parameters facilitate accurate
person identification. Human beings effortlessly recognize
faces, leveraging neural cells specialized in discerning
specific local features like edges, lines, angles, and motion.
Computers, however, employ algorithms to extract
distinctive facial characteristics such as skin tone, facial
orientation, shape. The objective of this project was real-
time detection and recognition of individuals using a
webcam. Various platforms exist for creating machine
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 59
vision applications, but this endeavor utilized Python,
coupled with OpenCV – an open-source software library
catering to real-time computer vision and image
processing. Python's compatibility with OpenCV makes it a
reliable choice for webcam-based real-time face detection
and recognition, extending to images. For the recognition
of the face the face detection algorithm is used. Haar
cascade algorithm is used in this work. Its an machine
learning object detection algorithm. To achieve good
accuracy the cascade function is trained using the negative
and positive images. The use of cascade is to do the feature
extraction by filters. These filters are Haar Features called
as Edge, line and rectangle features. The project
commenced with face detection using a pre-trained Haar
Cascade classifier for eyes and faces. Likewise, for
recognition, a classifier was trained on multiple facial
images, each associated with a unique identity. This trained
classifier was subsequently deployed for real-time
recognition. The simplicity and readability of OpenCV
contribute to its popularity for image and video processing,
compatible with a wide array of operating systems
This work is divided into three categories which begins
with detection of face by data gathering, training and
recognition. Figure 1 shows three steps to detect a face.
Fig 1:Steps for face recognition
3.1.1 Face Detection and Data Gathering
In the first step face detection and face gathering was done
by using OpenCV. Secondly Haar cascade model was
developed for training purpose. Sample faces have been
extracted and trained. Then the trained model is used for
recognition. Images are taken in the form of RGB channel.
OpenCV stores these images in Blue, Green and Red
channel. So the image detected is shown in BGR channel.
3.1.2 Training
A dataset as shown Figure. 2 has been taken for training.
To detect and identify particular person the dataset will be
trained with specific identification. Each training image
with similar pixel value will be taken for training.
Fig 2: Image datasets
3.1.3 Recognition
The trained dataset had been taken for recognition. All the
images have been extracted, cropped, resized, are being
converted to grayscale. A classifier had been trained to
classify and recognize the person. The algorithm was
trained using the dataset of facial images. Each image used
for recognition has the same ID, the classifier had been
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 60
trained using previously trained facial data is shown in
figure 3. Firstly, all the modules had been imported. The
classifier method had been created and the data directory
containing facial images had been taken in the classifier
method. Each image has a user ID and an image ID. Finally,
the system performs face recognition. The detected and
recognized face will be displayed with the name. The
recognizer labeled the face as varun, deeraj shivteja and
tasleem etc. Figure. 3 shows the final recognized faces the
person when given with different inputs. If any new
persons face comes into the camera, based on the facial
features. the system recognizes the face.
Fig 3: Recognized images
4. CONCLUSIONS
Artificial intelligence has propelled various sectors to
unprecedented heights. The integration of AI and machine
learning has revolutionized every aspect of society,
tackling seemingly impossible challenges. Machine
learning, as a subset of AI, empowers systems to
autonomously learn and improve through data analysis
and experience. These technologies have found
widespread application in industries like robotics,
healthcare, computer vision and gaming. The benefits of
technological advancements are manifold, significantly
elevating living standards in both developed and
developing countries. AI, essentially computer software
designed to simulate human intelligence, is capable of
processing various forms of data such as images, text,
video and audio. In this work, real-time face detection and
recognition were accomplished using Haar Cascade
machine learning object detection algorithm. This
algorithm identifies objects within an image, particularly
focusing on facial features like eyes and overall structure.
The process involves constructing part features, line
features, and four-rectangle features to pinpoint facial
images accurately. A cascade classifier aids in assessing
the accuracy of the detection, sliding through the image to
determine positive or negative matches. The pervasive use
of AI and machine learning has become increasingly
prevalent across various sectors, ushering in a new era of
human progress and improving overall living standards.
REFERENCES
[1] Farfinkle, S. 2002. iRobot Roomba. MIT Technology
Review. Available:
https://www.technologyreview.com/s/401687/irobo
t-roomba/. Accessed on Dec 14th, 2019.
[2] Flainski, M. 2016. Introduction to Artificial
Intelligence. Springer International Publishing.
Accessed on Dec 4th, 2019.
[3] Beklemysheva, A. 2020. Why Use Python for AI and
Machine Learning. Available:.
https://steelkiwi.com/blog/python-for-ai-and-
machine-learning/. Accessed on 10th March
2020Gouillart, E. 2020. Scikit-Image: Image
Processing. Available:
https://scipylectures.org/packages/scikit-
image/index.html. Accessed on March 25th, 2020.
[4] Helterman, R. 2011. Learning to Program with
Python. Southern Adventist University. Accessed on
March 13th, 2020.
[5] Isoni, A. 2016. Machine learning for the web.
Birmingham: Packet publishing Ltd. Accessed on
March 13th, 2020.
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072
© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 61
[6] Kulkarni, P. & Joshi, P. 2015. Artificial Intelligence.
Delhi: PHI Learning Private Limited. Accessed on Dec
21st, 2019
[7] Li, D. & Du, Y. 2017. Artificial intelligence with
uncertainty. Beijing, China: CRC Press. Accessed on
Dec 11th, 2020.
[8] Nicholson, C. 2019. AI vs ML vs DL. AI Wiki. Available:
https://pathmind.com/wiki/ai-vs-machinelearning-
vs-deep-learning. Accessed on Feb 26th, 2020.
[9] Russell, S. & Norvig, P. 2003. Artificial Intelligence A
Modern Approach. 2. New Jersey: The MIT Press.
Accessed on Dec 13th,:
https://courses.cs.washington.edu/courses/csep590/
06au/projects/history-ai.pdf. Accessed on 12th Dec
2019.
[10] Solem, J. 2012. Programming Computer Vision with
Python. Sebastopol: O'Reilly Media. Accessed on
March 16th, 2020.
BIOGRAPHIES
P.V.K.S Varun
B.Tech,Department of Electronics
and Computer Science
Engineering
Mahindra University,
Hyderabad
Syed.Tasleem
B.TECH(CSE)
Narayana Engineering College,
Gudur-524101
R. VenkataSivateja
B.TECH(CSE)
Narayana Engineering College,
Gudur
T.Dheeraj Reddy
B.Tech,Department of Computer
Science and Engineering,
Mahindra University,
Hyderabad
hor

More Related Content

PDF
Artificial Intelligence & Machine Learning Course
PPTX
Artificial intelligence and Internet of Things.pptx
PDF
Top 12 AI Technology Trends For 2024.pdf
PDF
Artificial Intelligence can Offer People Great Relief from Performing Mundane...
PDF
Artificial Intelligence in Agriculture
PPTX
AI Tools.pptx
PDF
Artificial Intelligence- What Is It.pdf
PDF
5 Amazing Examples of Artificial Intelligence in Action
Artificial Intelligence & Machine Learning Course
Artificial intelligence and Internet of Things.pptx
Top 12 AI Technology Trends For 2024.pdf
Artificial Intelligence can Offer People Great Relief from Performing Mundane...
Artificial Intelligence in Agriculture
AI Tools.pptx
Artificial Intelligence- What Is It.pdf
5 Amazing Examples of Artificial Intelligence in Action

Similar to Face Detection Using Artificial Intelligence and Machine Learning with Python (20)

PPTX
AI & Innovation, Emerging trends & Future directions in AI.pptx
PDF
The Rise of Artificial Intelligence Navigating India’s Digital Future.pdf
PDF
The Rise of Artificial Intelligence Navigating India’s Digital Future.pdf
PDF
How Artificial Intelligence Will Change in 2050?
PPTX
ME_Zagare.pptx
PPTX
The Revolutionary Progress of Artificial Inteligence (AI) in Health Care
PDF
An Analysis of Benefits and Risks of Artificial Intelligence
PPTX
Latest Technologies - MIT ID Innovation
PPSX
Career in artificial inteligence
PPTX
Top AI Stocks in India 1.pptx
PDF
Artificial Intelligence In Information Technology
PPTX
From Automation to Intelligence: How AI is Reshaping Robotics.pptx
PPTX
Artificial Intelligence ppt.pptx
PDF
"Tendências em Inteligência Artificial: Avanços e Desafios em 2024"
PPTX
artificial-intelligence.pptx artificial-intelligence-navigating-the-frontiers...
DOCX
Top 10 Emerging Technology in 2022.docx
PPTX
Impact of Artificial Intelligence in IT Industry
PDF
AI embedded IoT
PPTX
Artificial Intelligence and importance.pptx
PDF
Top 10 greatest ai trends in business 2020
AI & Innovation, Emerging trends & Future directions in AI.pptx
The Rise of Artificial Intelligence Navigating India’s Digital Future.pdf
The Rise of Artificial Intelligence Navigating India’s Digital Future.pdf
How Artificial Intelligence Will Change in 2050?
ME_Zagare.pptx
The Revolutionary Progress of Artificial Inteligence (AI) in Health Care
An Analysis of Benefits and Risks of Artificial Intelligence
Latest Technologies - MIT ID Innovation
Career in artificial inteligence
Top AI Stocks in India 1.pptx
Artificial Intelligence In Information Technology
From Automation to Intelligence: How AI is Reshaping Robotics.pptx
Artificial Intelligence ppt.pptx
"Tendências em Inteligência Artificial: Avanços e Desafios em 2024"
artificial-intelligence.pptx artificial-intelligence-navigating-the-frontiers...
Top 10 Emerging Technology in 2022.docx
Impact of Artificial Intelligence in IT Industry
AI embedded IoT
Artificial Intelligence and importance.pptx
Top 10 greatest ai trends in business 2020
Ad

More from IRJET Journal (20)

PDF
Enhanced heart disease prediction using SKNDGR ensemble Machine Learning Model
PDF
Utilizing Biomedical Waste for Sustainable Brick Manufacturing: A Novel Appro...
PDF
Kiona – A Smart Society Automation Project
PDF
DESIGN AND DEVELOPMENT OF BATTERY THERMAL MANAGEMENT SYSTEM USING PHASE CHANG...
PDF
Invest in Innovation: Empowering Ideas through Blockchain Based Crowdfunding
PDF
SPACE WATCH YOUR REAL-TIME SPACE INFORMATION HUB
PDF
A Review on Influence of Fluid Viscous Damper on The Behaviour of Multi-store...
PDF
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
PDF
Explainable AI(XAI) using LIME and Disease Detection in Mango Leaf by Transfe...
PDF
BRAIN TUMOUR DETECTION AND CLASSIFICATION
PDF
The Project Manager as an ambassador of the contract. The case of NEC4 ECC co...
PDF
"Enhanced Heat Transfer Performance in Shell and Tube Heat Exchangers: A CFD ...
PDF
Advancements in CFD Analysis of Shell and Tube Heat Exchangers with Nanofluid...
PDF
Breast Cancer Detection using Computer Vision
PDF
Auto-Charging E-Vehicle with its battery Management.
PDF
Analysis of high energy charge particle in the Heliosphere
PDF
A Novel System for Recommending Agricultural Crops Using Machine Learning App...
PDF
Auto-Charging E-Vehicle with its battery Management.
PDF
Analysis of high energy charge particle in the Heliosphere
PDF
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
Enhanced heart disease prediction using SKNDGR ensemble Machine Learning Model
Utilizing Biomedical Waste for Sustainable Brick Manufacturing: A Novel Appro...
Kiona – A Smart Society Automation Project
DESIGN AND DEVELOPMENT OF BATTERY THERMAL MANAGEMENT SYSTEM USING PHASE CHANG...
Invest in Innovation: Empowering Ideas through Blockchain Based Crowdfunding
SPACE WATCH YOUR REAL-TIME SPACE INFORMATION HUB
A Review on Influence of Fluid Viscous Damper on The Behaviour of Multi-store...
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
Explainable AI(XAI) using LIME and Disease Detection in Mango Leaf by Transfe...
BRAIN TUMOUR DETECTION AND CLASSIFICATION
The Project Manager as an ambassador of the contract. The case of NEC4 ECC co...
"Enhanced Heat Transfer Performance in Shell and Tube Heat Exchangers: A CFD ...
Advancements in CFD Analysis of Shell and Tube Heat Exchangers with Nanofluid...
Breast Cancer Detection using Computer Vision
Auto-Charging E-Vehicle with its battery Management.
Analysis of high energy charge particle in the Heliosphere
A Novel System for Recommending Agricultural Crops Using Machine Learning App...
Auto-Charging E-Vehicle with its battery Management.
Analysis of high energy charge particle in the Heliosphere
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
Ad

Recently uploaded (20)

PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Digital Logic Computer Design lecture notes
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Welding lecture in detail for understanding
PDF
composite construction of structures.pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
PPT on Performance Review to get promotions
PPTX
Lecture Notes Electrical Wiring System Components
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
DOCX
573137875-Attendance-Management-System-original
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Digital Logic Computer Design lecture notes
Mechanical Engineering MATERIALS Selection
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Welding lecture in detail for understanding
composite construction of structures.pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
R24 SURVEYING LAB MANUAL for civil enggi
PPT on Performance Review to get promotions
Lecture Notes Electrical Wiring System Components
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
573137875-Attendance-Management-System-original
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Mitigating Risks through Effective Management for Enhancing Organizational Pe...

Face Detection Using Artificial Intelligence and Machine Learning with Python

  • 1. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 57 Face Detection Using Artificial Intelligence and Machine Learning with Python P.V.K.S Varun1, Syed.Tasleem2, R.Sivateja3 T.Dheeraj Reddy4 1Department of Electronics and Computer Science Engineering, Mahindra University, Hyderabad 2,3Department of Computer Science and Engineering, Narayana Engineering College, Gudur 4Department of Computer Science and Engineering, Mahindra University, Hyderabad ---------------------------------------------------------------------***--------------------------------------------------------------------- Abstract - The primary objective of this research paper was to develop a Python-based solution, in conjunction with the OpenCV computer vision library, for the detection and recognition of faces in images. The major focus of this study revolved around face detection and recognition. To achieve face detection, the algorithm used here is Haar Cascade algorithm. The advancements in artificial intelligence and machine learning technologies in the modern era have significantly elevated the world to new levels. Moreover, many impossible circumstances which might be challenged by human beings can be solved with the useful resource of the brand new technologies along with artificial intelligence and gadget gaining knowledge of artificial intelligence and system gaining knowledge of have wide applications in distinct fields as an example, computer vision and robotics. Data is essential for machine learning and artificial intelligence as well as in lots of initiatives. To understand artificial intelligence actually, by enabling the unlocking of devices like smartphones through facial recognition, this paper showcases the practical application of artificial intelligence. As a result, this paper offers a comprehensive package that combines theoretical knowledge with real- world implementations of artificial intelligence and machine learning technologies Key Words: Artificial intelligence, Data, Machine learning, OpenCV, Python, Algorithm 1. INTRODUCTION In this modern era advanced technologies have become ubiquitous, encompassing our lives. With compact devices no larger than the palm of a hand, AI applications grant us access to vast amounts of information from all corners of the globe. Through artificial intelligent software, human life has been streamlined and simplified in numerous ways. Moreover, the presence of self-learning algorithms and the abundance of online data, coupled with affordable computation, have propelled machine learning to unprecedented heights. Artificial intelligence's popularity has rapidly grown, becoming necessary in everydays life and fostering hope for humanity's future. Advancements in computing power and data handling have demonstrated AI's success. Machine intelligence, surpassing linear programming, allows computers to learn from inputs. AI, an interdisciplinary science, imitates human behaviors and simplifies life. Despite various definitions, AI significantly benefits society on a broad scale. This project focuses on face detection and recognition, a well-known technology in computer vision and image processing. It aims to detect human faces in digital images and videos, whether it's a single face or multiple faces. The main objective is to use artificial intelligence and machine learning, along with Python programming and the OpenCV library, to detect and recognize faces in images. The project begins with detecting a single face and progresses to recognition using the same facial image dataset, identifying the person in the image. 1.1 About Artificial Intelligence Artificial intelligence (AI) is the ability of computers or machines to understand and learn tasks, resembling human intelligence. It encompasses a wide range of human-like behaviors, such as memory, emotion, reasoning, and communication, which can be simulated by computer systems[1]. AI allows machines to learn from experience and perform tasks like problem-solving, language comprehension, and medical diagnosis. AI involves the development of computer systems capable of performing tasks that typically require human intelligence, such as visual perception, speech recognition, decision- making, and language translation. AI-powered machines possess the capability to analyze vast amounts of data rapidly and with minimal errors compared to humans[2]. By utilizing real-world data and recognizing patterns within it, AI machines can continuously learn and adapt to new situations. AI has found applications in various fields, including computer vision, machine learning, natural language processing, game theory, cognition, reasoning, and robotics. Advancements in hardware and software technologies have propelled the AI field to new heights since the digital revolution, the advent of personal computers, and the rise of the internet.
  • 2. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 58 1.2 History of AI Artificial Intelligence (AI) has been a captivating subject in computer science, studied for decades by scientists in Engineering, Mathematics, and Computer Science, exploring the concept of artificial brains. The term "artificial intelligence" was coined in 1956 by John McCarthy during the first conference on the subject. In 1942, Isaac Asimov introduced the three laws of robotics, inspiring future AI and robotics researchers. The official naming of AI occurred during the Dartmouth Conference in 1956, where the first AI system, the logical theory program, was introduced. From the 1970s onward, AI expanded into machine learning, expert systems, pattern recognition, and robotics. AI's growth since the 21st century has been remarkable, transforming human society and evolving across various disciplines. Advancements in machine learning, big data, cloud computing, and AI algorithms have accelerated its development[3]. AI is now extensively used in search engines, voice recognition, autonomous vehicles, home appliances, and more. The future promises even greater AI advancements, benefiting businesses, healthcare, public sectors, and social interactions with the increasing use of machine learning for predictive analytics. 2. ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING Over the past few years, the terms "artificial intelligence" (AI) and "machine learning" (ML) have become popular term. While many people use these terms interchangeably, it's important to understand that machine learning is a subset of artificial intelligence. AI encompasses the development of intelligent computer systems capable of performing tasks traditionally requiring human intelligence. It's a vast field, with machine learning being one application that trains machines to learn from data and experiences. In machine learning, computer systems use various algorithms and statistical modules to perform specific tasks without explicit programming. It plays a crucial role in achieving artificial intelligence. The application of AI and ML has grown significantly in various sectors, with machine learning being utilized to solve real- world problems by learning from data and making decisions with minimal human intervention. Data is a crucial element for both AI and machine learning. Building systems that understand human conversations, recognize images, or learn from surroundings requires ample data. Access to large quantities of data has become a defining factor for the success of AI-driven companies. Deep learning is a subset of machine learning, specifically referring to the use of deep artificial neural networks. It has gained popularity due to its power and effectiveness in various applications, such as sound recognition, image recognition, natural language processing, and recommender systems.AI is no longer confined to big companies; it is prevalent in our daily lives. Features like Face ID on smart phones and automatic voice assistants demonstrate how AI is integrated into everyday technology. AI has found applications in various industries, including finance, travel, healthcare, retail, transportation, journalism, education, agriculture, entertainment, and government. For instance, AI improves customer service, security, and advertising in the finance sector, simplifies hotel bookings and airport check-ins in the travel industry, and aids in medical diagnoses and patient care in healthcare. AI's impact is also evident in the retail industry through automatic payment machines, inventory management, and cashier-less shopping experiences. In the gaming industry, AI is used to create intelligent agents capable of challenging human players and continually improving their strategies. Overall, AI is rapidly changing our society and various industries, leading to advancements in the smart education system, agriculture, journalism, entertainment, and more. Its widespread adoption is transforming everyday life, the economy, and society as a whole. Machine learning is an AI subfield that designs algorithms for computers to learn from data and experiences without explicit programming[4][5]. It enables AI to make predictions, identify trends, and understand changes in fields like finance and medicine. Reinforcement learning involves trial and error to create consistent policies, as seen in AI game strategies[6][7]. Machine learning finds diverse applications in healthcare, automotive, cyber security, and more. Real-life examples include virtual assistants, dynamic pricing, email filtering, and fraud detection. 3. DETECTION AND RECOGNITION OF FACE USING PYTHON Face detection and recognition stand out as prominent computer vision technologies in the realm of artificial intelligence due to their wide-ranging utility. Face recognition involves identifying individuals by analyzing facial attributes through various methodologies[8][9][10]. The human face is integral for communication, person- specific information, identity validation, and emotional comprehension via facial cues. The distinctiveness of facial features and their numerous parameters facilitate accurate person identification. Human beings effortlessly recognize faces, leveraging neural cells specialized in discerning specific local features like edges, lines, angles, and motion. Computers, however, employ algorithms to extract distinctive facial characteristics such as skin tone, facial orientation, shape. The objective of this project was real- time detection and recognition of individuals using a webcam. Various platforms exist for creating machine
  • 3. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 59 vision applications, but this endeavor utilized Python, coupled with OpenCV – an open-source software library catering to real-time computer vision and image processing. Python's compatibility with OpenCV makes it a reliable choice for webcam-based real-time face detection and recognition, extending to images. For the recognition of the face the face detection algorithm is used. Haar cascade algorithm is used in this work. Its an machine learning object detection algorithm. To achieve good accuracy the cascade function is trained using the negative and positive images. The use of cascade is to do the feature extraction by filters. These filters are Haar Features called as Edge, line and rectangle features. The project commenced with face detection using a pre-trained Haar Cascade classifier for eyes and faces. Likewise, for recognition, a classifier was trained on multiple facial images, each associated with a unique identity. This trained classifier was subsequently deployed for real-time recognition. The simplicity and readability of OpenCV contribute to its popularity for image and video processing, compatible with a wide array of operating systems This work is divided into three categories which begins with detection of face by data gathering, training and recognition. Figure 1 shows three steps to detect a face. Fig 1:Steps for face recognition 3.1.1 Face Detection and Data Gathering In the first step face detection and face gathering was done by using OpenCV. Secondly Haar cascade model was developed for training purpose. Sample faces have been extracted and trained. Then the trained model is used for recognition. Images are taken in the form of RGB channel. OpenCV stores these images in Blue, Green and Red channel. So the image detected is shown in BGR channel. 3.1.2 Training A dataset as shown Figure. 2 has been taken for training. To detect and identify particular person the dataset will be trained with specific identification. Each training image with similar pixel value will be taken for training. Fig 2: Image datasets 3.1.3 Recognition The trained dataset had been taken for recognition. All the images have been extracted, cropped, resized, are being converted to grayscale. A classifier had been trained to classify and recognize the person. The algorithm was trained using the dataset of facial images. Each image used for recognition has the same ID, the classifier had been
  • 4. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 60 trained using previously trained facial data is shown in figure 3. Firstly, all the modules had been imported. The classifier method had been created and the data directory containing facial images had been taken in the classifier method. Each image has a user ID and an image ID. Finally, the system performs face recognition. The detected and recognized face will be displayed with the name. The recognizer labeled the face as varun, deeraj shivteja and tasleem etc. Figure. 3 shows the final recognized faces the person when given with different inputs. If any new persons face comes into the camera, based on the facial features. the system recognizes the face. Fig 3: Recognized images 4. CONCLUSIONS Artificial intelligence has propelled various sectors to unprecedented heights. The integration of AI and machine learning has revolutionized every aspect of society, tackling seemingly impossible challenges. Machine learning, as a subset of AI, empowers systems to autonomously learn and improve through data analysis and experience. These technologies have found widespread application in industries like robotics, healthcare, computer vision and gaming. The benefits of technological advancements are manifold, significantly elevating living standards in both developed and developing countries. AI, essentially computer software designed to simulate human intelligence, is capable of processing various forms of data such as images, text, video and audio. In this work, real-time face detection and recognition were accomplished using Haar Cascade machine learning object detection algorithm. This algorithm identifies objects within an image, particularly focusing on facial features like eyes and overall structure. The process involves constructing part features, line features, and four-rectangle features to pinpoint facial images accurately. A cascade classifier aids in assessing the accuracy of the detection, sliding through the image to determine positive or negative matches. The pervasive use of AI and machine learning has become increasingly prevalent across various sectors, ushering in a new era of human progress and improving overall living standards. REFERENCES [1] Farfinkle, S. 2002. iRobot Roomba. MIT Technology Review. Available: https://www.technologyreview.com/s/401687/irobo t-roomba/. Accessed on Dec 14th, 2019. [2] Flainski, M. 2016. Introduction to Artificial Intelligence. Springer International Publishing. Accessed on Dec 4th, 2019. [3] Beklemysheva, A. 2020. Why Use Python for AI and Machine Learning. Available:. https://steelkiwi.com/blog/python-for-ai-and- machine-learning/. Accessed on 10th March 2020Gouillart, E. 2020. Scikit-Image: Image Processing. Available: https://scipylectures.org/packages/scikit- image/index.html. Accessed on March 25th, 2020. [4] Helterman, R. 2011. Learning to Program with Python. Southern Adventist University. Accessed on March 13th, 2020. [5] Isoni, A. 2016. Machine learning for the web. Birmingham: Packet publishing Ltd. Accessed on March 13th, 2020.
  • 5. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 09 | Sep 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 61 [6] Kulkarni, P. & Joshi, P. 2015. Artificial Intelligence. Delhi: PHI Learning Private Limited. Accessed on Dec 21st, 2019 [7] Li, D. & Du, Y. 2017. Artificial intelligence with uncertainty. Beijing, China: CRC Press. Accessed on Dec 11th, 2020. [8] Nicholson, C. 2019. AI vs ML vs DL. AI Wiki. Available: https://pathmind.com/wiki/ai-vs-machinelearning- vs-deep-learning. Accessed on Feb 26th, 2020. [9] Russell, S. & Norvig, P. 2003. Artificial Intelligence A Modern Approach. 2. New Jersey: The MIT Press. Accessed on Dec 13th,: https://courses.cs.washington.edu/courses/csep590/ 06au/projects/history-ai.pdf. Accessed on 12th Dec 2019. [10] Solem, J. 2012. Programming Computer Vision with Python. Sebastopol: O'Reilly Media. Accessed on March 16th, 2020. BIOGRAPHIES P.V.K.S Varun B.Tech,Department of Electronics and Computer Science Engineering Mahindra University, Hyderabad Syed.Tasleem B.TECH(CSE) Narayana Engineering College, Gudur-524101 R. VenkataSivateja B.TECH(CSE) Narayana Engineering College, Gudur T.Dheeraj Reddy B.Tech,Department of Computer Science and Engineering, Mahindra University, Hyderabad hor