Machine vision-driven fireplace surface defect detection method and system

By optimizing the light source layout and shadow effect analysis in machine vision system, the problem of lack of distinction in fireplace surface defect detection is solved, and the stability and accuracy of the detection are improved.

CN119624914BActive Publication Date: 2025-08-26XUZHOU XINGGUANGMEI CASTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411714758.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-08-26
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The existing machine vision system lacks the analysis of the difference in the detection of fireplace surface defects, which leads to insufficient targeting and affects the stability of the detection.

Method used

By determining the preset defect type, collecting historical missed sample sets, performing sample construction and shading effect enhancement analysis, optimizing light source layout parameters, generating shadow enhancement differentiation samples, and optimizing defect detection models.

Benefits of technology

The robustness and accuracy of the defect detection model are improved, and defects under complex backgrounds and low-light conditions can be better identified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624914B_ABST
    Figure CN119624914B_ABST
Patent Text Reader

Abstract

This application provides a machine vision-driven fireplace surface defect detection method and system, which relates to the field of defect detection technology, including: collecting a set of historical missed detection samples corresponding to a preset defect detection model; establishing defect samples to be enhanced; performing shadow effect enhancement analysis on the defect samples to be enhanced, establishing light source arrangement parameters with enhanced discrimination greater than a preset discrimination, and obtaining corresponding shadow enhancement differentiation samples; optimizing the preset defect detection model; and collecting a fireplace image after performing shadow effect enhancement processing using a set light source, inputting the optimized preset defect detection model for defect detection. This application can solve the technical problem in the prior art that image enhancement is usually performed uniformly but lacks discrimination analysis, resulting in insufficient targeting and thus affecting the stability of defect detection. By optimizing the defect detection model through shadow effect enhancement analysis, the robustness and accuracy of the defect detection model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of defect detection technology, and in particular to a machine vision-driven fireplace surface defect detection method and system. Background Art

[0002] With the continuous development of the manufacturing industry and technological advancements, the demand for various types of surface defect detection is gradually increasing. This is especially true for the surface inspection of precision equipment and high-value items. Early detection of defects is crucial to ensuring product quality and extending service life. In this process, traditional manual inspection methods are often inefficient and significantly affected by the operator's experience and subjective factors, making it difficult to ensure accuracy and consistency.

[0003] To improve inspection efficiency and accuracy, more and more companies are adopting a combination of machine vision and intelligent algorithms to automate surface defect detection. Machine vision technology uses high-resolution cameras to capture surface images and then identifies surface defects through image processing and analysis. This approach enables real-time monitoring and rapid defect location during the production process, significantly improving inspection speed and reducing labor costs. However, existing machine vision systems are still prone to missing detection of some minor surface defects. The commonly used approach is to perform image enhancement, but this lacks discriminative analysis, resulting in a lack of targeted detection.

[0004] In summary, the existing technology has a technical problem that image enhancement is usually performed uniformly but lacks analysis of the degree of distinction, resulting in insufficient targeting, which in turn affects the stability of defect detection. Summary of the Invention

[0005] The purpose of this application is to provide a machine vision-driven fireplace surface defect detection method and system to solve the technical problem in the prior art that image enhancement is usually performed uniformly but lacks analysis of the degree of differentiation, resulting in insufficient targeting and thus affecting the stability of defect detection.

[0006] In view of the above problems, the present application provides a machine vision-driven fireplace surface defect detection method and system.

[0007] In a first aspect, the present application provides a machine vision-driven fireplace surface defect detection method, which is implemented by a machine vision-driven fireplace surface defect detection system, wherein the machine vision-driven fireplace surface defect detection method includes: determining a preset defect type of the fireplace to be detected, and collecting a historical missed detection sample set corresponding to a preset defect detection model with the preset defect type as a constraint; performing sample construction based on the historical missed detection sample set to establish a defect sample to be enhanced; performing shadow effect enhancement analysis on the defect sample to be enhanced, establishing light source arrangement parameters with an enhanced distinction greater than the preset distinction, and obtaining corresponding shadow enhancement distinction samples; optimizing the preset defect detection model with the shadow enhancement distinction samples; setting the light source based on the light source arrangement parameters, and when performing defect detection on the fireplace to be detected, collecting a fireplace image after performing shadow effect enhancement processing with the set light source and inputting the optimized preset defect detection model for defect detection.

[0008] In a second aspect, the present application also provides a machine vision-driven fireplace surface defect detection system for executing the machine vision-driven fireplace surface defect detection method as described in the first aspect, wherein the machine vision-driven fireplace surface defect detection system includes: a missed detection sample acquisition module for determining a preset defect type of the fireplace to be detected, and collecting a historical missed detection sample set corresponding to a preset defect detection model with the preset defect type as a constraint; a sample construction module for performing sample construction based on the historical missed detection sample set to establish a defect sample to be enhanced; a shadow effect enhancement analysis module for performing shadow effect enhancement analysis on the defect sample to be enhanced, establishing light source arrangement parameters with an enhanced distinction greater than the preset distinction, and obtaining corresponding shadow enhancement distinction samples; a model optimization module for optimizing the preset defect detection model with the shadow enhancement distinction samples; a defect detection module for performing light source setting based on the light source arrangement parameters. When performing defect detection on the fireplace to be detected, the fireplace image is collected after shadow effect enhancement processing is performed by the set light source and then input into the optimized preset defect detection model for defect detection.

[0009] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0010] The preset defect type of the fireplace to be inspected is determined. A historical set of missed detection samples corresponding to the preset defect detection model is collected using the preset defect type as a constraint. Samples are constructed based on the historical missed detection sample set to establish defect samples to be enhanced. Shadow effect enhancement analysis is performed on the defect samples to be enhanced, light source arrangement parameters are established that achieve enhanced discrimination greater than the preset discrimination, and corresponding shadow-enhanced discrimination samples are obtained. The preset defect detection model is optimized using the shadow-enhanced discrimination samples. Light source settings are performed based on the light source arrangement parameters. When performing defect detection on the fireplace to be inspected, images of the fireplace are collected after shadow effect enhancement processing using the configured light sources, and then input into the optimized preset defect detection model for defect detection. Through shadow effect enhancement analysis, the light source arrangement is optimized, and thus the defect detection model is optimized, achieving the technical effect of improving the robustness and accuracy of the defect detection model.

[0011] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, which can be implemented in accordance with the contents of the description, and to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are specifically listed below. It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easy to understand through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in this application or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and a person of ordinary skill in the art can obtain other drawings based on the provided drawings without creative work.

[0013] Figure 1 This is a flow chart of the machine vision-driven fireplace surface defect detection method of this application.

[0014] Figure 2 This is a schematic diagram of the structure of the machine vision-driven fireplace surface defect detection system in this application.

[0015] Explanation of the accompanying symbols: missed detection sample acquisition module 11, sample construction module 12, shadow effect enhancement analysis module 13, model optimization module 14, defect detection module 15. DETAILED DESCRIPTION

[0016] This application provides a machine vision-driven fireplace surface defect detection method and system, addressing the existing technical issues of image enhancement, which typically lacks specificity and thus affects defect detection stability. By enhancing shadow effect analysis, optimizing light source placement, and thus optimizing the defect detection model, the robustness and accuracy of the defect detection model are improved.

[0017] Below, the technical solutions in this application will be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this application, rather than all the embodiments of this application. It should be understood that this application is not limited to the example embodiments described herein. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. It should also be noted that, for the convenience of description, only the parts related to this application, rather than all of them, are shown in the accompanying drawings.

[0018] For example 1, please refer to the attached Figure 1 The present application provides a machine vision-driven fireplace surface defect detection method, wherein the machine vision-driven fireplace surface defect detection method is applied to a machine vision-driven fireplace surface defect detection system, and the machine vision-driven fireplace surface defect detection method specifically includes the following steps:

[0019] Step 1: Determine the preset defect type of the fireplace to be detected, and collect a historical missed detection sample set corresponding to the preset defect detection model based on the preset defect type.

[0020] Specifically, the pre-defined defect types for fireplaces to be inspected can include cracks, bubbles, flaking, and surface unevenness, typically defined by industry standards or expert experience. These pre-defined defect types provide a foundation for subsequent inspections. Once these pre-defined defect types are determined, the next key step is to collect a corresponding historical missed detection sample set. This historical missed detection sample set refers to image data of defects that were incorrectly identified or missed during previous inspections. This historical missed detection sample set is crucial because it provides the model with potential blind spots, namely, defect types that may be overlooked by traditional inspection methods. These samples typically include defect images with complex backgrounds and high difficulty levels.

[0021] In order to collect a historical missed detection sample set, missed detection samples can be screened out from a known defect image library, or retrospective analysis can be performed through the error output of the actual detection system. For example, in the past, suppose a convolutional neural network model was used to detect the surface of a fireplace, but during the detection process, the model failed to identify certain tiny cracks or shadow areas. These unrecognized image samples constitute the historical missed detection sample set. Through these samples, the limitations of the model in dealing with certain types of defects can be revealed, such as the difficulty in identifying cracks against a complex texture background, or the unclear distinction between shadows and defective areas under low light conditions. By systematically collecting and organizing missed detection samples, data support can be provided for subsequent model improvements and the existing preset defect detection model can be optimized. Among them, the preset defect detection model is the defect detection model currently in use, such as the convolutional neural network model.

[0022] Step 2: construct samples based on the historical missed detection sample set to establish defect samples to be strengthened.

[0023] Specifically, the process of constructing samples based on historical missed detection sample sets aims to strengthen the defect recognition capabilities of the detection model in a targeted manner by analyzing the types of defects that were missed in previous detections. First, it is necessary to extract a missed defect image sample set from the historical missed detection sample set. This sample set contains defect images that were not recognized or misjudged in previous detection processes. These missed detection samples are often complex. For example, due to factors such as cluttered backgrounds or blurred defect features, standard defect detection models cannot accurately identify them. Next, the missed defect sample set is used to construct defect samples to be strengthened. The key to this process is to extract representative and difficult-to-detect defect features through in-depth analysis of missed detection samples, thereby providing a basis for subsequent model optimization, helping to optimize existing defect detection models, and enabling the model to better identify defects that were previously undetectable in practical applications.

[0024] Step 3: Perform shadow effect enhancement analysis on the defect sample to be enhanced, establish light source arrangement parameters with enhanced distinction greater than a preset distinction, and obtain corresponding shadow enhancement distinction samples.

[0025] Specifically, shadow enhancement analysis is performed on samples with defects to be enhanced. This aims to enhance the distinction between defects and background by simulating or actually adjusting the placement and illumination of light sources. Generally, lighting conditions have a significant impact on the appearance of surface defects. Different light source positions, intensities, and angles can cause variations in shadow effects, affecting the visibility and clarity of defects in images. Therefore, in defect detection, enhancing the shadow effects of samples with defects to be enhanced can effectively improve the visibility of defects, helping detection models more accurately identify these difficult-to-detect defects.

[0026] By adjusting the angle, intensity, and illumination range of the light source, attempts are made to enhance the distinction between the defect and the background. Specifically, shadow effects are enhanced by simulating different light source configuration parameters. For example, by adjusting the light source's tilt angle or brightness, the shadow area of ​​the defect becomes more prominent, while the shadow effect of the background becomes softer or more blurred, thereby enhancing the defect's discernibility. To quantify the impact of shadow effects on discrimination, the analysis step typically relies on a preset discrimination level—a standard for shadow discrimination established by the model or engineer during design. If the shadow effect produced by adjusting the light source parameters exceeds the preset discrimination level, it means that the shadow enhancement has effectively increased the contrast between the defect area and the background, helping the model distinguish these defects. Discrimination is often assessed using parameters such as grayscale value difference, edge sharpness, or contrast. For example, in the detection of cracks on a fireplace surface, a crack may appear more distinct under different light source configurations, with a clearer boundary between the shadow area and the crack itself, making it easier for the detection model to identify it.

[0027] Once the light source arrangement parameters that can effectively improve the distinction between defects and background are determined, it is necessary to use these parameters to generate shadow-enhanced distinction samples. These samples are new images captured by setting optimized light source parameters on the original defect samples to be enhanced after the shadow effect is enhanced. These new image samples contain defect areas under strong shadow effects. Their characteristics are that the defects are more prominent, the interference factors of the background are suppressed, and the shadow enhancement makes the grayscale difference between the defect and the background greater, thereby increasing the difficulty of defect identification and detection accuracy.

[0028] Step 4: Optimizing the preset defect detection model by using the shadow to enhance the distinction of samples.

[0029] Specifically, the optimization of the preset defect detection model by using shadow-enhanced differentiation samples is to apply samples that have been optimized for light sources and enhanced for shadow effects to the defect detection model to improve the accuracy and robustness of the model. Specifically. First, the generation of shadow-enhanced differentiation samples provides defect images that contain significantly enhanced shadow effects. These samples increase the prominent effect of shadows on the defect area by comparing the grayscale difference between the background and the defect, making the defect more visible in the image. These enhanced samples will be used to optimize the original defect detection model, especially when the boundary between the defect area and the background is more blurred, so that the detection model can perform better under complex lighting and background conditions. When optimizing the preset defect detection model, the shadow-enhanced differentiation samples will be used as training data to improve the original model in an incremental learning manner. Incremental learning refers to adding new training samples to the existing model to improve the detection capability of the model, so as to better adapt to the defect image after shadow enhancement.

[0030] Step 5: Setting the light source based on the light source arrangement parameters. When performing defect detection on the fireplace to be inspected, the fireplace image is captured after shadow effect enhancement processing using the set light source and then input into the optimized preset defect detection model for defect detection.

[0031] Specifically, light source placement parameters typically include information such as the position, angle, intensity, and distance of the light source. These settings can be used to adjust the light source to produce optimal shadow effects, thereby maximizing the visibility of defects. For example, suppose that through analysis and training, the optimized light source placement parameters may recommend setting the light source at a 45-degree angle to the fireplace surface, adjusting the light intensity to medium, and maintaining a distance of 30 cm from the fireplace surface. These settings can effectively enhance the shadow effect of defects such as cracks or surface peeling, making the grayscale difference between the defect and the background more obvious. In this case, the fireplace image will be able to more clearly show the defect with the help of the shadow effect when shooting.

[0032] When inspecting a fireplace for defects, the system first sets the light source based on preset light source arrangement parameters. The adjusted light source conditions will enhance the shadow effect, making the defects more prominent in the image. Then, the image is captured using the set light source, and the captured image is input into the optimized defect detection model for inspection. During this process, the optimized inspection model can identify defect features under the enhanced shadow effect, accurately distinguish defective areas from background areas, and make corresponding defect judgments.

[0033] For example, in one experiment, a thin crack on the surface of a fireplace was difficult for the detection model to identify under traditional lighting conditions. However, after enhancing the shadow effect and optimizing the light source layout parameters, a 45-degree light source was set. This intensified the crack's shadow and minimized background interference. Using this optimized defect detection model, the crack was successfully detected in the image after the lighting and shadow enhancement settings.

[0034] In summary, by setting the light source arrangement parameters and enhancing the shadow effect, the defect detection model can be significantly optimized, and the model's recognition accuracy and robustness for defects can be improved.

[0035] Furthermore, step 2 of this application includes:

[0036] A missed-detection defect image sample set is extracted according to the historical missed-detection sample set; and the defect samples to be enhanced are generated using the missed-detection defect image sample set.

[0037] Specifically, the process of extracting a missed defect image sample set based on a historical missed detection sample set is mainly aimed at identifying those images that were not accurately detected or misjudged as non-defects from past detection data, which serve as the basis for subsequent optimization of the detection model. These missed defect images usually have some special features, such as low contrast, blur, occlusion or complex background, which cause them to be ignored or misclassified in traditional detection algorithms. In order to accurately extract these missed samples, it is first necessary to conduct a detailed analysis of the historical missed detection sample set and mark the defect areas that were not identified in the original detection process. This step often relies on a combination of manual labeling and computer-aided detection tools. Through multiple iterations and manual confirmation, it is ensured that the extracted missed defect samples can cover various detection failures. The missed defect image sample set is used to generate defect samples to be strengthened, and subsequent analysis is conducted on how to strengthen these samples to improve detection accuracy.

[0038] Furthermore, step three of this application includes:

[0039] Obtain a historical light source illumination parameter set, perform shadow effect enhancement analysis on the defect sample to be enhanced based on a shadow enhancement generator, and generate a defect enhancement sample set; analyze the degree of distinction between defects and backgrounds in the defect enhancement sample set, determine the enhancement distinction, and then determine historical light source illumination parameters whose enhancement distinction is greater than a preset distinction to generate the light source arrangement parameters; extract corresponding defect enhancement samples based on the light source arrangement parameters, and perform labeling and grayscale processing on the defect area and background area to determine the shadow enhancement distinction sample.

[0040] Specifically, first, we acquire historical light source parameter sets to understand the impact of different light source configurations on defect image representation in previous experiments. These sets contain information such as illumination angle, intensity, and distance under different light source conditions. By analyzing this historical data, we can identify which light source configurations effectively enhanced the contrast between the defect and the background in previous experiments, providing a reference for subsequent shadow effect enhancement. Typically, historical light source parameter sets include a variety of different light source settings, such as direct light, diffuse light, and side light, each of which may produce different effects on different surfaces or defect types.

[0041] Next, based on the historical light source illumination parameter set, a shadow enhancement generator is used to analyze the shadow effects of the defect samples to be enhanced. The shadow enhancement generator is typically a deep learning system based on a generative adversarial network or similar model, specifically designed to simulate the impact of lighting changes on defect images. During this analysis, the generator simulates the changes in shadow effects by changing the illumination method of the light source to generate a set of defect enhancement samples. If the defect area in the defect enhancement sample set exhibits blurred edges or unclear features, this is because the illumination angle or intensity of the light source has not been fully optimized, affecting the appearance of the defect.

[0042] Next, analyzing the degree of distinction between defects and backgrounds in these defect enhancement sample sets is a key optimization step. By performing image processing on the blurred samples and marking the defect and background areas, metrics such as grayscale difference, edge clarity, or contrast between the defects and the background can be calculated. Enhanced distinction is determined by comparing these features, with the goal of finding a light source configuration that maximizes the contrast between the defect and background areas. Once the light source arrangement parameters that produce a greater degree of distinction are determined, these parameters can be used to extract the corresponding defect enhancement samples, and further image annotation and grayscale processing can be performed, that is, precise defect and background area annotation is performed to obtain shadow-enhanced differentiation samples, ensuring that the boundaries and background areas of each defect can be accurately identified. Through grayscale processing, the grayscale difference between the defect area and the background is further emphasized, optimizing the performance of the defect, making it more prominent and easier to detect.

[0043] Finally, the shadow-enhanced differentiation samples generated through these steps exhibit the following characteristics: the contrast between the defect area and the background is significantly enhanced, and the shadow effect is clearly visible and more prominent in the image. These samples will serve as optimized training data for further training and improving the defect detection model to maintain high accuracy and robustness. For example, 500 defect-enhanced samples were used. After shadow effect analysis, the light source arrangement was optimized, and it was found that the differentiation rate under a certain setting reached 70%. This optimization enabled the generated shadow-enhanced differentiation samples to perform better than the unoptimized samples in subsequent model training.

[0044] Furthermore, the present application further comprises the following steps:

[0045] The defect enhancement sample set is annotated with respect to defect areas and background areas to generate an annotated defect enhancement sample set; the annotated defect enhancement sample set is grayscale processed, and the grayscale difference between the defect area and the background area is compared to generate the enhancement distinction.

[0046] Specifically, labeling the defect and background regions of the defect-enhanced sample set is a key step in providing accurate labels for subsequent model training and discrimination evaluation. This process first requires manual or semi-automatic labeling of the defect sample images, which have been enhanced with shadow effects, to clearly indicate the specific locations of the defect and background regions within the image. Labeling is typically accomplished through image segmentation techniques, using marking tools such as rectangles, circles, and polygons to separate the defect region from the surrounding background region. For more complex defects, more detailed pixel-level labeling may be required to ensure a clear and precise outline of the defect region. Once the defect and background regions are labeled, a labeled defect-enhanced sample set is generated. These sample sets provide critical data for subsequent analysis, enabling the model to clearly distinguish between defects and background, thereby improving defect detection accuracy through subsequent processing. Next, these labeled defect-enhanced sample sets undergo grayscale processing to enhance the distinguishability between the defect and background regions. Grayscale processing typically involves converting the image's color information into a grayscale image and analyzing it based on the brightness differences between the defect and background regions. Specifically, each pixel in the image can be converted to a grayscale value (typically between 0 and 255), and then the grayscale difference between the defect area and the background area is calculated. Common grayscale processing methods include local contrast enhancement and histogram equalization. These methods can preserve defect features while making the defect area more prominent and the background area relatively weak or blurred.

[0047] After grayscale processing of the annotated sample set, the next step is to compare the grayscale differences between the defect area and the background area. The goal is to quantify the distinction between the defect area and the background area, that is, the degree of grayscale difference between the two. Specifically, the difference between the average grayscale value of the defect area and the average grayscale value of the background area can be calculated, and then divided by the standard deviation of the grayscale value of the background area to obtain the enhanced distinction. If the enhanced distinction between the defect area and the background area is large, it indicates that the shadow effect is effectively enhanced and can more effectively separate the defect from the background. Conversely, if the enhanced distinction is small, it indicates that the current light source configuration or enhancement method needs further optimization.

[0048] This series of grayscale processing and discrimination calculations generates a sample set with enhanced discrimination exceeding the preset standard. These samples will play a vital role in subsequent model training. This processing enables the model to more accurately identify defect areas while maintaining high detection accuracy under complex lighting and background conditions.

[0049] Furthermore, the present application further comprises the following steps:

[0050] Taking the fireplace features of the fireplace to be inspected and the preset defect types as constraints, the original image sample set, the light source illumination feature sample set and the shadow image generation sample set are collected; the sample combination of the original image sample set and the light source illumination feature sample set is used as the training input, and the corresponding samples in the shadow image generation sample set are used as the output supervision truth value, and the shadow enhancement generator is constructed based on generative adversarial network training.

[0051] Specifically, when building a shadow enhancement generator, the fireplace features and predefined defect types of the fireplace to be inspected must be clearly defined. This provides clear constraints for data collection and generator training. Fireplace features include information such as the fireplace's surface texture, material, and shape, while predefined defect types refer to the types of defects that may exist on the fireplace surface, such as cracks, spalling, and dents. These feature and defect type constraints ensure that the collected image samples cover the full range of possible defects on the fireplace surface, providing realistic and effective data for subsequent shadow enhancement. To this end, a set of original image samples, a set of light source illumination feature samples, and a set of shadow image generation samples are collected. The original image sample set refers to images of the fireplace surface captured under natural light or standard light sources. These images reflect the actual texture and defects of the fireplace surface. The light source illumination feature sample set includes illumination characteristics under different light source conditions, such as angle, intensity, and distance. By simulating various light source configurations, a diverse set of samples can be generated, which helps analyze the impact of varying lighting conditions on defect appearance. The shadow image generation sample set is generated by simulating the shadow effects of fireplace images under different light source conditions. These samples help train the generator to simulate and enhance shadow effects.

[0052] The training input is a combination of original image samples and samples from a light source illumination feature sample set, and the corresponding samples from a shadow image generation sample set serve as the true output supervisory value. Each sample in the shadow image generation sample set is a shadow-processed image generated under different lighting conditions. This serves as the true output of the generator, and a shadow enhancement generator is constructed based on generative adversarial network training. A generative adversarial network is a deep learning model that uses adversarial training to train the generator to produce images similar to real samples. In this scenario, the generator continuously adjusts the generated shadow-enhanced images to approximate real shadow image generation samples. Simultaneously, the discriminator determines whether the generated shadow images are similar to real shadow images, providing feedback to the generator. As training progresses, the generator gradually learns how to generate realistic shadow-enhanced images based on the original image and lighting features. During training, the generator and discriminator are continuously optimized, ultimately achieving high-quality shadow effects through a generative adversarial approach. These shadow-enhanced images can highlight defect areas under different lighting conditions and reduce background interference, enhancing defect visibility and detectability.

[0053] Experimental example: Suppose that in a fireplace crack detection task, 1,000 original images were collected and corresponding light source illumination feature samples were generated for up to five different light source configurations. A sample set was generated from shadow images, simulating the crack images and their shadow effects under different light source configurations. Finally, a generative adversarial network was trained based on this data, and the generator successfully learned to generate corresponding shadow-enhanced images based on different light source conditions. After 1,000 training iterations, the generator was able to produce images that were very close to the real shadow images, ultimately significantly improving the model's crack detection accuracy under complex lighting conditions. Through this process, the shadow-enhanced generator can not only effectively simulate and enhance the shadow effects of defect images under variable lighting conditions, but also provide clearer and more distinguishable defect samples for subsequent detection models.

[0054] Furthermore, step 4 of this application includes:

[0055] The shadow enhanced distinction samples are used as incremental learning samples; the network structure of the preset defect detection model is expanded to generate a new convolutional layer; the new convolutional layer is trained with the incremental learning samples, and the preset defect detection model is optimized with the new convolutional layer that has converged in training.

[0056] Specifically, incremental learning samples refer to samples generated by optimizing lighting and shadow effects. They enhance the distinction between defect areas and the background in the image through enhanced shadow effects. These samples can help the model learn how to effectively identify defect features and distinguish defects from the background under different lighting conditions. Therefore, using shadow-enhanced differentiation samples as incremental learning samples is to continuously expand the existing training data set during the training process, thereby improving the generalization ability of the model. The introduction of new convolutional layers is to meet the challenges brought by new samples. Traditional convolutional neural networks extract features through multiple convolutional layers. However, with the diversification and complexity of samples, existing convolutional layers may not be able to effectively capture defect features under enhanced shadows. Therefore, the expansion of the network structure can be achieved by adding new convolutional layers, especially to adapt to the new features brought by shadow enhancement.

[0057] The newly added convolutional layer will be implemented as a standalone module, located after the existing convolutional blocks in the pre-configured defect detection model. This design ensures that the introduction of the new structure does not interfere with the functionality of the existing convolutional blocks. Instead, the independent module enhances the model's ability to detect complex defects. The newly added convolutional layer will be trained specifically on incremental learning samples to extract key features under enhanced shadow conditions. The next step is to train the newly added convolutional layer using the incremental learning samples. For example, in shadow-enhanced samples, defects such as cracks or dents often exhibit stronger local contrast or structural features due to the enhanced shadow effect. The newly added convolutional layer is specifically trained to learn how to detect these features under enhanced shadow conditions. Incremental learning generally does not affect the learning ability of the existing model. Instead, it adapts to the new training data in a lightweight manner by optimizing the newly added convolutional layers. During training, the weights of the existing convolutional layers remain unchanged, while the weights of the newly added convolutional layers are gradually adjusted until the model achieves optimal feature extraction for the incremental samples.

[0058] After training converges, the newly added convolutional layers optimize the pre-set defect detection model. As training progresses, the newly added convolutional layers not only extract detailed features under enhanced shadows, but also more accurately locate and classify defect areas within the entire network. For example, in crack detection tasks, images enhanced by shadow effects may experience stronger local feature variations due to shadow interference. Traditional convolutional layers may have difficulty capturing these variations. However, the newly added convolutional layers compensate for this deficiency by learning specific shadow-enhanced features, enhancing the model's defect recognition capabilities. This improves detection accuracy while ensuring the model's adaptability and robustness.

[0059] In summary, the machine vision-driven fireplace surface defect detection method provided in this application has the following technical effects:

[0060] The preset defect type of the fireplace to be inspected is determined. Using this preset defect type as a constraint, a historical missed-detection sample set corresponding to the preset defect detection model is collected. Sample construction is performed based on this historical missed-detection sample set to establish defect samples to be enhanced. Shadow effect enhancement analysis is performed on these defect samples to establish light source arrangement parameters that achieve enhanced discrimination greater than the preset discrimination, and corresponding shadow-enhanced differentiation samples are obtained. The preset defect detection model is optimized using these shadow-enhanced differentiation samples. Light source settings are performed based on the light source arrangement parameters. When performing defect detection on the fireplace to be inspected, images of the fireplace are collected after shadow effect enhancement processing using the configured light sources, and then input into the optimized preset defect detection model for defect detection. Through shadow effect enhancement analysis, the light source arrangement is optimized, and thus the defect detection model is optimized, thereby improving the robustness and accuracy of the defect detection model.

[0061] In the second embodiment, based on the same inventive concept as the machine vision driven fireplace surface defect detection method in the above embodiment, this application also provides a machine vision driven fireplace surface defect detection system, please refer to the attached Figure 2 , the machine vision driven fireplace surface defect detection system includes:

[0062] The missed detection sample acquisition module 11 is used to determine a preset defect type of the fireplace to be detected, and collect a historical missed detection sample set corresponding to a preset defect detection model based on the preset defect type.

[0063] The sample construction module 12 is configured to construct samples based on the historical missed detection sample set to establish defect samples to be strengthened.

[0064] The shadow effect enhancement analysis module 13 is used to perform shadow effect enhancement analysis on the defect sample to be enhanced, establish light source arrangement parameters with enhanced distinction greater than a preset distinction, and obtain corresponding shadow enhancement distinction samples.

[0065] The model optimization module 14 is configured to optimize the preset defect detection model by using the shadow-enhanced distinguishing samples.

[0066] The defect detection module 15 is used to set the light source based on the light source arrangement parameters. When performing defect detection on the fireplace to be detected, the fireplace image is collected after the shadow effect is enhanced by the set light source and input into the optimized preset defect detection model for defect detection.

[0067] Furthermore, the missed detection sample acquisition module 12 in the machine vision-driven fireplace surface defect detection system is further configured to:

[0068] A missed-detection defect image sample set is extracted according to the historical missed-detection sample set; and the defect samples to be enhanced are generated using the missed-detection defect image sample set.

[0069] Furthermore, the shadow effect enhancement analysis module 13 in the machine vision-driven fireplace surface defect detection system is further configured to:

[0070] Obtain a historical light source illumination parameter set, perform shadow effect enhancement analysis on the defect sample to be enhanced based on a shadow enhancement generator, and generate a defect enhancement sample set; analyze the degree of distinction between defects and backgrounds in the defect enhancement sample set, determine the enhancement distinction, and then determine historical light source illumination parameters whose enhancement distinction is greater than a preset distinction to generate the light source arrangement parameters; extract corresponding defect enhancement samples based on the light source arrangement parameters, and perform labeling and grayscale processing on the defect area and background area to determine the shadow enhancement distinction sample.

[0071] Furthermore, the shadow effect enhancement analysis module 13 in the machine vision-driven fireplace surface defect detection system is further configured to:

[0072] The defect enhancement sample set is annotated with respect to defect areas and background areas to generate an annotated defect enhancement sample set; the annotated defect enhancement sample set is grayscale processed, and the grayscale difference between the defect area and the background area is compared to generate the enhancement distinction.

[0073] Furthermore, the shadow effect enhancement analysis module 13 in the machine vision-driven fireplace surface defect detection system is further configured to:

[0074] Taking the fireplace features of the fireplace to be inspected and the preset defect types as constraints, the original image sample set, the light source illumination feature sample set and the shadow image generation sample set are collected; the sample combination of the original image sample set and the light source illumination feature sample set is used as the training input, and the corresponding samples in the shadow image generation sample set are used as the output supervision truth value, and the shadow enhancement generator is constructed based on generative adversarial network training.

[0075] Furthermore, the model optimization module 14 in the machine vision-driven fireplace surface defect detection system is further configured to:

[0076] The shadow enhanced distinction samples are used as incremental learning samples; the network structure of the preset defect detection model is expanded to generate a new convolutional layer; the new convolutional layer is trained with the incremental learning samples, and the preset defect detection model is optimized with the new convolutional layer that has converged in training.

[0077] The newly added convolutional layer is an independent module and is located behind the original convolution block of the preset defect detection model.

[0078] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. Figure 1 The machine vision-driven fireplace surface defect detection method and specific examples in Example 1 are also applicable to the machine vision-driven fireplace surface defect detection system in this embodiment. The detailed description of the machine vision-driven fireplace surface defect detection method above will clearly explain the machine vision-driven fireplace surface defect detection system in this embodiment. For the sake of brevity, a detailed description will not be given here. Since the system disclosed in this embodiment corresponds to the method disclosed in this embodiment, the description is relatively simple. For relevant details, refer to the method description.

[0079] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

[0080] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalents, the present application is intended to include these modifications and variations.

Claims

1. A machine vision-driven fireplace surface defect detection method, characterized in that: include: Determine a preset defect type of the fireplace to be inspected, and collect a historical missed detection sample set corresponding to a preset defect detection model based on the preset defect type as a constraint; Constructing samples based on the historical missed detection sample set to establish defect samples to be strengthened; Performing shadow effect enhancement analysis on the defect sample to be enhanced, establishing light source arrangement parameters with an enhanced distinction greater than a preset distinction, and obtaining corresponding shadow enhancement differentiation samples; Optimizing the preset defect detection model by using the shadow to enhance the distinction of samples; Light source settings are performed based on the light source arrangement parameters. When performing defect detection on the fireplace to be inspected, images of the fireplace are captured after shadow effects are enhanced using the set light sources and input into an optimized preset defect detection model for defect detection. The shadow effect enhancement analysis is performed on the defect sample to be enhanced, light source arrangement parameters are established with an enhanced distinction greater than a preset distinction, and corresponding shadow enhancement distinction samples are obtained, including: Acquire a historical light source illumination parameter set, perform shadow effect enhancement analysis on the defect sample to be enhanced based on a shadow enhancement generator, and generate a defect enhancement sample set; Analyzing the degree of distinction between defects and background in the defect enhancement sample set to determine the enhanced distinction, and then determining historical light source illumination parameters where the enhanced distinction is greater than a preset distinction, to generate the light source arrangement parameters; Extracting corresponding defect enhancement samples based on the light source arrangement parameters and performing labeling and grayscale processing on defect areas and background areas to determine the shadow enhancement differentiation samples; Analyzing the degree of distinction between defects and background in the defect enhancement sample set to determine the enhancement distinction includes: Annotating defect areas and background areas of the defect enhancement sample set to generate an annotated defect enhancement sample set; After grayscale processing is performed on the marked defect enhancement sample set, the grayscale difference between the defect area and the background area is compared to generate the enhancement distinction; The steps of constructing the shadow enhancement generator include: Taking the fireplace features of the fireplace to be inspected and the preset defect type as constraints, collecting an original image sample set, a light source illumination feature sample set, and a shadow image generation sample set; The shadow enhancement generator is constructed based on generative adversarial network training, using the sample combination of the original image sample set and the light source illumination feature sample set as training input, and the corresponding samples in the shadow image generation sample set as output supervision truth values.

2. The machine vision driven fireplace surface defect detection method according to claim 1, characterized in that: Based on the historical missed detection sample set, sample construction is performed to establish defect samples to be strengthened, including: Extracting a missed-detection defect image sample set based on the historical missed-detection sample set; The defect samples to be enhanced are generated using the missed-detection defect image sample set.

3. The machine vision driven fireplace surface defect detection method according to claim 1, characterized in that: Optimizing the preset defect detection model by using the shadow to enhance the distinction of samples includes: Using the shadow-enhanced distinguished samples as incremental learning samples; Expanding the network structure of the preset defect detection model to generate a new convolutional layer; The newly added convolutional layer is trained with the incremental learning samples, and the preset defect detection model is optimized with the newly added convolutional layer that has been trained to converge.

4. The machine vision driven fireplace surface defect detection method according to claim 3, characterized in that: The newly added convolutional layer is an independent module and is located behind the original convolution block of the preset defect detection model.

5. A machine vision-driven fireplace surface defect detection system, characterized in that: The steps for implementing the machine vision-driven fireplace surface defect detection method according to any one of claims 1 to 4 are as follows: the machine vision-driven fireplace surface defect detection system comprises: A missed detection sample acquisition module is used to determine a preset defect type of the fireplace to be detected, and collect a historical missed detection sample set corresponding to a preset defect detection model based on the preset defect type; A sample construction module, configured to construct samples based on the historical missed detection sample set and establish defect samples to be strengthened; A shadow effect enhancement analysis module is used to perform shadow effect enhancement analysis on the defect sample to be enhanced, establish light source arrangement parameters with an enhanced distinction greater than a preset distinction, and obtain corresponding shadow enhancement distinction samples; A model optimization module, configured to optimize the preset defect detection model by using the shadow-enhanced differentiated samples; The defect detection module is used to set the light source based on the light source arrangement parameters. When performing defect detection on the fireplace to be detected, the image of the fireplace is collected after the shadow effect is enhanced by the set light source and then input into the optimized preset defect detection model for defect detection.

Citation Information

Patent Citations

  • Apparatus and method for enhancing optical features of workpiece, deep learning method, and medium

    CN110231340A

  • Defect detection method and device of power transmission line, electronic equipment and storage medium

    CN115239646A