Detecting the Number of Compartments Using Convolutional Neural Network