The alpha channel is usually used to create transparency as descibed here 4.
Usually you would implement your custom Dataset, set the path to the .csv data in its __init__, and load the samples in __getitem__. Basically what you’ve done in your first example. Do you have any trouble with your code or am I misunderstanding the question?