Bearing end cover surface defect detection method, system, medium and equipment
The generation of high-quality bearing surface defect images through stable diffusion model and Cinema4D technology solves the problem of insufficient data in bearing defect detection in deep learning models, improves detection accuracy and efficiency, and reduces costs.
Patent Information
- Application Number
- CN202411614840.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-07-04
AI Technical Summary
Deep learning models face difficulties in obtaining data in bearing defect detection, especially the problems of scarce defect samples, imbalanced samples and poor diversity, which leads to insufficient training data and affects detection accuracy and efficiency.
The stable diffusion model is used combined with Cinema4D's 3D modeling technology, and the key features of real images are modeled and fine-tuned, high-quality synthetic images that are highly similar to real images, expanding the scale and diversity of the training set for data enhancement.
It significantly improves the performance and generalization capabilities of downstream defect detection models, reduces domain differences, reduces data acquisition costs, and improves detection accuracy and efficiency.
Smart Images

Figure CN120259163A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of surface defect detection of bearing end covers, and specifically relates to a method, system, medium and device for surface defect detection of bearing end covers based on a stable diffusion model for data augmentation. Background Art
[0002] As a key component of mechanical equipment, the detection of surface defects of bearings directly affects the operation safety and service life of the equipment. The surface of the bearing end cover usually shows defects such as pit deformation, which greatly affect the accuracy and stability of the bearing.
[0003] Deep learning models have shown significant advantages in bearing defect detection, mainly reflected in the following aspects: First, the surface defects of bearings usually have complex shapes and tiny features, which are difficult to effectively identify by traditional methods. However, deep learning models can automatically extract and identify these features, and process defects of various shapes, sizes and textures, thus showing the ability to surpass traditional methods. Second, a large amount of image data is usually generated during the industrial detection process. Manual analysis and processing of these data are not only time-consuming but also prone to errors. Deep learning models can quickly process and analyze this massive data, and have the ability to continuously learn new data, greatly improving the speed and efficiency of detection. In addition, traditional defect detection methods often rely on the experience and knowledge of experts, and manual feature extraction and rule setting are required. However, deep learning models automatically learn features and patterns in a data-driven manner, reducing the dependence on domain experts and lowering the labor cost. In summary, using deep learning models for bearing defect detection can not only provide higher accuracy and automation capabilities, but also significantly improve the detection efficiency and reduce costs.
[0004] However, a major challenge faced by deep learning models is how to obtain a large amount of high-quality data. First, the acquisition of industrial image data requires the construction of an image acquisition platform, which not only consumes manpower, time and economic costs, but also because the generation of defect samples is a small probability event, the collected data often fails to cover all scenarios, resulting in problems such as unbalanced training data samples, poor diversity and data sparsity.
[0005] The current mainstream strategy to solve the data problem is data augmentation. Its core idea is to integrate human visual prior knowledge into the data set, and generate new samples or directly generate samples by introducing changes to the existing data. As a common offline data augmentation method, synthetic data can generate samples similar to the data set, and these synthetic samples can be selectively added to the training set to increase the diversity and quantity of the training set, thus providing more comprehensive training samples.
[0006] Although there are already various methods for data augmentation through synthetic data, there are generally some limitations, mainly manifested in the lack of controllability of key features in the synthesis process, and the obvious domain differences still exist between the synthetic images and the real images. In the field of computer vision, it is generally considered that the visual realism of images is crucial. The higher the visual similarity between the synthetic data and the real data, the smaller the domain difference between the two, thus making the performance of the downstream task model trained more excellent.
[0007] Therefore, in view of the problem of the scarcity of existing defective samples, it is necessary to provide a new data augmentation scheme for synthesizing high-quality data samples. Summary of the Invention
[0008] The main object of the present invention is to provide a method, system, medium and device for bearing end cover surface defect detection based on a stable diffusion model for data augmentation.
[0009] To achieve the foregoing invention object, the technical solutions adopted by the present invention include: a method for bearing end cover surface defect detection, including:
[0010] S1, obtaining a real image of the bearing end cover surface;
[0011] S2, referring to the real image, modeling the key features of the image, and batch generating a bearing surface defect data set;
[0012] S3, fine-tuning the stable diffusion model with the real image;
[0013] S4, the fine-tuned stable diffusion model generates synthetic images under the constraint of the bearing surface defect data set obtained by modeling;
[0014] S5, evaluating whether the synthetic image is of high quality. If so, use the high-quality synthetic image to perform data augmentation on the defect detection model in the downstream task.
[0015] In a preferred embodiment, in S1, a bearing surface defect image acquisition platform is used to obtain the real image.
[0016] In a preferred embodiment, in S2, the key features include one or any combination of two or more features of object contour, defect pattern, lighting configuration and characters. The lighting configuration includes light source type, lighting direction, and the reflection behavior of the metal material under light; and / or, the characters include two characters 608Z and NZSB; and / or, an animation software Cinema4D is used to model the key features of the image.
[0017] In a preferred embodiment, in S3, the fine-tuning process includes:
[0018] S31. Randomly select several images from the real images and label each selected image.
[0019] S32. Set the hyperparameters for fine-tuning, where the hyperparameters include one or any combination of two or more parameters among the number of training epochs, batch size, learning rate of the UNet model, learning rate of the text encoder, optimizer type, and size of the matrix factorization rank.
[0020] And / or, in S3, use the real images to fine-tune the Stable Diffusion model in a low-rank adaptive manner.
[0021] In a preferred embodiment, in S4, the process of generating the synthetic image includes:
[0022] S41. During the generation process, use the bearing surface defect dataset as a reference image, combine the latent representation with noise as the initial condition and constraint in the generation process, and guide the model to gradually denoise and iterate.
[0023] S42. The formula representation of the generation process is:
[0024] H′ = StableDiffusion(h, p, g, n);
[0025] Where h and H′ are the bearing surface defect dataset and the finally generated synthetic image respectively, p is the label of the real image, and the guidance coefficient g and the noise rate n are part of the input of the SD model.
[0026] In a preferred embodiment, S2 includes the following steps:
[0027] S21. Refer to the object contour of the real image and use basic 3D modeling techniques to model the geometric contour of the bearing, simulating the overall structure and its characteristics of the bearing.
[0028] S22. Model the pit defect pattern on the bearing end cover surface, use Boolean operations to simulate the interaction between geometric entities, and simulate the real defect pattern by adjusting the interaction volume size between the collision body and the bearing model to replicate physical extrusion effects of different sizes and depths.
[0029] S23. Model the characters on the bearing surface, use basic geometric shapes combined with Boolean operations to simulate the stamping of characters on the surface.
[0030] S24. Set the lighting configuration in Cinema4D to simulate the lighting conditions in the real environment.
[0031] S25. Use the animation function of the animation software Cinema4D to batch-adjust the lighting direction and defect positions to construct the bearing surface defect dataset.
[0032] In a preferred embodiment, S24 includes: placing a standard camera provided in the animation software Cinema4D above the bearing end face, illuminating it with a disc-shaped four-part area light source, and applying a steel material that is consistent with the metallic texture in reality; finally, performing standard rendering using a global illumination model, combining multiple reflections and diffuse reflection effects, and using the irradiance cache technique to simulate indirect lighting and soft shadow effects.
[0033] The present invention also discloses another technical solution: a bearing end cover surface defect detection system, including:
[0034] An image acquisition unit for acquiring a real image of the bearing end cover surface;
[0035] A dataset generation unit for modeling the key features of the image with reference to the real image and batch generating a bearing surface defect dataset;
[0036] A fine-tuning unit for fine-tuning the stable diffusion model using the real image;
[0037] A synthetic image generation unit for generating a synthetic image by constraining the fine-tuned stable diffusion model with the bearing surface defect dataset obtained by modeling;
[0038] A data augmentation unit for evaluating whether the synthetic image is of high quality, and if so, using the high-quality synthetic image to perform data augmentation on the defect detection model in the downstream task.
[0039] On the other hand, the present invention also discloses another technical solution: a readable storage medium in which a computer program is stored, and when the computer program is run, it executes the steps in the above-mentioned bearing end cover surface defect detection method.
[0040] In yet another aspect, the present invention also discloses another technical solution: an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is run by the processor, it executes the steps in the above-mentioned bearing end cover surface defect detection method.
[0041] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0042] 1. The present invention provides a data augmentation method based on the StableDiffusion model for bearing end - cover surface defect detection. By combining the 3D modeling technology of Cinema4D with the fine - tuned StableDiffusion model, it aims to retain the key features of the bearing end - cover surface defects and batch - generate high - quality bearing surface defect images that are highly similar to real images for data augmentation, thereby expanding the scale and diversity of the training set, and significantly improving the performance of downstream defect detection models (including accuracy and generalization ability) as well as their performance in different application scenarios.
[0043] 2. The present invention has stronger controllability over key features and can be widely combined under rule constraints; the synthesized image data is extremely realistic visually, reducing the domain difference; and when these data are applied to downstream tasks, the performance of visual models is significantly improved, especially when dealing with the common phenomenon of incomplete data in the industrial field, the model accuracy is greatly improved.
[0044] 3. In some scenarios of industrial defect detection, compared with the existing label - annotation tasks that require experienced experts to complete, the present invention can directly obtain the category and location information of all objects in the synthesized images, reducing the annotation difficulty and annotation ambiguity.
[0045] 4. Once the environment of this method is constructed, the present invention can batch - generate a large number of synthetic data. At this time, the time and economic cost of obtaining a synthetic image are much lower than collecting real images, which has significant significance in actual industrial applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments recorded in the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0047] Figure 1 It is a schematic diagram of a real bearing end - cover surface defect image collected in step S1 in an embodiment of the present invention;
[0048] Figure 2 It is a schematic diagram of a roughly modeled bearing surface defect image batch - constructed in step S2 in an embodiment of the present invention;
[0049] Figure 3 It is a schematic diagram of the output result after fine - tuning the StableDiffusion model using the low - rank adaptation method in step S3 in an embodiment of the present invention;
[0050] Figure 4Schematic diagram of the synthetic image generated by the fine-tuned stable diffusion model under the constraint of the rough modeling result in Step S4 of an embodiment of the present invention;
[0051] Figure 5 Schematic diagram of the effect after data augmentation of the downstream task defect detection model using synthetic data in the present invention;
[0052] Figure 6 Schematic diagram of the process of the bearing end cover surface defect detection method in an embodiment of the present invention;
[0053] Figure 7 Schematic diagram of the principle of the bearing end cover surface defect detection system in an embodiment of the present invention. Detailed implementation manners
[0054] The present invention will be more fully understood from the following detailed implementation manners which should be read in conjunction with the accompanying drawings. Specific embodiments of the present invention are disclosed herein; however, it should be understood that the disclosed embodiments are merely exemplary of the present invention, and the present invention can be embodied in various forms. Therefore, the specific functional details disclosed herein should not be construed as limiting, but merely as a basis for the claims and as a representative basis for teaching those skilled in the art to employ the present invention in any appropriate detailed embodiment in different ways.
[0055] The present invention discloses a data augmentation scheme based on a stable diffusion model for the detection of bearing end cover surface defects. By combining the 3D modeling technology of Cinema4D with the fine-tuned stable diffusion model, it aims to retain the key features of the bearing end cover surface defects and batch generate high-quality bearing surface defect images highly similar to real images for data augmentation, thereby expanding the scale and diversity of the training set and significantly improving the performance (including accuracy and generalization ability) of the downstream defect detection model and its performance in different application scenarios.
[0056] As Figure 6 shown, a bearing end cover surface defect detection method disclosed in an embodiment of the present invention includes the following steps:
[0057] S1, obtaining real images of the bearing end cover surface.
[0058] Specifically, in this embodiment, a bearing surface defect image acquisition platform is specifically used to collect real images of the bearing end cover surface defects to provide basic data for subsequent steps, as Figure 1 shown.
[0059] S2, referring to the above real images, modeling the key features of the images, and batch generating a bearing surface defect data set.
[0060] Specifically, in this embodiment, the key features of the image mainly include one or any combination of two or more features among the object contour, defect pattern, lighting configuration, and characters. Among them, the object contour here is the contour of the bearing. The overall contour of the bearing is circular, with a circular hole in the center and some fine grooves on the outer ring. The defect pattern on the surface of the bearing end cover is mainly manifested as different-depth pits on the surface of the bearing end cover caused by uneven force during the assembly process. The lighting configuration uses four-region circular lighting, which mainly includes the light source type, lighting direction, and the reflection behavior of the metal material under light. The characters mainly include the characters at two places, 608Z and NZSB. These two are the characters engraved on the bearing, representing the 608Z bearing and Ningbo Silver Ball Bearing respectively.
[0061] In this embodiment, animation software Cinema4D (this software supports the animation output format, so it can achieve batch generation, and supports a variety of lighting algorithm models, and can achieve controllable generation of the lighting scene during the generation process) is used, but not limited to, to model the key features of the image. The modeling process does not require precise quantification, only rough modeling based on objective facts and modeling techniques is needed to minimize the visual difference between the generated result and the real image.
[0062] The step S2 specifically includes the following steps:
[0063] S21, referring to the object contour of the real image, use basic 3D modeling techniques to model the geometric contour of the bearing, and simulate the overall structure and its features of the bearing;
[0064] S22, model the pit defect pattern on the surface of the bearing end cover, use Boolean operations to simulate the interaction between geometric entities, and copy the physical extrusion effects of different sizes and depths by adjusting the interaction volume size between the collision body and the bearing model to simulate the real defect pattern.
[0065] In this step, basic geometric shapes (such as cones, spheres) are used to represent the collision body. And the method used in this step is also applied to the simulation of the engraving formation of characters in the following step S23.
[0066] S23, model the characters on the bearing surface, use basic geometric shapes combined with Boolean operations to simulate the engraving of characters on the surface;
[0067] S24, set the lighting configuration in Cinema4D to simulate the lighting conditions in the real environment.
[0068] This step specifically includes: placing the standard camera provided in the animation software Cinema4D above the bearing end face, and supplementing it with a disc-shaped four-region light source for illumination to be consistent with the illumination conditions for real image acquisition. Given the key role of material simulation in terms of depression defects and light characteristics, steel material is used in the material editor to ensure consistency with the metallic texture in reality; finally, a global illumination model is used for standard rendering, combined with multiple reflection and diffuse reflection effects, and the irradiance cache technique is used to simulate indirect lighting and soft shadow effects to enhance the lighting realism of the generated images.
[0069] S25, using the animation function of the animation software Cinema4D to batch-adjust the lighting direction and defect position to construct the bearing surface defect dataset, as Figure 2 shown.
[0070] S3, using the above real images to fine-tune the StableDiffusion model.
[0071] Specifically, although the bearing surface defect dataset obtained by modeling in step S2 above contains key features, due to being too smooth, there is still a certain visual gap from the real images. Therefore, this step uses real images to fine-tune the StableDiffusion model in a low-rank adaptive manner, enabling the model to learn and generate images close to the style of real images. Of course, other methods can also be used to fine-tune the StableDiffusion model, such as text inversion or Dreamboth, etc. As Figure 3 shown, the fine-tuned StableDiffusion model can generate images close to the real shooting style, enabling the model to better adapt to the style characteristics of real bearing images.
[0072] Among them, the fine-tuning process specifically includes:
[0073] S31, randomly extracting several images from the real images and labeling each extracted image.
[0074] In this embodiment, for example, randomly extract N images, and the label given to each image is Lora_zhoucheng_Style.
[0075] S32, set the hyperparameters for fine-tuning, and the hyperparameters include one or any combination of two or more parameters among the number of training epochs, batch size, learning rate of the UNet model, learning rate of the text encoder, optimizer type, and size of the matrix decomposition rank.
[0076] In a specific embodiment, the hyperparameters are set as follows: the number of training epochs is 100, the batch size is 1, the learning rate of UNet is 1×10 -4 and the learning rate of the text encoder is 1×10 -5, the learning rate scheduler follows the cosine annealing with restarts strategy, the optimizer type is AdamW8bit, and the size r of the matrix factorization rank is set to 128.
[0077] S4. The fine-tuned Stable Diffusion model generates synthetic images under the constraint of the bearing surface defect dataset obtained by modeling.
[0078] Specifically, although the fine-tuned Stable Diffusion model in step S3 above can generate images close to the real shooting style, the generated features may be semantically somewhat chaotic. Therefore, the present invention preferably inputs the rough modeling result generated by Cinema4D (i.e., the bearing surface defect dataset) into the fine-tuned Stable Diffusion model as a constraint, and the model can generate Figure 4 the synthetic images as shown, which not only contain key features but are also highly visually similar to real images.
[0079] S4 specifically includes the following steps:
[0080] S41. During the generation process, the above-mentioned bearing surface defect dataset is used as a reference image, combined with the latent representation and noise, as the initial condition and constraint during the generation process, guiding the model to gradually denoise and iterate, so that the finally generated image not only retains the structure and features of the reference image but also integrates the real style after fine-tuning.
[0081] S42. The formula for the generation process can be expressed as:
[0082] H′ = StableDiffusion(h, p, g, n);
[0083] where h and H′ are the above-mentioned bearing surface defect dataset and the finally generated synthetic image respectively, p is the label of the real image, that is, the above-mentioned prompt word Lora_zhoucheng_Style, the guidance coefficient g and the noise rate n are part of the input of the SD model, used to control the proportion of the prompt word and the Cinema4D image in the generation process. Empirically, the value range of the guidance coefficient g is {7, 8, 9, 10}, and the value range of the noise rate n is {0.31, 0.32, 0.33, 0.34}. These parameter selections ensure that the key features of the rough modeling are retained while making the generated images have the real bearing defect style.
[0084] S5. Evaluate whether the above synthetic image is of high quality. If so, use the high-quality above synthetic image to perform data augmentation on the defect detection model in the downstream task.
[0085] Specifically, in this embodiment, the quality of the generated synthetic images is screened by the method of human subjective evaluation, and the high-quality synthetic images are retained. These high-quality synthetic images are added to the training set for offline or online (preferably offline) data augmentation, and the defect detection models such as Faster R-CNN, YoloX, Yolov5, Yolov8, and Deformable-DETR are retrained, so as to improve the detection accuracy and generalization ability of the models. As shown in the following table, the five models after using synthetic data augmentation have significantly improved in the two accuracy metrics of AP@0.5 and AP@0.5:0.95 compared with those without data augmentation.
[0086]
[0087] As Figure 5 shown, after data augmentation, the model can detect the weak pit defects (case1 and case2) that could not be recognized on the surface of the bearing end cover originally, and when detecting multiple defect positions on the surface of the same bearing end cover, the detection effect is significantly improved (case3 and case4).
[0088] As Figure 7 shown, the embodiment of the present invention also provides a bearing end cover surface defect detection system, which specifically includes:
[0089] An image acquisition unit, configured to acquire a real image of the surface of the bearing end cover;
[0090] A dataset generation unit, configured to model the key features of the image with reference to the real image, and batch generate a bearing surface defect dataset;
[0091] A fine-tuning unit, configured to fine-tune the stable diffusion model by using the real image;
[0092] A synthetic image generation unit, configured to generate synthetic images by constraining the fine-tuned stable diffusion model under the bearing surface defect dataset obtained by modeling;
[0093] A data augmentation unit, configured to evaluate whether the synthetic image is of high quality, and if so, use the high-quality synthetic image to perform data augmentation on the defect detection model in the downstream task.
[0094] Among them, the working principles of the above units can be respectively referred to the descriptions of the above steps S1 to S5, and will not be elaborated here.
[0095] On the other hand, the present invention also provides a readable storage medium, on which a computer program is stored, and when the program is run, it implements the steps in the bearing end cover surface defect detection method provided in the above embodiment.
[0096] In another aspect, the present invention further provides an electronic device, including a memory and a processor. A computer program is stored in the memory. When the computer program is run by the processor, the steps in the above-mentioned bearing end cover surface defect detection method are executed.
[0097] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in combination with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
[0098] More specific examples (a non-exhaustive list) of the readable storage medium include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the readable storage medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other appropriate processing when necessary, and then stored in a computer memory.
[0099] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in the memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0100] All aspects, embodiments, features, and examples of the present invention should be considered illustrative in all respects and are not intended to limit the present invention. The scope of the present invention is only defined by the claims. Without departing from the spirit and scope of the claimed present invention, those skilled in the art will be aware of other embodiments, modifications, and uses.
[0101] In the present invention, the use of headings and sections is not meant to limit the invention; each section may apply to any aspect, embodiment, or feature of the invention.
Claims
1. A method for detecting surface defects of a bearing end cover, characterized in that: The method includes: S1. Obtain a real image of the bearing end cover surface; S2. Refer to the real image, model the key features of the image, and batch generate a bearing surface defect dataset; S3. Fine-tune the StableDiffusion model using the real image; S4. The fine-tuned StableDiffusion model generates synthetic images under the constraint of the bearing surface defect dataset obtained by modeling; S5. Evaluate whether the synthetic image is of high quality. If so, use the high-quality synthetic image to perform data augmentation on the defect detection model in the downstream task.
2. The surface defect detection method of a bearing end cover according to claim 1, characterized in that: In S1, a bearing surface defect image acquisition platform is used to obtain the real image.
3. A surface defect detection method for a bearing end cover according to claim 1, characterized in that: In S2, the key features include one or any combination of two or more features of object contour, defect pattern, lighting configuration, and characters. The lighting configuration includes light source type, lighting direction, and the reflection behavior of the metal material under light; and / or, the characters include the two characters 608Z and NZSB; and / or, the animation software Cinema4D is used to model the key features of the image.
4. A surface defect detection method for a bearing end cover according to claim 1, characterized in that: In S3, the fine-tuning process includes: S31. Randomly extract several images from the real image and label each extracted image; S32. Set the hyperparameters for fine-tuning. The hyperparameters include one or any combination of two or more parameters of the number of training epochs, batch size, learning rate of the UNet model, learning rate of the text encoder, optimizer type, and size of the matrix decomposition rank; and / or, in S3, the real image is used to fine-tune the StableDiffusion model in a low-rank adaptation manner.
5. A method for detecting surface defects of a bearing end cover according to claim 1, characterized in that: In S4, the process of generating synthetic images includes: S41. During the generation process, use the bearing surface defect dataset as a reference image, combine the latent representation with noise as the initial condition and constraint during the generation process, and guide the model to gradually denoise and iterate; S42. The formula representation of the generation process is: H′ = StableDiffusion(h, p, g, n); where h and H′ are the bearing surface defect dataset and the finally generated synthetic image respectively, p is the label of the real image, and the guidance coefficient g and the noise rate n are part of the input of the SD model.
6. A method for detecting surface defects of a bearing end cover according to claim 3, characterized in that: S2 includes the following steps: S21. Refer to the object contour of the real image, use basic 3D modeling technology to model the geometric contour of the bearing, and simulate the overall structure and its features of the bearing; S22. Model the pit defect pattern on the bearing end cover surface, use Boolean operations to simulate the interaction between geometric entities, and simulate the real defect pattern by adjusting the interaction volume size between the collision body and the bearing model to replicate physical extrusion effects of different sizes and depths; S23. Model the characters on the bearing surface, use basic geometric shapes combined with Boolean operations to simulate the embossing of the characters on the surface; S24. Set the lighting configuration in Cinema4D to simulate the lighting conditions in the real environment; S25. Use the animation function of the animation software Cinema4D to batch-adjust the lighting direction and defect positions, and construct the bearing surface defect dataset.
7. A method for detecting surface defects of a bearing end cover according to claim 6, characterized in that: The S24 includes: Place the standard camera provided in the animation software Cinema4D above the bearing end face, illuminate it with a disc-shaped four-region light source, and apply a steel material consistent with the metallic texture in reality; finally, perform standard rendering using the global illumination model, combine the effects of multiple reflections and diffuse reflections, and use the irradiance cache technology to simulate the indirect lighting and soft shadow effects.
8. A bearing end cover surface defect detection system, characterized in that: The system includes: An image acquisition unit for acquiring a real image of the bearing end cover surface; A dataset generation unit for referring to the real image, modeling the key features of the image, and batch-generating a bearing surface defect dataset; A fine-tuning unit for fine-tuning the stable diffusion model using the real image; A synthetic image generation unit for generating a synthetic image under the constraint of the bearing surface defect dataset obtained by modeling with the fine-tuned stable diffusion model; A data enhancement unit for evaluating whether the synthetic image is of high quality. If so, use the high-quality synthetic image to perform data enhancement on the defect detection model in the downstream task.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is run, it executes the steps in the bearing end cover surface defect detection method according to any one of the above claims 1 to 7.
10. An electronic device, characterized in that: The electronic device includes a memory and a processor. The memory stores a computer program, and when the computer program is run by the processor, it executes the steps in the bearing end cover surface defect detection method according to any one of the above claims 1 to 7.