  Flagging of Radio Frequency Interference (RFI) is an increasingly important
challenge in radio astronomy. We present R-Net, a deep convolutional ResNet
architecture that significantly outperforms existing algorithms -- including
the default MeerKAT RFI flagger, and deep U-Net architectures -- across all
metrics including AUC, F1-score and MCC. We demonstrate the robustness of this
improvement on both single dish and interferometric simulations and, using
transfer learning, on real data. Our R-Net model's precision is approximately
$90\%$ better than the current MeerKAT flagger at $80\%$ recall and has a 35\%
higher F1-score with no additional performance cost. We further highlight the
effectiveness of transfer learning from a model initially trained on simulated
MeerKAT data and fine-tuned on real, human-flagged, KAT-7 data. Despite the
wide differences in the nature of the two telescope arrays, the model achieves
an AUC of 0.91, while the best model without transfer learning only reaches an
AUC of 0.67. We consider the use of phase information in our models but find
that without calibration the phase adds almost no extra information relative to
amplitude data only. Our results strongly suggest that deep learning on
simulations, boosted by transfer learning on real data, will likely play a key
role in the future of RFI flagging of radio astronomy data.
