The invention discloses a power transformation oil
stain defect generation method and device based on a segmentation model and a traditional method, and belongs to the technical field of power transformation equipment defect detection. According to the method, a shape
library is constructed by combining segmentation of all models, accurate positioning of defect positions is realized by using a potential-changing oil leakage area segmentation model, and oil
stain defect data conforming to physical characteristics is generated based on a traditional
image processing technology. Generating an initial shape
library by the SAM; training a potential oil leakage area segmentation model to position an oil leakage-prone area; geometric shapes in the shape
library are randomly fused in the selected ROI, and the sense of reality is enhanced through brightness matching and
Gaussian blur; and synchronously generating a segmentation
mask corresponding to the defect. According to the method,
paired data is not needed, the region-controllable high-fidelity oil
stain defect image is generated, the
bottleneck problem of model training caused by dependence on
paired data and uncontrollable generation in an existing method is solved, the generalization ability and training efficiency of a defect detection model are remarkably improved, and traceable physical interpretation is provided at the same time.