Answers.Body: <p>You can try using a multi-input model. <a href="https://ai.stackexchange.com/questions/16153/are-there-well-established-ways-of-mixing-different-inputs-e-g-image-and-numbe">Here</a> is a recent post with a similar discussion, with the required architecture defined in the answer.</p>
  
  <p>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 <a href="https://keras.io/getting-started/functional-api-guide/#multi-input-and-multi-output-models" rel="nofollow noreferrer">functional API</a>. And then you can combine them to create a single machine learning model. Basic idea is like this:</p>
  
  <p><a href="https://i.sstatic.net/6DBCf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6DBCf.png" alt="this"></a></p>
  
  <p>This image was taken from <a href="https://www.pyimagesearch.com/2019/02/04/keras-multiple-inputs-and-mixed-data/" rel="nofollow noreferrer">here</a>, 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:</p>
  
  <blockquote>
    <ul>
    <li>Numeric/continuous values, such as age, heart rate, blood pressure</li>
    <li>Categorical values, including gender and ethnicity </li>
    <li>Image data, such as any MRI, X-ray, etc.</li>
    </ul>
  </blockquote>
  
  <p>Also, section 5.1 of <a href="https://machinelearningmastery.com/keras-functional-api-deep-learning/" rel="nofollow noreferrer">this</a> blogpost details the same process.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-13T12:55:50.777Z
Answers.Text: Can you argue/elaborate why a multi-input model would be useful in this case?
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-13T13:07:16.753Z
Answers.Text: 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.
Answers.UserDisplayName: serali
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-13T15:05:42.553Z
Answers.Text: 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.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-13T12:48:06.347Z
Answers.LastActivityDate: 2019-11-14T06:29:25.740Z
Answers.LastEditDate: 2019-11-14T06:29:25.740Z
Answers.UserDisplayName: serali
Body: <p>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.</p>
  
  <p>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.</p>
  
  <p>Is it possible to combine those two models in any way to increase the accuracy of predictions?</p>
  
  <p>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.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-13T13:38:09.547Z
Comments.Text: What exactly have you tried with regards to ensembling as mentioned at the end of your question?
Comments.UserDisplayName: Jonathan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-13T13:51:35.027Z
Comments.Text: basically methods from [this](https://scikit-learn.org/stable/modules/ensemble.html)
Comments.UserDisplayName: Aleksander Chmielewski
Tags: <neural-networks><python><image-recognition><keras><support-vector-machine>
Title: How do I combine models trained on different data to increase classification accuracy?
UserDisplayName: Aleksander Chmielewski
ThreadText: # How do I combine models trained on different data to increase classification accuracy?
  
  (Asked by: username_0 on 2019-11-13)
  
  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.
  
  **Tags:** neural-networks, python, image-recognition, keras, support-vector-machine
  
  > **Comments:**
  > **username_1**: What exactly have you tried with regards to ensembling as mentioned at the end of your question?  
  > **username_0**: basically methods from [this](https://scikit-learn.org/stable/modules/ensemble.html)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-11-13. Score: 2 | Accepted answer
  
  You can try using a multi-input model. [Here](https://ai.stackexchange.com/questions/16153/are-there-well-established-ways-of-mixing-different-inputs-e-g-image-and-numbe) 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](https://keras.io/getting-started/functional-api-guide/#multi-input-and-multi-output-models). And then you can combine them to create a single machine learning model. Basic idea is like this:
  
  [![this](https://i.sstatic.net/6DBCf.png)](https://i.sstatic.net/6DBCf.png)
  
  This image was taken from [here](https://www.pyimagesearch.com/2019/02/04/keras-multiple-inputs-and-mixed-data/), 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](https://machinelearningmastery.com/keras-functional-api-deep-learning/) blogpost details the same process.
  
  > **Comments:**
  > **username_3**: Can you argue/elaborate why a multi-input model would be useful in this case?  
  > **username_2**: 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.  
  > **username_3**: 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.  
  
  ---
  
  