Accurate segmentation of brain gliomas (BG) is a crucial and challenging task for effective treatment planning in BG therapy. This study presents the weight loss function and dropout U‐Net with ConvNeXt block (WD‐UNeXt), which precisely segments BG from few shot MRI. The ConvNeXt block, which comprises the main body of the network, is a structure that can extract more detailed features from images. The weight loss function addresses the issue of category imbalance, thereby enhancing the network's ability to achieve more precise segmentation. The training set of BraTS2019 was used to train the network and apply it to test data. Dice similarity coefficient (DSC), sensitivity (Sen), specificity (Spec) and Hausdorff distance (HD) were used to assess the performance of the method. The experimental results demonstrate that the DSC of whole tumour, tumour core and enhancing tumour reached 0.934, 0.911 and 0.851, respectively. Sen of the sub‐regions achieved 0.922, 0.911 and 0.867. Spec and HD reached 1.000, 1.000, 1.000 and 3.224, 2.990, 2.844, respectively. Compared with the performance of state‐of‐the‐art methods, the DSC and HD of WD‐UNeXt were improved to varying degrees. Therefore, this method has considerable potential for the segmentation of BG.