Brain extraction is an essential pre-processing step for neuroimaging analysis. It is difficult to achieve high-precision extraction from low-quality brain MRI images with artifacts and gray inconsistencies which often result in irregular hole regions in the extracted brain tissues. In addition, the U-Net based brain extraction methods trend to output over-smoothed brain boundary. To remove those irregular holes in the extracted mask, we proposed a new U-Net based model for brain extraction named O-Net. O-Net replaces the skip-connection path in the U-Net with a dual shortcut paths including an attention module to form an Oshaped network, which uses deep semantic information to highlight the target area while retaining more image details. O-Net effectively reduces the impact of intensity differences resulted from artifacts or gray inconsistencies in the brain MRI images on the extraction results. To obtain more precise brain boundary, we designed a new GAN based brain extraction method, which used above O-Net as the segmentation network. The discriminant network of the proposed GAN model adopts the residual structure to enhance the nonlinear expression ability of the network to balance the adversarial training of the two networks. To speed up the convergence of the proposed model, we added a segmentation loss to the adversarial loss to supervise the feature learning of the segmentation network. This method was compared with other popular brain extraction methods on two public datasets (IBSR18 and LPBA40). The mean dice similarity coefficients obtained by the proposed method were 97.26% and 98.29% on IBSR18 and LPBA40 respectively. The results of the proposed method are the best on the two public datasets. Experimental results prove that the proposed model can stably output high-precision brain tissue and reduce the influence of artifacts and gray inconsistencies.