Skip to content

Wei-ucas/pulsar_detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pulsar detection with CNN

This project is a pulsar detection program based on the object detection method FCOS. The program can

  1. directly read filterbank files (1-bit or others), conver it to image with downsample and normalization,
  2. input the image into the deep neural network
  3. 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

Requirements

    python >= 3.6
    pytorch >= 1.1.0
    torchvision >= 0.4.0
    opencv-python
    sigpyproc

Sigpyproc is used for read filterbank data.

Usage

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.

Train

  1. 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
    python fake_from_real.py
    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.
  2. Training, Run
    python train.py configs/default.py
    Training parameters (such as training set, batch size, learning rate) has been set in "configs/default.py". The checkpoints will be saved in "./cpks"

About

Pulsar detection with CNN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages