简体   繁体   English

我需要微调艺术 CNN 模型(如 ResNet50)的 state 中的最后一个卷积层吗?

[英]Do i Need to fine tune the last convolutional layers in a state of art CNN models like ResNet50?

My graduation project is to use transfer learning on a CNN model that can diagnose Covid-19 from Chest X-ray images.我的毕业项目是在 CNN model 上使用迁移学习,它可以从胸部 X 射线图像中诊断出 Covid-19。 After spending days Fine tuning the hyper parameters such as the number of fully connected layers, the number of nodes in the layers, the learning rate, and the drop rate using Keras tuner library with Bayesian Optimizer, I got some very good results, A test accuracy of 98% for multi class classification and a 99% for binary class classification.花了几天时间使用带有贝叶斯优化器的 Keras 调谐器库对超参数进行微调,例如完全连接的层数、层中的节点数、学习率和丢弃率,我得到了一些非常好的结果,一个测试多 class 分类的准确率为 98%,二进制 class 分类的准确率为 99%。 However, i froze all the layers in the original base model.但是,我冻结了原始基础 model 中的所有层。 I only fine tuned the last Fully connected layers after exhaustive hyper parameter optimization.在详尽的超参数优化之后,我只微调了最后一个全连接层。 Most articles and papers out there say that they fine the fully connected layers as well as some of the convolutional layers.那里的大多数文章和论文都说他们对全连接层和一些卷积层都进行了优化。 Am i doing something wrong?难道我做错了什么? I am afraid that this is too good to be true.恐怕这太好了,令人难以置信。

My data set is not that big, only 7000 images taken from the Kaggle Covid-19 competition.我的数据集并不大,只有 7000 张来自 Kaggle Covid-19 比赛的图像。

I used image enhancement techniques such as N-CLAHE on the images before the training and the classification which improved the accuracy significantly compared to not enhancing the images.我在训练和分类之前对图像使用了 N-CLAHE 等图像增强技术,与不增强图像相比,它显着提高了准确性。

I did the same for multiple State of art models, such as VGG-16 and ResNet50, and they all gave me superb results.我对多个 State 的艺术模型做了同样的事情,比如 VGG-16 和 ResNet50,它们都给了我极好的结果。

If you mean by "only fine tuned the last Fully connected layers" then NO , you did not.如果您的意思是“仅微调最后一个完全连接的层”,那么NO ,您没有。

You can choose to fine-tune any layer of your choice but most importantly the final layers of the model, which is what you did, so you're good to go.您可以选择微调您选择的任何层,但最重要的是 model 的最后一层,这就是您所做的,所以您对 go 很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM