In the area of image processing and computer vision, visual anomaly detection is a critical and difficult task. For anomaly detection in surface image data, a customized neural network incorporating self-gated rectified linear unit (SGReLU) was designed, and the SGReLU-based model excelled other activation function-based models with a top-20 average test accuracy of 99.84%. The computational time needed for the operation is 10533 s for 20 epochs and the top-20 average test loss is 0.0125 using SGReLU, both of them were comparatively less than other activation functions.