Skip to content Skip to sidebar Skip to footer

Adding More Information Than A Image To An Image Classifier In Keras

i am trying to make an image classifier with keras to predict cases of breast câncer, i had some troubles until here because it's not a 'simple' classifire, i couldn't do this wit

Solution 1:

Fit does not take parameter like that. If you look at the function definition the first parameter is input, second is target prediction, and the third is batch size.

What you should do is concatenate X and z (and any other info), as they are both input data. e.g.

Xz = np.concatenate((X, z[..., np.newaxis]), axis=-1)

Note: z[..., np.newaxis] takes an array with size [H, W] and makes it [H, W, 1] so that you can concatenate it with X, which I assume is an RGB image with shape [H,W,3]. If it is greyscale, just ignore this and simple use z.

Utimately what you want is the input to have dimension [H,W,C] where C is the dimension of all the data, e.g. [red, green, blue, age, density, etc]. It might make more sense in the network design to inject non-image information, like age, in at the final layers of the network (e.g. into Dense(128))

Post a Comment for "Adding More Information Than A Image To An Image Classifier In Keras"