In modern conditions in the field of medicine, raster image analysis systems are becoming more widespread, which allow automating the process of establishing a diagnosis based on the results of instrumental monitoring of a patient. One of the most important stages of such an analysis is the detection of the mask of the object to be recognized on the image. It is shown that under the conditions of a multivariate and multifactorial task of analyzing medical images, the most promising are neural network tools for extracting masks. It has also been determined that the known detection tools are highly specialized and not sufficiently adapted to the variability of the conditions of use, which necessitates the construction of an effective neural network model adapted to the definition of a mask on medical images. An approach is proposed to determine the most effective type of neural network model, which provides for expert evaluation of the effectiveness of acceptable types of models and conducting computer experiments to make a final decision. It is shown that to evaluate the effectiveness of a neural network model, it is possible to use the Intersection over Union and Dice Loss metrics. The proposed solutions were verified by isolating the brachial plexus of nerve fibers on grayscale images presented in the public Ultrasound Nerve Segmentation database. The expediency of using neural network models U-Net, YOLOv4 and PSPNet was determined by expert evaluation, and with the help of computer experiments, it was proved that U-Net is the most effective in terms of Intersection over Union and Dice Loss, which provides a detection accuracy of about 0.89. Also, the analysis of the results of the experiments showed the need to improve the mathematical apparatus, which is used to calculate the mask detection indicators.