[英]How to find pre-trained model accuracy and confusion matrix for object detection
I am using tensor flow object detect pre-trained model with faster RCNN inception_v2 coco for own data set. 我使用张量流对象检测预先训练的模型与更快的RCNN inception_v2 coco为自己的数据集。 So my question is how to find model accuracy and confusion matrix for own data set?
所以我的问题是如何为自己的数据集找到模型精度和混淆矩阵?
if you want to get a confusion matrix is easy, this example works with PyCM library: First, train your model with your 80% and then use the hold-out test or also called "test data" or x_test. 如果你想得到混淆矩阵很容易,这个例子适用于PyCM库:首先,用你的80%训练模型,然后使用保持测试或者也称为“测试数据”或x_test。 The hold out test data the model will predict classes with data that never see before, if you train your model using all your data, the model only will make a "peeking" this term refers to the model only is "peeking" the features and never predicting because only doing a "peeking" the data that before it saw.
保留测试数据模型将使用以前从未见过的数据预测类,如果使用所有数据训练模型,模型只会“偷看”这个术语是指模型只是“窥视”特征和永远不会预测,因为只是在看到它之前“偷看”数据。
Ig to get a confusion matrix, first we test the model with the test data: 为获得混淆矩阵,首先我们用测试数据测试模型:
y_predicted = model.predict(testX, batch_size=64)
And the we get the confusion matrix using PyCM library 然后我们使用PyCM库获得混淆矩阵
from pycm import *
And the get the cm: 得到厘米:
cm = ConfusionMatrix(actual_vector=y_test, predict_vector=y_predicted)
print(cm)
Printing the "cm" you will get all the metrics of your model like "recall, precision, overall accuracy of your model, specificity, all what you can get from a Confusion matrix, getting the CM also you can compute from scratch your precision, recall of true positive rate, true negative rate of every class etc.. those metrics tells you how confident is your model.. 打印“cm”,您将获得模型的所有指标,如“召回,精确度,模型的整体准确性,特异性,您可以从混淆矩阵中获得的所有内容,获取CM还可以从头开始计算您的精度,回想一下真正的正面率,每个阶级的真实负面率等等。这些指标告诉你你的模型有多自信......
Best Regards.. 最好的祝福..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.