Just in case you missed it from the original medium post, the code below is the implementation.
Now I have not tried this with FastAI, but given that the paper has used ResNet for patch classification, we can use FastAI for much more effective training.