The output and label shape depend on your classification problem. If the last layer outputs an activation of [batch_size, 22, width, height], it probably means that the model was used to classify each pixel into one of 22 classes.
You should change the number of output channels to your use case.
Edit: I edited your title so that the question becomes clearer.