How to know which image is being processed inside the network

Hello folks

I’m quite new to torch, sorry if this question looks stupid. I’m now working on a modified version of CNN. I have successfully implemented CNN from scratch with the torch framework. I want to introduce some additional information to the convolution and pooling layer. For example, inside the code of convolution layer, I want to use the transparency or depth of a given pixel to compute a result.

It seems that adding an extra channel could be complicated since I’m modifying the code of existing pytorch models. The existing code looks grayscale or RGB-compatible only. Then I thought can I just know which image I’m currently processing and read the extra information from disk directly. Like, the convolution layer is currently processing 001.jpg, so I can load 001.csv. The question is, how can I know which file the network is dealing with?

I’m open for other options as well. Thank you pytorch folks a lot.

Based on the description I think writing a custom Dataset as described e.g. here and returning the sample with the additional information in the Dataset.__getitem__ would be the cleanest and easiest way.