There are ML problems when we need to stack more than one model. Take for example chest X-Rays need stacking 2 CNNs for front and lateral views like this model :
The above method is way better than stacking 2 full CNN into FC (which is I am aware it is doable with fastai) like this:
Because the output of each CNN in the 1st image has way more features describing each xray image, which is crucially important…
Since the physician will not be able to classify with the frontal view alone or the lateral view alone.
We need to combine (stack) features and not label outputs.
I mean the 2nd image is just like if you give the front view xray to physician1 and give the lateral view to phyisician2 and average their decisions. It is not a good idea because neither physician1 nor physician2 will be able to give a good diagnosis with only one xray view. It needs combining a lot of features in one model just like in the 1st image.
The paper mentioned how they trained the model:
We start by applying a CNN (DenseNet121) on the Lateral and PA views (separately). We removed the last fully connected layer from each CNN and concatenated their outputs (just after the average pooling layer).
Any idea how to remove the last fully connected layer from a CNN with fastai alone without writing custom extra code in pytorch?