Object detection(CV)

About this Project:

This is one of the assignment of (2022 Spring) Introduction of Artificial Intelligence. We implement Viola-Jones object detection algorithm via Adaboost to detect whether the parking lots are empty. The results are compared with YoloV5.

這是 2022 Spring 所修陽明交大資工系所開設【人工智慧概論】的作業。實作Adaboost演算法(Viola-Jones object detection)並對比YoloV5,對校園的停車位做物體檢測,對畫面中的停車格檢測是否為空。


Prepare the dataset

Including (1) load the data (2) convert into grey scale and (3) resize the images into (36, 16) as required via the package “Pillow”.

Implement AdaBoost Algorithm

Since the specific features can appear at different positions and scales, we utilize tricks from Viola Jones algorithm by first calculating integral images (a summed-area table) to build Harr like features more efficiently. After obtaining the features, we add the features to our training data, which are in the form of integral images.

To decide which features can be part of the final classifier, here comes the core of AdaBoost algorithm. AdaBoost stands for adaptive boosting, it iteratively selects an ensemble of component (weak) classifiers. These weak classifiers only need to split training examples for at least 50% accuracy, but eventually a sequence of weak classifiers is combined into a strong one. During the training, we reweight the misclassified examples iteratively, and that gives an intuition to “adaptive”.


Comparison between Adaboost and Yolov5 (Part 4)

result1
result2


the samples of car and non-car (parking space) each from training dataset

sample