I have two trained models. One is using a LinearSVC algorithm and is trained on numerical data from medical examination from patients with diabetic retinopathy. The second one is a neural network trained on images of retina scans from patients with the same disease.

The models predict if the patient has retinopathy or not. Both are written using Python 3.6 and Keras and have accuracy around 0.84.

Is it possible to combine those two models in any way to increase the accuracy of predictions?

I'm not sure in what way it could be achievable as they are using a different kinds of data. I have tried using ensembling methods but didn't get better scores with them.

  • $\begingroup$ What exactly have you tried with regards to ensembling as mentioned at the end of your question? $\endgroup$
    – Jonathan
    Nov 13, 2019 at 13:38
  • $\begingroup$ basically methods from this $\endgroup$ Nov 13, 2019 at 13:51

1 Answer 1


You can try using a multi-input model. Here is a recent post with a similar discussion, with the required architecture defined in the answer.

Instead of combining the separate models, you can create a model which uses image and numerical data side by side. Keras allows you to use different types of data using multi input structure via functional API. And then you can combine them to create a single machine learning model. Basic idea is like this:


This image was taken from here, where you can find further details and the code implementation as well. Actually, the discussion in the introduction of that post is almost the same as your question: What to do when the inputs are:

  • Numeric/continuous values, such as age, heart rate, blood pressure
  • Categorical values, including gender and ethnicity
  • Image data, such as any MRI, X-ray, etc.

Also, section 5.1 of this blogpost details the same process.

  • $\begingroup$ Can you argue/elaborate why a multi-input model would be useful in this case? $\endgroup$
    – nbro
    Nov 13, 2019 at 12:55
  • $\begingroup$ Is this case much different from the one I provided the link above, except for the use of SVC instead of a dense model? It is a valid way to combine different input types, and can be achieved using Keras. Whether it will improve the accuracy or not is subject to experiment. $\endgroup$
    – serali
    Nov 13, 2019 at 13:07
  • $\begingroup$ I've not read the other post, but I think you should at least argue in this question why the solution given in another place may be useful. $\endgroup$
    – nbro
    Nov 13, 2019 at 15:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .