We developed a novel method based on self-supervised learning to improve the ghost imaging of occluded objects. In particular, we introduced a W-shaped neural network to preprocess the input image and enhance the overall quality and efficiency of the reconstruction method. We verified the superiority of our W-shaped self-supervised computational ghost imaging (WSCGI) method through numerical simulations and experimental validations. Our results underscore the potential of self-supervised learning in advancing ghost imaging.