It creates a synthetic image with specified categories, calculates category frequencies and weights, generates a probability map for sampling, and then samples patches from the image based on the ...