0% found this document useful (0 votes)
47 views11 pages

ML Face Detection Project

The document outlines a project focused on face detection using a Haar Cascade classifier and validating detected faces with an SVM classifier based on width and height features. It details the technologies used, including Python and OpenCV, and describes the real-time detection pipeline along with challenges and future enhancements. The project successfully integrates machine learning with computer vision for effective face detection and validation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views11 pages

ML Face Detection Project

The document outlines a project focused on face detection using a Haar Cascade classifier and validating detected faces with an SVM classifier based on width and height features. It details the technologies used, including Python and OpenCV, and describes the real-time detection pipeline along with challenges and future enhancements. The project successfully integrates machine learning with computer vision for effective face detection and validation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

ML-Enhanced Face Detection

Using OpenCV & SVM Classifier

Narisetty Sumanth
Project Overview
• Objective:
• - Detect faces using Haar Cascade classifier
• - Validate faces using an SVM based on width &
height features

• Technologies Used:
• - Python
• - OpenCV
• - Machine Learning (SVM)
Face Detection - Haar Cascade
• Description:
• - Haar features are used to identify face patterns
• - Pre-trained XML model from OpenCV is loaded for
detection

• Code Snippet:
• face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades
+ 'haarcascade_frontalface_default.xml')
• faces = face_cascade.detectMultiScale(gray,
scaleFactor=1.1, minNeighbors=7)
SVM for Face Validation
• Purpose:
• - Verify if detected face is valid using width and height
• - SVM is trained on synthetic data

• Code Snippet:
• train_data = np.array([[30, 30], ..., [200, 200]],
dtype=np.float32)
• train_labels = np.array([1, 1, ..., 0], dtype=np.int32)
• svm.train(train_data, cv2.ml.ROW_SAMPLE,
train_labels)
Real-Time Face Detection
• Pipeline:
• 1. Capture frame from webcam
• 2. Flip for mirror effect
• 3. Convert to grayscale
• 4. Detect and validate faces
• 5. Draw rectangles and labels

• Code Snippet:
• cap = cv2.VideoCapture(0)
• ret, frame = cap.read()
• gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
Display & User Interface
• Display Features:
• - Bounding box around valid faces
• - Total face count shown live
• - Exit on 'q' key press

• Code Snippet:
• cv2.putText(frame, f'Total Faces: {face_count}', ...)
• cv2.imshow('ML-Enhanced Face Detection', frame)
Challenges
• - Limited features for SVM (only width &
height)
• - Haar Cascade may miss some faces or detect
false positives
• - Real-time performance depends on system
speed
Future Enhancements
• - Use deep learning models like DNN or YOLO
for better accuracy
• - Train SVM on more robust features (e.g.,
HOG, LBP)
• - Add face recognition (identify individuals)
Demo & Results
• Live Demo: [Add screenshots or demo video link]

• - Real-time detection and validation


• - Face count updates dynamically
Conclusion
• - Successfully integrated ML with computer
vision
• - Simple but effective real-time face detection
system
• - Demonstrates SVM-based validation in
practical applications

You might also like