Gourab RoyHome

RESEARCH IMPLEMENTATION

Reconstructing CT images with global and local refinement stages

I implemented a pipeline that maps a sinogram directly to an image. A Swin based first stage produces the reconstruction, and a smaller U Net performs a second image refinement step.

Input
Sinogram
Target
CT image
Dataset format
LoDoPaB style HDF5
Recorded measures
SSIM, PSNR, MAE

PURPOSE

Separate the first reconstruction from image refinement

The repository is an implementation study of direct sinogram to image reconstruction. I split the task into two learned stages so the first network can form the main image and the second can work on its residual visual detail.

The design supports paired training, validation, and test data. It also saves predictions in their denormalized image scale for later inspection.

METHOD

The implemented path

01Frequency filter

An optional Ramp or Hann filter is applied along the detector axis of the sinogram.

02Swin reconstruction

A Swin Transformer encoder and convolutional decoder produce the first image.

03U Net refinement

A separate convolutional U Net receives the first image and predicts a refined output.

04Evaluate and save

The pipeline records image measures and writes denormalized NumPy predictions.

Stage 1Global reconstruction

The Swin model handles the direct mapping from filtered projection data to image space.

Stage 2Local refinement

The refiner processes the first output with an image to image U Net.

DATA AND OBJECTIVE

Paired HDF5 input with image based losses

The loader expects matching observation and ground truth HDF5 files for the training, validation, and test splits. Each file contains a dataset named `data`.

Inputs are padded to a Swin compatible shape and cropped back to the original image size. The training objective combines an SSIM loss term with mean absolute error. Both reconstruction stages contribute to the complete loss.

StructurePaired files
Stage 1 encoderSwin Transformer
Stage 2 modelRefiner U Net
Parallel trainingDataParallel

CURRENT EVIDENCE

Implementation available, result table pending

No public checkpoint or numerical benchmark is included

The repository contains the training, inference, and evaluation code. It does not currently publish trained weights, saved prediction examples, or a completed SSIM, PSNR, and MAE result table.

  • Recorded during training

    Training and validation loss, SSIM, PSNR, and MAE are written to a CSV log.

  • Computed during testing

    The evaluation function loads a saved two stage checkpoint and reports mean SSIM, PSNR, MAE, and combined loss.

  • Claims intentionally avoided

    The page does not claim clinical validation, improved image quality, or better performance than a reconstruction baseline.

RUN THE PIPELINE

Expected data and entry point

Place paired observation and ground truth files under one root directory using the LoDoPaB style split names described in the repository README.

pip install torch torchvision timm pytorch-msssim h5py tqdm numpy python main.py \ --root_dir /path/to/LoDoPaB \ --save_path /path/to/model.pth \ --log_path /path/to/training.csv \ --output_dir /path/to/predictions