I'm built a unet for segmentation purpose. I trained the network and now want test the accuracy of the network. For training I randomly extracted 32x32 patches with randomPatchExtractionDatastore. For testing I split the input image into ordered 32x32, so 516x516 images was split into 256 32x32 images. Then I run the following code
testdata = imageDatastore(testDir);
predictPatchSize = [32 32];
net = load('trained_unet.mat');
net = net.net;
YPred = predict(net,testdata);
And the result it give back to me is a 4D array of 32x32x2x516.
Now I get the 32x32 because that's the size of my images. the 516 is how many images I put in and now many I get out. However the 2 is confusing me and I can't extract out the 516 images to rebuild back into a 516x516 image to compare to the grand truth mask I have to see how accurate the network is. Anyone have any idea on this problem?