简体   繁体   English

如何找到用于物体检测的预训练模型精度和混淆矩阵

[英]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.

相关问题 来自预训练 tensorflow model 的混淆矩阵 - Confusion matrix from pre-trained tensorflow model 如何向预训练的对象检测模型添加额外的类并训练它检测所有类(预训练 + 新的)? - How to add additional classes to a pre-trained object detection model and train it to detect all of the classes (pre-trained + new)? 改进预训练的 tensorflow object 检测 model - Improving a pre-trained tensorflow object detection model 预训练 Object 检测 API model 用于灰度图像(1通道) - Pre-trained Object Detection API model for greyscale images (1 channel) 如何评估预训练的 model Tensorflow Object 检测 ZDB974238714CA38DE634A7CE1ZF0 - How can I evaluate pre-trained model Tensorflow Object Detection API 如何加载预训练的 PyTorch model? - How to load a pre-trained PyTorch model? 无法加载预训练的 model 检查点与 TensorFlow Object 检测 ZDB974238714CA8DE634A7ACE1 - Unable to load pre-trained model checkpoint with TensorFlow Object Detection API 如何在TensorFlow中使用预训练模型 - How to use pre-trained model in TensorFlow 如何在 tensorflow 中使用预训练的 model 进行预测? - how to predict with pre-trained model in tensorflow? 如何从保存的预训练模型的 h5 文件中找到层数? - How to find the number of layers from the saved h5 file of pre-trained model?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM