This project is a pulsar detection program based on the object detection method FCOS. The program can
- directly read filterbank files (1-bit or others), conver it to image with downsample and normalization,
- input the image into the deep neural network
- output the location (time and frequency) where pulses appear and cut the data patch from the whole fil as pulsar candidates.
The process from filterbank data to candidate images is end-to-end.
The model can runing on CPU or GPU. The detection speed can be impressive with GPU.
The model are trained on fake pulsar data, which are generated by adding fake pulses to the observation data without pulse signals. Details can be find in fake_from_real.py
python >= 3.6
pytorch >= 1.1.0
torchvision >= 0.4.0
opencv-python
sigpyproc
Sigpyproc is used for read filterbank data.
Download the trained model parameter from here, this model are trained on 5000 fake pulsar images with different signal-noise and random DM(20-2000). The train images are all from 1-bit data, so re-train may be necessary when processing other kinds of data, and codes also should be modified.
python inference.py {fil path to be detected} --output {output path}
The program will generate a json file to save all possible pulses and crop every pulse as single picture for visualization.
An example filterbank data can be download for test.
- Create fake pulsar data as train dataset: Download the real data that has been confirmed there is no pulsar in them (100 fils), decompress it to
to get the folder "./nopulse_fils". Run
Three folders will be created, "fake_fils", "fake_images" and "annotations" to save filterbank data, images and annotations info. The last two will be used for training. 2000 images will be created.
python fake_from_real.py
- Training, Run
Training parameters (such as training set, batch size, learning rate) has been set in "configs/default.py". The checkpoints will be saved in "./cpks"
python train.py configs/default.py