  Radio frequency interference (RFI) detection and excision are key steps in
the data-processing pipeline of the Five-hundred-meter Aperture Spherical radio
Telescope (FAST). Because of its high sensitivity and large data rate, FAST
requires more accurate and efficient RFI flagging methods than its
counterparts. In the last decades, approaches based upon artificial
intelligence (AI), such as codes using convolutional neural networks (CNNs),
have been proposed to identify RFI more reliably and efficiently. However, RFI
flagging of FAST data with such methods has often proved to be erroneous, with
further manual inspections required. In addition, network construction as well
as preparation of training data sets for effective RFI flagging has imposed
significant additional workloads. Therefore, rapid deployment and adjustment of
AI approaches for different observations is impractical to implement with
existing algorithms. To overcome such problems, we propose a model called
RFI-Net. With the input of raw data without any processing, RFI-Net can detect
RFI automatically, producing corresponding masks without any alteration of the
original data. Experiments with RFI-Net using simulated astronomical data show
that our model has outperformed existing methods in terms of both precision and
recall. Besides, compared with other models, our method can obtain the same
relative accuracy with fewer training data, thus reducing the effort and time
required to prepare the training data set. Further, the training process of
RFI-Net can be accelerated, with overfittings being minimized, compared with
other CNN codes. The performance of RFI-Net has also been evaluated with
observing data obtained by FAST and the Bleien Observatory. Our results
demonstrate the ability of RFI-Net to accurately identify RFI with
fine-grained, high-precision masks that required no further modification.
