且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将Keras预训练模型扩展到具有其他通道或波段的图像

更新时间:2023-12-02 21:52:28

来自Keras 文档 :

input_shape:可选的形状元组,仅当include_top为False时才指定(否则,输入形状必须为(224,224,3)(具有"channels_last"数据格式)或(3,224,224)(具有"channels_first"数据格式).它应该恰好具有3个输入通道,宽度和高度应不小于48.例如,(200、200、3)将是一个有效值.

input_shape: optional shape tuple, only to be specified if include_top is False (otherwise the input shape has to be (224, 224, 3) (with 'channels_last' data format) or (3, 224, 224) (with 'channels_first' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 48. E.g. (200, 200, 3) would be one valid value.

您将无法将此VGG实现用于多光谱图像.正如您已经提到的那样,这将为模型引入尚未经过预训练的其他权重.

You will not be able to use this VGG implementation for multispectral imagery. As you already mention, this would introduce additional weights to the model that have not been pretrained.

用于多光谱图像的神经网络是一个非常活跃的研究主题,但是恐怕很少有开箱即用的解决方案,例如在imagenet上进行预训练的网络.您可以尝试使用降维技术(例如PCA)将图像压缩到三个通道.或一起训练一个自定义体系结构,该体系结构将8通道图像作为输入.

Neural nets for multispectral images are quite an active research topic, but I'm afraid that there are few out of the box solutions such as the networks pretrained on imagenet. You could try a dimensionality reduction technique such as PCA to compress your images to three channels. Or train a custom architecture altogether that takes 8-channel images as inputs.