The precise plasma boundary gap identification at the midplane is a prerequisite for achieving controlled plasma positioning and holds a significant importance for the stable operation of tokamak devices. This study proposes a plasma boundary gap at the midplane recognition algorithm based on visual endoscopy diagnostic. The model is an end-to-end one that uses a convolutional neural network that does not require manual data labeling. The model performance is improved by experimentally comparing different convolutional layers and input image sizes. The model is validated using a testing dataset comprising 400 plasma discharge moments. The model has average errors of 3.7 and 4 mm for gap-in and -out, respectively, when compared to those obtained by equilibrium fitting. The proposed approach offers a convenient and effective means of obtaining the boundary gap value and is particularly suited for future fusion experimental devices, such as BEST and ITER tokamak.