Background
I am designing a NN model for a multi-class classification problem. The model takes two sets of features, F1 and F2, for making a prediction. However, F2 might be missing in production, but the model should still be able to make a prediction based on F1 alone (even at a degraded accuracy).
For example, suppose we have a list of objects. Some has only Color (F1) while others also have Weight (F2). I hope the model can work either with F1 only or with both F1 and F2.
Color (F1) | Weight (F2) | Class |
---|---|---|
Green | 110 grams | Apple |
Red | null | Apple |
Red | 130 grams | Apple |
Orange | null | Orange |
Question
How should I design the model?
I can think about two approaches:
- Train 2 models: first, train a model M1 on F1 only. Then train a model M2 that incorporates M1 as a submodule and also using F2. Then during inference time, if the input only has F1, we will call M1; otherwise, call M2.
- Train 1 model that takes both F1 and F2. But when building training data, we remove F2 of existing samples to create synthetic incomplete inputs that we might encounter during prediction.
What would be your suggestion? Any reading materials you recommend? Thank you for your time!
Result
In the end I went for approach 1 since it has better accuracy.