0

I have been trying to create a neural network that can do a filtered back projection in R for image reconstruction however I'm running into an error using the neuralnet function.

I want to try to build a machine learning program that can do a filtered back projection of a sinogram. I have the image matrix data of the sinogram and the actual data as:

Load sinogram and image data

img1 <- readJPEG("raw_data/sino1.jpg")
img1 <- rotateFixed(img1, angle = 270)
img1 <- img1[1:867,,2]
img1 %>% str()
sino <- image(img1)

img2 <- readJPEG("raw_data/Rplot.jpg")
img2 <- rotateFixed(img2, angle =270)
img2 <- img2[,,2]
img2 %>% str()
pic <- image(img2)

I also ran this block to set seed although I don't know if it's necessary:

set.seed(245)
data_rows <- floor(0.80 * nrow(img1))
train_indices <- sample(c(1:nrow(img1)), data_rows)
train_data <- img1[train_indices,]
test_data <- img1[-train_indices,]

I set up the neural net block as:

model = neuralnet(
    img2~img1,
data=train_data,
hidden=c(4,2),
linear.output = FALSE
)

however I receive the error : Error in [.data.frame(data, , model.list$variables) : undefined columns selected

Does anyone know how to fix this or perhaps run a neural net function for image reconstruction?

  • Regardless of the correctness of the code, your premise will likely fail. CT recon is a inverse problem, and a quite ill-posed one at that. On top of that, a backprojection is an inherently non-local operation, i.e. to be able tot correctly implement it, it has to spread to the entire image, which is exactly what convolutions don't do, unless you go very deep in the network. Instead, what people do is they reconstruct with FBP and then train a "denoising" network that cleans that result. The seminal paper on this is FBPConvNet. – Ander Biguri Jun 20 '23 at 22:27

0 Answers0