## 3 Methodology  
### Improved Cycle GAN  
The methodology employed in this study is based on Cycle GAN [35; 36; 37]. Cycle GAN, utilizing images as the input, approaches the transformation from the perspective of real data, preserving complex background environments and learning the differences in insulator samples between two distributions. It captures the main structural features of insulators within the region of interest. The color space transformation within the structural features of interest is emphasized. The generator structure designed using this method consists of two extension modules for focusing on attention areas during the transformation process. The input image first undergoes treatment with the self-attention mechanism. The self-attention mechanism performs well in terms of global feature correlation. After generating their respective attention maps, the convolutional layers with shared parameters are transformed into grayscale distribution maps containing attention maps. The network structure integrated into the attention module is illustrated in Figure 5, where the image overlaps with the original input image in a masked form to retain the regions of interest learned by the attention network in the attention distribution map. The overlaid image is used as the input for generation. After transformation by the generator, it is overlaid with the parts of the attention layer with lower weights learned previously, generating a new sample that maintains a high amount of background information in the image and only transforms the information related to night, thus completing the transition of the data from day (A) to night (B).  
Successfully performing object detection tasks necessitates a sufficiently large and diverse dataset. In the context of detecting pollution discharge outlets in rivers, the spatial distribution of these outlets is sparse. This leads to a significant limitation in terms of the amount of data available for training, particularly under challenging conditions such as those in nighttime or low-light environments. Consequently, training deep neural networks, such as the original Cycle GAN architecture, can encounter issues related to vanishing and exploding gradients, which can severely hinder the convergence and performance of the model.  
Figure 4: Structure of CBAM.  
To mitigate these problems without compromising the model's effectiveness, Residual Blocks were introduced into the network. These blocks address both vanishing and exploding gradient issues by enabling smoother gradient flow during backpropagation, thereby allowing for the training of deeper networks. By adding shortcut connections, residual blocks help retain critical information across layers, ensuring that deeper networks can still achieve a good performance.  
The inclusion of a self-attention mechanism further refines the model's capabilities. The self-attention module enhances the allocation of effective weights, directing the network's focus toward the regions of the image that are more relevant to the detection task, such as the pollution discharge outlets. This selective focus improves the model's ability to accurately capture and generate the fine-grained features of pollution outlets in the generated images, ultimately increasing the accuracy of detection in challenging environments.