How to calculate confusion matrix of a frame

1 view (last 30 days)
Shilpa K
Shilpa K on 25 Jul 2020
Answered: Ulli Srinivasu on 15 Sep 2020
Hi , I am doing a project vehicle detection and counting using GMM and blob analysis how can calculate accuracy of counted vehicles... ???? .... And also iam using MATLAB version 14 .. can any one help pe how to calculate accuracy or confusion matrix

Answers (1)

Ulli Srinivasu
Ulli Srinivasu on 15 Sep 2020
Hi Shilpa,
I understood that you want to create a confusion matrix for the detected vehicles.
The confusion matrix can be formed for a classification problem. In this case, it is not possible to formulate a confusion matrix. Since the number of detected vehicles using the algorithm may vary from the ground truth. It may be possible that the algorithm miss to detect the vehicles or wrongly detect vehicles.
However, you can calculate the accuracy and false detection rate.
Let us assume that the algorithm detected 20 vehicles and the actual vehicles in the video frame are 18. Also assume the properly detected vehicles are 15. Hence the algorithm missed to detect 3 vehicles, and wrongly predicted 5 vehicles.
Then,
The accuracy is 15/18.
False detection is 5/20.
Here false detection indicates that how many vehicles detected wrongly from the total detections.
For classification problem you can formulate confusion matrix using the MATLAB function “confusionmat”. You can also find the doc link.

Products


Release

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!