image - 卷积神经网络图像输入大小

标签 image machine-learning input neural-network conv-neural-network

我正计划创建一个CNN模型,该模型使用脏文档图像作为输入到网络并将其相应的干净图像作为地面真实数据来对图像进行去噪。我的问题很基本,但请忍受。

我输入了具有不同尺寸尺寸的图像,如下所示:

6285 x 9256
6006 x 9358
6107 x 9526
5926 x 9472
5931 x 9146
5972 x 9267
5720 x 8734
5982 x 8735
5886 x 8616
5984 x 9398
6356 x 9294
6078 x 9524
6126 x 9370
6017 x 9358
5944 x 9420
5916 x 8737
6251 x 9406
5974 x 8767
5900 x 8802
5965 x 8691


是否需要使我的图像大小相等或者是否可以使用不同的大小?

最佳答案

通常,当处理CNN中不同大小的图像(在现实世界中经常发生)时,我们会借助任何图像处理库(OpenCV,PIL等)将图像调整为最小图像的大小。 ,将不等大小的图像填充到所需大小。调整图像大小更简单,并且最常用。

正如媒体在上述答案中提到的那样,不可能直接使用不同大小的图像。这是因为在定义CNN体系结构时,您计划根据输入大小确定应具有的层数。没有固定的输入形状,就无法定义模型的架构。因此,有必要将所有图像转换为相同大小。

此外,Keras中还有一个连接函数:https://keras.io/layers/merge/#concatenatehttps://keras.io/backend/#concatenate。另请参阅本文:https://arxiv.org/abs/1605.07333。它的应用程序可以在这里看到:https://machinelearningmastery.com/develop-n-gram-multichannel-convolutional-neural-network-sentiment-analysis/https://machinelearningmastery.com/cnn-models-for-human-activity-recognition-time-series-classification/

此方法可用于具有不同图像尺寸的多个输入通道。

关于image - 卷积神经网络图像输入大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59998970/

相关文章:

javascript - 通过悬停 ul li 来切换图片

html - 背景向右重复

python - Tensorflow GPU 使用

python - 如何在 Beautiful Soup 4 (Python) 中使用搜索栏

html - iOS 7 从 Mobile Safari 访问 iPhone 相机?

css - 如何在 <input type ="time"> 中使用 css indicator 选择?

css - 如何设置 Xul 窗口背景图像?或者,如何在图像上添加标题?

python mahotas : Applying threshold filter and saving image as pgn

matlab - 这个橙色点在 ROC 图中代表什么?

machine-learning - 迭代条件模式 E 步骤 EM