Matlab - 使用经过训练的网络来测试其他图像

发布于 2024-11-01 03:51:38 字数 519 浏览 5 评论 0原文

我使用前馈神经网络训练了古钱币图像。现在,我想使用经过训练的网络来测试图像。我做了如下;

load net.mat;
load Features.mat; %this is the test image's features file
testInputs = features_set';
out = sim(net,testInputs);

[dummy, I]=max(out);
if (I == 1)
    h = msgbox('type 1','Description','none');
elseif (I == 2)
    h = msgbox('type 2','Description','none');
else
    h = msgbox('unclassified','Description','none');
end;

问题是,即使当我输入另一张图像(例如人脸)时,它也会显示类型 1 或类型 2。它不会显示未分类的图像。始终为任何图像提供类型 1 或类型 2,而不仅仅是硬币图像。

有人可以帮我吗?

I have trained ancient coin images using feed forward neural network. Now, I want to use that trained network to use for testing images. I did as follows;

load net.mat;
load Features.mat; %this is the test image's features file
testInputs = features_set';
out = sim(net,testInputs);

[dummy, I]=max(out);
if (I == 1)
    h = msgbox('type 1','Description','none');
elseif (I == 2)
    h = msgbox('type 2','Description','none');
else
    h = msgbox('unclassified','Description','none');
end;

Problem is, even when I input another image, say a face of a person, it says either type 1 or type 2. It doesn't display unclassified. Always, gives either type 1 or type 2 for any image, not only for coin images.

Can someone please help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

隐诗 2024-11-08 03:51:38

我猜你只用硬币训练了你的神经网络。

这就是问题所在。如果您希望神经网络对非硬币的东西进行分类。你必须用不是硬币的图像来训练它。这是一个大问题,因为有无限多个不是硬币的图像。尽管名称具有误导性,但神经网络的智能程度取决于训练数据。

更简单的方法是在使用神经网络之前提出一些算法来对非硬币的东西进行分类。 (例如,您可以检测图像中是否有圆圈)

You trained your neural network on only coins, I assume.

That is the problem. If you want your neural network to classify things that are not coins. You have to train it with images that are not coins. This is a big problem, because there are infinitely many images that are not coins. Neural networks, despite its misleading name, is only as smart as your training data.

The easier way to do this would be to come up with some algorithms to classify things that are not coins before you use your neural network. (For example, you could detect to see if there are any circles in the image)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文