Да, пожалуйста, посмотрите на Функциональный API Keras , чтобы найти множество примеров того, как строить модели с несколькими входами.
Ваш код будет выглядеть примерно так, где вы, вероятно, захотите пропустить изображение через сверточный слой, сгладить вывод и объединить его с векторным вводом:
from keras.layers import Input, Concatenate, Conv2D, Flatten, Dense
from keras.models import Model
# Define two input layers
image_input = Input((32, 32, 3))
vector_input = Input((6,))
# Convolution + Flatten for the image
conv_layer = Conv2D(32, (3,3))(image_input)
flat_layer = Flatten()(conv_layer)
# Concatenate the convolutional features and the vector input
concat_layer= Concatenate()([vector_input, flat_layer])
output = Dense(3)(concat_layer)
# define a model with a list of two inputs
model = Model(inputs=[image_input, vector_input], outputs=output)
Это будетдать вам модель со следующими характеристиками:
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_8 (InputLayer) (None, 32, 32, 3) 0
__________________________________________________________________________________________________
conv2d_4 (Conv2D) (None, 30, 30, 32) 896 input_8[0][0]
__________________________________________________________________________________________________
input_9 (InputLayer) (None, 6) 0
__________________________________________________________________________________________________
flatten_3 (Flatten) (None, 28800) 0 conv2d_4[0][0]
__________________________________________________________________________________________________
concatenate_3 (Concatenate) (None, 28806) 0 input_9[0][0]
flatten_3[0][0]
__________________________________________________________________________________________________
dense_3 (Dense) (None, 3) 86421 concatenate_3[0][0]
==================================================================================================
Total params: 87,317
Trainable params: 87,317
Non-trainable params: 0
Еще один способ визуализации - через Утилиты визуализации Keras :
![enter image description here](https://i.stack.imgur.com/AhbED.png)