A printed circuit board defect detection method and system based on image recognition
Through image recognition based on image recognition, image preprocessing, environmental compensation and material recognition of printed circuit boards are carried out, solder joints and solder overflows are identified, and heat dissipation defect detection is carried out, which solves the problems of incompleteness and low efficiency of traditional detection methods, and achieves high accuracy and high efficiency defect detection.
Patent Information
- Application Number
- CN202411825299.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-12-12
AI Technical Summary
The traditional printed circuit board defect detection methods have problems such as incomplete detection, low efficiency, easy to miss or missed detection, and are affected by environmental factors and material reflection characteristics, resulting in a decrease in the accuracy and reliability of the detection results.
Using an image recognition-based method, by obtaining the image set of printed circuit boards, image background removal and contrast enhancement are performed, combined with environmental reflection compensation and material area recognition, solder joints and solder overflow are identified, heat dissipation defect detection is carried out, and a heat dissipation defect detection model is constructed.
It improves the accuracy and reliability of defect detection, enhances the comprehensiveness and efficiency of detection, reduces subjective errors in manual inspection, and ensures the stability and safety of the production process.
Smart Images

Figure CN119295460B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a printed circuit board defect detection method and system based on image recognition. Background Art
[0002] Printed Circuit Board (PCB) is a core component of modern electronic devices and is widely used in consumer electronics, communication equipment, automotive electronics and other fields. With the increasing complexity of electronic products, the design and manufacturing process of PCB is also constantly improving. However, various defects such as short circuit, open circuit, poor welding, missing components, etc. will inevitably occur in the production process of PCB. These defects not only affect the performance of the product, but also may cause equipment failure, thereby affecting the stability and safety of the entire system. Traditional PCB defect detection methods mainly include manual inspection, optical inspection, and automated testing. Among them, although manual inspection can find some obvious defects, it is difficult to ensure the comprehensiveness and consistency of detection due to the limitations of manual subjective judgment and fatigue. In addition, manual inspection is inefficient and easily leads to missed detection or wrong detection, affecting production efficiency. Optical inspection technology is an automated detection method based on the principle of image processing. It mainly obtains images of the PCB surface through a camera and then analyzes the images to identify defects. However, traditional optical inspection systems usually rely on preset rules and feature extraction methods, which are easily affected by the reflection characteristics of PCB materials and complex backgrounds, resulting in reduced accuracy and reliability of detection results. Summary of the invention
[0003] Based on this, it is necessary for the present invention to provide a printed circuit board defect detection method and system based on image recognition to solve at least one of the above technical problems.
[0004] To achieve the above object, a printed circuit board defect detection method based on image recognition comprises the following steps:
[0005] Step S1: obtaining a printed circuit board image set, and performing image background removal on the printed circuit board image set to obtain a printed circuit board foreground image set; performing image contrast enhancement on the printed circuit board foreground image set to obtain a printed circuit board enhanced image set;
[0006] Step S2: Acquire circuit board image shooting environment data, and perform environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set; perform circuit board material area recognition on the environmental compensation image set, thereby obtaining a circuit board material area image set;
[0007] Step S3: performing circuit board solder joint recognition according to the circuit board material area image set, thereby obtaining a circuit board solder joint mark image set, performing solder joint dense area image division on the circuit board solder joint mark image set, thereby obtaining a solder joint dense area image set; performing solder overflow detection according to the solder joint dense area image set, thereby obtaining a solder overflow area image set;
[0008] Step S4: performing heat dissipation defect detection on the circuit board material compensation image set according to the solder overflow area image set, thereby obtaining a heat dissipation defect image set, and integrating heat dissipation defect features on the heat dissipation defect image set, thereby obtaining heat dissipation defect feature data;
[0009] Step S5: constructing a circuit board heat dissipation defect detection model based on the heat dissipation defect feature data and the solder overflow area image set.
[0010] The present invention ensures the diversity and representativeness of data by acquiring an image set of a printed circuit board, which is helpful for subsequent analysis. By eliminating background information, the focus can be focused on the foreground features of the PCB. This process can eliminate unnecessary visual interference and improve the accuracy of subsequent detection. The contrast of the image is enhanced, so that the defects are more obvious in the image, which helps to improve the sensitivity of defect detection, especially in a complex image environment. Reflection compensation is performed using the data of the shooting environment, which can effectively reduce the impact of environmental factors on image quality, thereby improving the accuracy of defect recognition. By identifying the PCB material area, solder joints and other important features can be extracted, laying the foundation for subsequent solder joint detection and defect analysis. Identifying solder joints based on the material area image set helps to accurately locate solder joints, thereby improving the monitoring of welding quality. By dividing the solder joint dense area, the quality problems of these areas can be analyzed centrally, and the detection efficiency can be improved. This detection process can timely discover the solder overflow problem that may occur during the welding process, and avoid affecting the PCB function. Heat dissipation defect detection is performed through the solder overflow area image set, which can discover the heat accumulation problem that may be caused during PCB design and welding, and help to identify potential faults in advance. Integrating the characteristic data of heat dissipation defects provides rich reference information for subsequent defect analysis, improving the comprehensiveness and reliability of defect detection. Building a heat dissipation defect detection model based on the extracted characteristic data and image set makes the entire detection process more systematic and intelligent. Through the automated detection model, the efficiency of PCB defect detection can be greatly improved, the subjective errors caused by manual inspection can be reduced, and the stability and safety of the production process can be ensured.
[0011] Optionally, step S1 specifically includes:
[0012] Step S11: acquiring a printed circuit board image set, and performing image classification on the printed circuit board image set, thereby obtaining a printed circuit board spectral imaging image set and a printed circuit board thermal imaging image set;
[0013] Step S12: extracting pixel color reflectance features from the printed circuit board spectral imaging image set to obtain image pixel color reflectance data, and removing low color reflectance pixel areas from the printed circuit board spectral imaging image set according to the image color reflectance data to obtain a printed circuit board spectral imaging foreground image;
[0014] Step S13: extracting pixel thermal radiation energy features from the printed circuit board thermal imaging image set to obtain image pixel thermal radiation energy data, and removing low thermal radiation energy pixel areas from the printed circuit board thermal imaging image set according to the image pixel thermal radiation energy data to obtain a printed circuit board thermal imaging foreground image;
[0015] Step S14: merging the image data of the printed circuit board spectral imaging foreground image and the printed circuit board thermal imaging foreground image, thereby obtaining a printed circuit board foreground image set;
[0016] Step S15: performing image contrast enhancement on the printed circuit board foreground image set, thereby obtaining a printed circuit board enhanced image set.
[0017] The present invention can provide basic data for subsequent analysis by acquiring a PCB image set. Classification processing ensures the distinction between different imaging technologies (spectral imaging and thermal imaging), which is conducive to improving the accuracy of subsequent processing. Combining spectral imaging with thermal imaging can obtain more comprehensive PCB feature information, which is helpful to identify potential problems such as short circuit, overheating, etc. Extracting pixel color reflectivity features helps to identify material properties and surface conditions, and can distinguish areas of different materials in the image. By eliminating low-reflectivity pixel areas, the foreground image is optimized, noise is reduced, and the signal-to-noise ratio of subsequent analysis is improved. This process can focus on the area of actual concern and improve the accuracy of analysis. Thermal imaging technology can identify the thermal distribution of PCBs and reveal potential thermal problems such as component overheating by extracting thermal radiation energy features. After eliminating low thermal radiation energy areas, a clearer thermal imaging foreground image can be obtained, making subsequent analysis more accurate, effectively diagnosing faults and improving reliability. The spectral imaging foreground image and the thermal imaging foreground image are merged to form a comprehensive foreground image set, which can simultaneously reflect the spectral characteristics and thermal characteristics of the material. Through information fusion, electrical and thermal performance can be observed in the same image, providing engineers with a more comprehensive analysis basis, thereby improving the accuracy and efficiency of fault diagnosis. Contrast enhancement of images can enhance the details in the image, making defects or features that were originally difficult to identify more obvious. The enhanced image facilitates further analysis and evaluation, ensuring that technicians can quickly identify problem areas, thereby improving detection efficiency.
[0018] Optionally, step S2 specifically includes:
[0019] Step S21: acquiring circuit board image shooting environment data, and performing environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set;
[0020] Step S22: extracting a spectral imaging image set and a thermal imaging image set from the environmental compensation image set, thereby obtaining a printed circuit board compensation spectral imaging image set and a printed circuit board compensation thermal imaging image set;
[0021] Step S23: extracting thermal radiation energy features according to the printed circuit board compensated thermal imaging image set to obtain pixel thermal radiation energy data, and clustering the pixel thermal radiation energy data to obtain thermal radiation energy clustered pixel data;
[0022] Step S24: extracting pixel wavelength light reflectance features according to the printed circuit board compensation spectrum imaging image set to obtain pixel wavelength light reflectance data, and performing wavelength light reflectance pixel clustering on the pixel wavelength light reflectance data to obtain wavelength light reflectance clustered pixel data;
[0023] Step S25: Identify the circuit board material area based on the thermal radiation energy clustered pixel data and the wavelength light reflectivity clustered pixel data, thereby obtaining a circuit board material area image set.
[0024] The present invention can effectively compensate for the environmental reflection of the image of the printed circuit board by acquiring shooting environment data (such as lighting conditions, background reflection, etc.). This process helps to eliminate background noise and enhance the characteristic information of the PCB, thereby improving the readability of the image and the accuracy of analysis. Under different shooting conditions, the ambient light will affect the color and contrast of the image. Environmental reflection compensation can standardize the image to make it more consistent and convenient for subsequent processing. By extracting the spectral imaging image set and the thermal imaging image set, multi-dimensional information of the PCB is obtained. This information contains the spectral characteristics and thermal characteristics of the material, which helps to understand the performance of the PCB more comprehensively. Spectral imaging can provide information about the composition of the material, while thermal imaging can reveal the heat distribution. The combination of the two provides a solid foundation for subsequent material property analysis. After extracting the thermal radiation energy characteristics, the thermal radiation energy data of each pixel can be obtained, which helps to identify the overheating area on the PCB, thereby warning of potential faults in advance. Clustering the pixel thermal radiation energy data can identify different thermal characteristic areas, which helps to analyze the thermal behavior of different components or areas, and then optimize the design or improve the heat dissipation performance. Extracting pixel wavelength light reflectance characteristics provides a basis for the analysis of the optical properties of materials, and can reveal the reflection, absorption and transmission characteristics of different materials to light, thereby providing guidance for material selection and design optimization. Through clustering processing, areas with different wavelength reflectance characteristics can be identified, which further helps to determine the material distribution and status on the PCB, especially in multi-layer or complex structures. Combining thermal radiation energy clustering and wavelength light reflectance clustering, different material areas on the circuit board can be effectively identified. This process is crucial for quality control and fault detection, because the performance characteristics of different materials directly affect the overall function of the PCB. The obtained circuit board material area image set provides a basis for subsequent performance analysis, fault diagnosis and optimized design. This can help engineers better understand the performance of materials in actual applications and make targeted improvements.
[0025] Optionally, step S21 is specifically:
[0026] Step S211: acquiring circuit board image shooting environment data, and performing ambient light feature extraction and ambient temperature feature extraction on the circuit board image shooting environment data, thereby obtaining shooting environment light data and shooting environment temperature data;
[0027] Step S212: performing image classification on the printed circuit board enhanced image set, thereby obtaining a printed circuit board enhanced spectral imaging image set and a printed circuit board enhanced thermal imaging image set;
[0028] Step S213: performing time-series variation statistics of the pixel wavelength light reflectance of the printed circuit board enhanced spectral imaging image set, thereby obtaining pixel wavelength light reflectance variation data, and performing time-series correlation on the shooting environment illumination data and the pixel wavelength light reflectance variation data, thereby obtaining illumination-light reflectance correlation data;
[0029] Step S214: calculating the illumination condition compensation coefficient according to the illumination-light reflectance correlation data, thereby obtaining an illumination condition compensation coefficient group, and performing pixel brightness error compensation on the printed circuit board enhanced spectral imaging image set according to the illumination condition compensation coefficient group, thereby obtaining a printed circuit board compensated spectral imaging image set;
[0030] Step S215: performing pixel thermal radiation energy change statistics on the enhanced thermal imaging image set of the printed circuit board to obtain pixel thermal radiation energy change data, and performing time-series correlation on the shooting environment temperature data and the pixel thermal radiation energy change data to obtain temperature-thermal radiation energy correlation data;
[0031] Step S216: Calculating the temperature condition compensation coefficient according to the temperature-thermal radiation energy correlation data to obtain a temperature condition compensation coefficient group, and performing pixel temperature error compensation on the printed circuit board enhanced thermal imaging image set according to the temperature condition compensation coefficient group to obtain a printed circuit board compensated thermal imaging image set;
[0032] Step S217: merging the printed circuit board compensated spectral imaging image set and the printed circuit board compensated thermal imaging image set to obtain an environmental compensation image set.
[0033] By analyzing the lighting conditions of the shooting environment, the present invention can obtain the lighting characteristics under different light sources, which provides basic data for subsequent image processing. Good lighting feature extraction can reduce the image quality degradation caused by lighting changes. Understanding the impact of ambient temperature on PCB materials and their performance is helpful to evaluate the stability and reliability of PCBs at different temperatures, thereby providing a reference for subsequent imaging analysis. By classifying the enhanced image set, different categories of PCB images can be effectively separated, which makes subsequent processing (such as spectral imaging and thermal imaging) more efficient. Classification helps to optimize specific types of PCBs and improve the accuracy and effectiveness of image processing. By performing time-series statistics on light reflectivity, the changes in the reflection characteristics of PCBs under different lighting conditions can be revealed, thereby providing an important basis for understanding the characteristics of PCB materials. This step lays the foundation for the subsequent analysis of the correlation between lighting and reflectivity, and helps to identify potential defects or performance problems. Calculating the lighting condition compensation coefficient can effectively correct the image brightness error caused by changes in ambient lighting, thereby improving the authenticity and readability of the image. The compensated spectral imaging image set will more accurately reflect the actual state of the PCB, enhancing the reliability of subsequent analysis. By statistically analyzing the changes in thermal radiation energy, we can understand the thermal characteristics of PCB under different temperature conditions. This provides important data support for evaluating circuit performance, fault detection and safety analysis. The calculation of temperature condition compensation coefficient helps to correct the thermal imaging data error caused by ambient temperature fluctuations. Through temperature compensation, the real thermal state of the PCB can be more accurately reflected, which helps to improve the accuracy of temperature analysis and thus support effective thermal management and troubleshooting. The compensated spectral imaging image set and thermal imaging image set are merged to form an environmental compensation image set, providing more comprehensive information. This integrated data not only enhances the depth and breadth of image analysis, but also lays the foundation for further automated detection and fault diagnosis, and improves the efficiency of PCB maintenance.
[0034] Optionally, step S25 is specifically:
[0035] Step S251: obtaining a circuit board material characteristic library, and extracting the circuit board material light source reflection characteristic data and the circuit board material heat radiation characteristic data from the circuit board material characteristic library, thereby obtaining the circuit board material light source reflection characteristic data and the circuit board material heat radiation characteristic data;
[0036] Step S252: performing pixel light source reflection material identification on the wavelength light reflectance clustering pixel data according to the light source reflection characteristic data of the circuit board material, thereby obtaining light reflection identification material pixel data;
[0037] Step S253: performing pixel thermal radiation energy material identification on the thermal radiation energy clustering pixel data according to the thermal radiation characteristic data of the circuit board material, thereby obtaining thermal radiation identification material pixel data;
[0038] Step S254: performing a pixel identification material intersection operation on the light reflection identification material pixel data and the heat radiation identification material pixel data, thereby obtaining the circuit board material pixel data;
[0039] Step S255: dividing the printed circuit board compensation spectral imaging image set and the printed circuit board compensation thermal imaging image set into material pixel regions according to the circuit board material pixel data, thereby obtaining a circuit board material region spectral imaging image set and a circuit board material region thermal imaging image set;
[0040] Step S256: merging the circuit board material area spectral imaging image set and the circuit board material area thermal imaging image set to obtain a circuit board material area image set.
[0041] The present invention obtains the light source reflection characteristics and thermal radiation characteristics of the circuit board material, and can establish a comprehensive characteristic library. The library provides basic data for subsequent analysis and enhances the accuracy of material identification. By extracting the light source reflection characteristics and thermal radiation characteristics, the behavior of the material under different lighting conditions can be fully understood, thereby providing a scientific basis for different application scenarios. By analyzing the clustered pixel data of wavelength light reflectance, the light source reflection characteristics of the material can be accurately identified, the probability of misidentification can be reduced, and the reliability of the automatic detection system can be improved. This process lays the foundation for the automatic identification of materials and improves the efficiency of the production line. Cluster analysis of thermal radiation energy helps to identify the performance of materials under different temperature conditions, especially in applications under high temperature or extreme environments. Thermal radiation characteristic identification can provide important data for the thermal management design of the circuit board and help design a more efficient heat dissipation system. By performing intersection operations on the pixel data of light reflection identification materials and the pixel data of thermal radiation identification materials, more comprehensive material characteristic data can be obtained to help engineers understand the performance of materials under different conditions. The intersection operation improves the integration capability of different identification processes and optimizes the utilization efficiency of data. By dividing the compensated spectral imaging image set and the thermal imaging image set into regions based on the material pixel data, different material regions can be more clearly identified, which is convenient for subsequent analysis. Regional division provides a clear framework for image analysis, making data processing more targeted, thereby improving overall analysis efficiency. By merging the data of the spectral imaging and thermal imaging image sets, a comprehensive image set can be formed, which is convenient for comparison and evaluation in subsequent analysis. The merged data set can provide engineers with more comprehensive information support and improve the quality of decision-making in the design and production process.
[0042] Optionally, step S3 specifically includes:
[0043] Step S31: performing low-frequency material region statistics on the circuit board material region image set, thereby obtaining a low-frequency material region image set;
[0044] Step S32: classifying the low-frequency material region image set, thereby obtaining a low-frequency material region spectral imaging image set and a low-frequency material region thermal imaging image set;
[0045] Step S33: dividing the low-frequency material area spectral imaging image set into low-frequency wavelength reflectivity pixel areas, thereby obtaining a low-frequency wavelength reflectivity pixel area image set;
[0046] Step S34: performing pixel thermal radiation time series variation statistics on the low-frequency material area thermal imaging image set, thereby obtaining pixel thermal radiation time series variation data, and dividing the low-frequency material area thermal imaging image set into pixel areas with high thermal radiation variation according to the pixel thermal radiation time series variation data, thereby obtaining a high thermal radiation variation pixel area image set;
[0047] Step S35: performing a pixel space position intersection operation on the low-frequency wavelength reflectivity pixel area image set and the high thermal radiation variation pixel area image set, thereby obtaining a circuit board solder joint area image set;
[0048] Step S36: marking the circuit board material area image set according to the circuit board solder point area image set, thereby obtaining the circuit board solder point marking image set, and dividing the circuit board solder point marking image set into solder point dense area images, thereby obtaining the solder point dense area image set;
[0049] Step S37: performing solder overflow detection based on the solder joint dense area image set, thereby obtaining a solder overflow area image set.
[0050] The present invention can effectively identify and extract key low-frequency material features by performing low-frequency material regional statistics on the circuit board material region image set. This process can help focus on specific material types in subsequent analysis and improve the efficiency and accuracy of data processing. At the same time, it can better understand the response characteristics of materials at different frequencies, laying the foundation for subsequent spectral and thermal imaging analysis. Classifying the low-frequency material region image set into a spectral imaging image set and a thermal imaging image set can separately process data under different physical phenomena. This classification can more clearly understand the characteristics of the material under spectral and thermal radiation and improve the pertinence of the analysis. For example, spectral imaging can reflect the chemical composition of the material, while thermal imaging can provide thermal behavior and performance information of the material. By dividing the spectral imaging image set into low-frequency wavelength reflectivity pixel regions, more detailed data related to the material reflective performance can be obtained. These data can help identify the optical properties of the material, provide a scientific basis for material selection and improved design, and thus optimize the performance and reliability of the circuit board. By statistically analyzing the temporal changes in the thermal radiation of the pixels of the thermal imaging image set, the changes in the thermal characteristics of the material during use can be grasped. This analysis helps to discover potential thermal problems, such as overheating or insufficient cooling, thereby providing guidance for subsequent product improvements. In addition, by dividing the pixel area with high thermal radiation variation, the key areas where welding defects or material failure may exist can be accurately identified, thus reducing the product failure rate. The solder joint area can be identified by performing spatial position intersection operation on the low-frequency wavelength reflectivity pixel area image set and the high thermal radiation variation pixel area image set. This operation combines optical and thermal characteristics, making the detection of solder joints more accurate and better able to evaluate the welding quality and reliability. Marking the solder joint area of the circuit board and dividing the solder joint dense area will help with subsequent quality control and defect detection. By accurately marking the solder joints, maintenance and monitoring can be carried out more quickly. At the same time, the identification of solder joint dense areas can help with automated detection in the production process and improve production efficiency. Solder overflow detection based on the solder joint dense area image set can effectively identify defects that may occur in the welding process. The automation of this process can reduce the workload and error rate of manual detection and improve the consistency and reliability of products. By detecting the solder overflow problem early, the production process can be adjusted in time to reduce the defective rate.
[0051] Optionally, step S36 is specifically:
[0052] Step S361: marking the solder joints of the circuit board material area image set according to the circuit board solder joint area image set, thereby obtaining the circuit board solder joint marking image set;
[0053] Step S362: performing thermal imaging image extraction on the circuit board solder point mark image set to obtain a circuit board solder point mark thermal imaging image set, and performing circuit board area division on the circuit board solder point mark thermal imaging image set to obtain a circuit board solder point mark area division image set;
[0054] Step S363: performing regional density evaluation on the circuit board solder joint mark region division image set, thereby obtaining circuit board image region density data;
[0055] Step S364: dividing the circuit board solder joint mark image set into solder joint dense area images according to the circuit board image area density data, thereby obtaining a solder joint dense area image set.
[0056] The present invention can efficiently and accurately identify solder joints through image analysis algorithms (such as deep learning models), thereby reducing manual identification errors. The solder joint marking image set provides a basis for subsequent thermal imaging analysis, ensures the accuracy and effectiveness of subsequent steps, provides a standardized data set for the detection and classification of solder joints, and facilitates subsequent automated processing. Dividing the solder joint area can help to more finely analyze the solder joint conditions in different areas, facilitate problem location and take targeted measures. Thermal imaging technology can quickly scan large-area circuit boards, significantly improve detection efficiency, and is particularly suitable for large-scale production. By evaluating the regional density of solder joints, areas with uneven distribution of solder joints can be identified, which helps to improve the welding process. By analyzing the density data, engineers can optimize the production process and welding parameters, and improve overall production efficiency and product quality. Identifying dense solder joint areas can help technicians concentrate resources and energy for key monitoring to ensure the welding quality of these key areas. By identifying and dealing with potential problems in dense solder joint areas in advance, the failure rate can be effectively reduced and the reliability of the product can be improved.
[0057] Optionally, step S37 is specifically:
[0058] Step S371: extracting temperature distribution features of the solder joint dense area according to the solder joint dense area image set, thereby obtaining temperature distribution data of the solder joint dense area;
[0059] Step S372: Identify regional temperature hot spots based on the temperature distribution data of the solder point dense area, thereby obtaining regional temperature hot spot solder point data;
[0060] Step S373: integrating solder joint morphological features based on the solder joint dense area temperature distribution data to obtain solder joint morphological feature data, and performing solder distribution pattern recognition based on the solder joint morphological feature data to obtain solder distribution pattern data;
[0061] Step S374: performing low-frequency solder distribution pattern statistics on the solder distribution pattern data, thereby obtaining low-frequency solder distribution pattern data;
[0062] Step S375: performing low-frequency solder distribution pattern solder point clustering on the temperature distribution data of the solder point dense area according to the low-frequency solder distribution pattern data, thereby obtaining regional low-frequency solder distribution pattern solder point data;
[0063] Step S376: Perform solder point area intersection operation on the regional temperature hot spot solder point data and the regional low-frequency solder distribution pattern solder point data to obtain solder overflow area data, and extract the solder overflow area image set from the solder point dense area image set based on the solder overflow area data to obtain the solder overflow area image set.
[0064] The present invention can obtain accurate temperature data by extracting the temperature distribution characteristics of the solder joint dense area, which is crucial for subsequent thermal management and welding quality assessment. The generated temperature distribution data can provide a basis for adjusting welding parameters, thereby optimizing the welding process and reducing welding defects. Temperature hot spots are usually areas where defects may occur during the welding process. Timely identification of hot spots helps to prevent the occurrence of welding defects. By determining the hot spot solder joint data, targeted quality control measures can be implemented to improve the consistency and reliability of the product. Integrating the morphological characteristics of the solder joints helps to fully understand the welding quality. The shape, size, distribution, etc. of the solder joints are all key factors in evaluating the reliability of welding. By identifying the solder distribution pattern, the use of solder can be optimized and the economy and efficiency of the welding process can be improved. The statistics of low-frequency solder distribution patterns can reveal the long-term trends in the welding process, help engineers identify stable welding conditions and potential improvement space, and these statistical data provide decision makers with a scientific basis to formulate more effective welding strategies. By clustering the low-frequency solder distribution patterns, the distribution of solder joints can be analyzed more accurately, providing specific data support for subsequent welding quality improvement. Cluster analysis can simplify complex data into easy-to-understand patterns, thereby improving the efficiency and accuracy of data analysis. The intersection operation helps to comprehensively evaluate the relationship between solder joints and solder distribution, identify solder overflow areas, and provide an effective means of monitoring solder defects. The extracted solder overflow area image set provides engineers with intuitive data support, helping them to quickly respond and optimize the soldering process.
[0065] Optionally, step S4 is specifically:
[0066] Step S41: extracting thermal imaging images from the circuit board material compensation image set, thereby obtaining a printed circuit board compensation thermal imaging image set;
[0067] Step S42: performing heat distribution statistics of the solder overflow area according to the solder overflow area image set, thereby obtaining heat distribution data of the solder overflow area;
[0068] Step S43: performing heat distribution statistics of the printed circuit board on the compensated thermal imaging image set of the printed circuit board, thereby obtaining heat distribution data of the printed circuit board;
[0069] Step S44: Calculating the heat difference of the heat distribution data of the solder overflow area and the heat distribution data of the circuit board, thereby obtaining the heat difference data of the solder overflow area;
[0070] Step S45: performing statistics on high heat difference areas of the heat difference data of the solder overflow area, thereby obtaining heat dissipation defect area data, and performing heat dissipation defect area image extraction on the circuit board material compensation image set according to the heat dissipation defect area data, thereby obtaining a heat dissipation defect image set;
[0071] Step S46: integrating the heat dissipation defect features of the heat dissipation defect image set to obtain heat dissipation defect feature data.
[0072] The present invention can obtain the temperature distribution of the circuit board under normal working conditions by performing thermal imaging extraction on the compensation image of the PCB material. This provides baseline data for subsequent steps, helps us understand the thermal characteristics of the circuit board under different working conditions, and lays the foundation for defect analysis. Solder overflow is a common defect in the PCB manufacturing process, which may cause short circuits or signal interference. By statistically analyzing the heat distribution of the solder overflow area, the heat distribution characteristics of these areas can be accurately evaluated, problems can be discovered in time and corresponding measures can be taken to avoid the expansion of production defects. The overall heat distribution of the PCB can be statistically analyzed to reveal the operating temperature status of different areas. This heat distribution data can help engineers understand which areas may be overheated or have potential thermal stress, thereby optimizing the design and improving the reliability and durability of the circuit board. By calculating the heat difference between the solder overflow area and the overall circuit board, the degree of influence of solder overflow on the heat distribution of the circuit board can be clarified. This difference data helps to further analyze whether solder overflow will cause local overheating, thereby identifying areas that need to be focused on. Statistics of high heat difference areas can effectively identify heat dissipation defect areas. The characteristics of these areas often indicate poor welding or material problems. Timely extraction of images of these areas can help engineers conduct more in-depth analysis and defect repair, ultimately improving the overall quality of the product. By integrating the features of the heat dissipation defect image set, the common feature data of welding defects can be extracted. This not only provides an important basis for subsequent defect detection and prevention, but also provides data support for the training of machine learning models, promoting the development of intelligent detection technology.
[0073] Optionally, the present specification also provides a printed circuit board defect detection system based on image recognition, which is used to execute the printed circuit board defect detection method based on image recognition as described above, and the printed circuit board defect detection system based on image recognition includes:
[0074] The image enhancement module is used to obtain a printed circuit board image set, and perform image background removal on the printed circuit board image set to obtain a printed circuit board foreground image set; and perform image contrast enhancement on the printed circuit board foreground image set to obtain a printed circuit board enhanced image set;
[0075] A circuit board material identification module is used to obtain circuit board image shooting environment data, and perform environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set; and perform circuit board material area identification on the environmental compensation image set, thereby obtaining a circuit board material area image set;
[0076] The solder overflow detection module is used to identify the solder joints of the circuit board according to the circuit board material area image set, thereby obtaining the circuit board solder joint mark image set, divide the circuit board solder joint mark image set into solder joint dense area images, thereby obtaining the solder joint dense area image set; perform solder overflow detection according to the solder joint dense area image set, thereby obtaining the solder overflow area image set;
[0077] A heat dissipation defect detection module is used to perform heat dissipation defect detection on the circuit board material compensation image set according to the solder overflow area image set, thereby obtaining a heat dissipation defect image set, and to perform heat dissipation defect feature integration on the heat dissipation defect image set, thereby obtaining heat dissipation defect feature data;
[0078] The defect detection model building module is used to build a circuit board heat dissipation defect detection model based on heat dissipation defect feature data and solder overflow area image set.
[0079] The printed circuit board defect detection system based on image recognition of the present invention can implement any one of the printed circuit board defect detection methods based on image recognition of the present invention, and is used to combine the operation and signal transmission medium between various modules to complete the printed circuit board defect detection method based on image recognition. The internal modules of the system cooperate with each other, thereby improving the efficiency of circuit board defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments thereof made with reference to the following drawings:
[0081] Figure 1 The figure is a schematic flow chart of the steps of the printed circuit board defect detection method based on image recognition of the present invention;
[0082] Figure 2 Detailed step flow diagram of step S1 in the present invention;
[0083] Figure 3 Detailed step flow diagram of step S2 in the present invention;
[0084] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0085] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.
[0086] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.
[0087] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0088] To achieve this, please refer to Figures 1 to 3 The present invention provides a printed circuit board defect detection method based on image recognition, the method comprising the following steps:
[0089] Step S1: obtaining a printed circuit board image set, and performing image background removal on the printed circuit board image set to obtain a printed circuit board foreground image set; performing image contrast enhancement on the printed circuit board foreground image set to obtain a printed circuit board enhanced image set;
[0090] In this embodiment, a set of images of a printed circuit board (PCB) at multiple time periods are obtained from different angles and lighting conditions using thermal imaging technology and spectral imaging technology. Next, an image processing algorithm is used to remove the background of the image, for example, an image segmentation technique (such as the GrabCut algorithm or a U-Net network based on deep learning) is used to remove the background area of the PCB, thereby obtaining a set of foreground images. Next, the foreground image set is contrast enhanced, and a method of adaptive histogram equalization (CLAHE) can be used to improve the visibility of the image, thereby generating an enhanced image set. Specific embodiments include: applying CLAHE to a set of PCB images, and the visibility of the enhanced images at the welding points and circuits is significantly improved, which is helpful for subsequent processing.
[0091] Step S2: Acquire circuit board image shooting environment data, and perform environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set; perform circuit board material area recognition on the environmental compensation image set, thereby obtaining a circuit board material area image set;
[0092] In this embodiment, data related to the PCB shooting environment is obtained through a pre-arranged sensor group, specifically including light intensity, shooting angle, temperature, humidity, etc. Through these data, an environmental model can be established, and it can be used to perform reflection compensation on the enhanced image. For example, a reflection model (such as a Phong model) is used to correct the image to eliminate reflection errors caused by changes in ambient light. Then, the image after environmental compensation is identified by material area through an image processing algorithm (such as a color or shape-based segmentation technique) to distinguish areas of different materials (such as copper, tin, resin, etc.). This process can be trained and identified using a machine learning algorithm (such as a convolutional neural network of SVM or deep learning), and finally a set of circuit board material area images is obtained.
[0093] Step S3: performing circuit board solder joint recognition according to the circuit board material area image set, thereby obtaining a circuit board solder joint mark image set, performing solder joint dense area image division on the circuit board solder joint mark image set, thereby obtaining a solder joint dense area image set; performing solder overflow detection according to the solder joint dense area image set, thereby obtaining a solder overflow area image set;
[0094] In this embodiment, feature extraction techniques (such as Hough transform or template matching) are used to identify solder joints based on the identified material area image set. A deep learning model can be trained to specifically identify solder joints and generate a solder joint mark image set. Subsequently, the solder joint mark image set is divided into solder joint dense areas, and the dense areas are identified using a clustering algorithm (such as K-means or DBSCAN) to obtain a solder joint dense area image set. Image difference detection methods, such as structural similarity (SSIM) metrics, are applied to compare images of solder joint areas and normal solder joints to detect solder overflow. A solder overflow area image set is generated, which contains all detected overflow areas.
[0095] Step S4: performing heat dissipation defect detection on the circuit board material compensation image set according to the solder overflow area image set, thereby obtaining a heat dissipation defect image set, and integrating heat dissipation defect features on the heat dissipation defect image set, thereby obtaining heat dissipation defect feature data;
[0096] In this embodiment, the solder overflow area image set is combined with the circuit board material compensation image set to detect heat dissipation defects. Thermal imaging technology or combined with a heat conduction model is used to combine temperature information with material compensation images to analyze possible heat dissipation defects. In this way, heat dissipation defects caused by solder overflow on the PCB are detected. Finally, the heat dissipation defect image set is feature integrated to extract relevant features (such as the size, location and shape of the defect) to generate heat dissipation defect feature data.
[0097] Step S5: constructing a circuit board heat dissipation defect detection model based on the heat dissipation defect feature data and the solder overflow area image set.
[0098] In this embodiment, a circuit board heat dissipation defect detection model is constructed based on the collected heat dissipation defect feature data and the solder overflow area image set. A supervised learning method can be used to select a suitable model (such as a random forest, a support vector machine, or a convolutional neural network) for training. The input of the model is the solder overflow area image and the heat dissipation defect feature data, and the output is the detection result (such as whether there is a heat dissipation defect and its location). Multiple groups of annotated PCB images can be used for training, and finally a model that can automatically detect heat dissipation defects in new images is generated, thereby improving the quality inspection efficiency in the PCB production process. During training, a cross-validation method is used to evaluate the model performance to ensure high accuracy and robustness. Finally, the model can be applied to an automated detection system to monitor circuit board heat dissipation defects in real time.
[0099] Optionally, step S1 specifically includes:
[0100] Step S11: acquiring a printed circuit board image set, and performing image classification on the printed circuit board image set, thereby obtaining a printed circuit board spectral imaging image set and a printed circuit board thermal imaging image set;
[0101] In this embodiment, a set of images of a printed circuit board (PCB) at different time periods is obtained from multiple devices (such as a high-resolution digital camera or a professional imaging device). These images cover a variety of spectral imaging and thermal imaging modes. Then, a deep learning model (such as a convolutional neural network, CNN) is used to automatically classify these images to identify whether the PCB image belongs to spectral imaging or thermal imaging. For the classification process, the network architecture used can be ResNet or Inception, etc. In the classification process, the image set can be distinguished according to its color features and thermal radiation features for subsequent processing.
[0102] Step S12: extracting pixel color reflectance features from the printed circuit board spectral imaging image set to obtain image pixel color reflectance data, and removing low color reflectance pixel areas from the printed circuit board spectral imaging image set according to the image color reflectance data to obtain a printed circuit board spectral imaging foreground image;
[0103] In this embodiment, after the spectral imaging image set is acquired, the color reflectance feature extraction is performed on the pixels in each image. The RGB image is converted into reflectance data, and the reflectance value of the image is obtained using a spectrometer. In order to extract the color reflectance feature, color spaces such as RGB and HSV can be selected for feature extraction. Then, by setting a threshold, low color reflectance areas are eliminated (such as areas with reflectance lower than the set value are noise or background). For example, areas with reflectance values lower than 0.1 can be eliminated. This process helps to focus on analyzing the main areas of the printed circuit board, such as wires, contact points, etc., while ignoring background and noise.
[0104] Step S13: extracting pixel thermal radiation energy features from the printed circuit board thermal imaging image set to obtain image pixel thermal radiation energy data, and removing low thermal radiation energy pixel areas from the printed circuit board thermal imaging image set according to the image pixel thermal radiation energy data to obtain a printed circuit board thermal imaging foreground image;
[0105] In this embodiment, the thermal radiation energy of pixels is extracted from the thermal imaging image set, and the image data is obtained using a thermal imaging camera or an infrared sensor. The thermal radiation energy of each pixel can be obtained by performing pixel-level analysis on the thermal imaging image. Specifically, the radiation energy of each pixel can be calculated using a temperature and emissivity model. By setting a temperature threshold, pixel areas with low thermal radiation energy are eliminated (for example, pixel values below 30°C are set as low-energy areas). After elimination, the retained foreground area is usually related to the working state of the circuit, such as the high-temperature components of the circuit.
[0106] Step S14: merging the image data of the printed circuit board spectral imaging foreground image and the printed circuit board thermal imaging foreground image, thereby obtaining a printed circuit board foreground image set;
[0107] In this embodiment, the two foreground images are merged at the pixel level in the same coordinate system, and the color features of the spectral imaging image and the temperature features of the thermal imaging image are superimposed by channel. Specifically, the RGB color information and the thermal radiation information of the infrared thermal image can be merged into a multi-channel image. The features of the two foreground images (such as texture, shape, edge, etc.) are extracted, and then these features are fused to obtain comprehensive image feature information. This helps to comprehensively analyze the spectral and thermal radiation information and improve the accuracy of subsequent processing.
[0108] Step S15: performing image contrast enhancement on the printed circuit board foreground image set, thereby obtaining a printed circuit board enhanced image set.
[0109] In this embodiment, the image contrast of the foreground image set is enhanced to improve the visibility of important details. The enhancement can be performed using methods such as histogram equalization, contrast-limited adaptive histogram equalization (CLAHE), gamma correction, or Laplace operator. For example, in the CLAHE method, the contrast of the local area is adaptively enhanced, especially for areas with less details, by enhancing the low-contrast area to highlight important information. In addition, when contrast enhancement is performed, it is necessary to ensure that the enhancement effect does not lead to excessive amplification of noise, and Gaussian filtering can be used for smoothing to reduce the impact of image noise.
[0110] Optionally, step S2 specifically includes:
[0111] Step S21: acquiring circuit board image shooting environment data, and performing environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set;
[0112] In this embodiment, the environmental data of the circuit board image shooting is obtained through a pre-arranged sensor group, including light intensity, light source wavelength distribution, shooting angle, and ambient temperature. The captured circuit board image is enhanced using high dynamic range imaging technology to reduce the interference of ambient light. The RAW image data is obtained using a camera sensor, and reflection compensation is performed through image processing algorithms (such as white balance adjustment and gamma correction), and finally a series of environmental compensation image sets are generated to ensure the identifiability and accuracy of circuit board features.
[0113] Step S22: extracting a spectral imaging image set and a thermal imaging image set from the environmental compensation image set, thereby obtaining a printed circuit board compensation spectral imaging image set and a printed circuit board compensation thermal imaging image set;
[0114] In this embodiment, the spectral imaging image and the thermal imaging image included in the environmental compensation image set are extracted to obtain a printed circuit board compensated spectral imaging image set and a printed circuit board compensated thermal imaging image set.
[0115] Step S23: extracting thermal radiation energy features according to the printed circuit board compensated thermal imaging image set to obtain pixel thermal radiation energy data, and clustering the pixel thermal radiation energy data to obtain thermal radiation energy clustered pixel data;
[0116] In this embodiment, a compensated thermal imaging image set is used to extract thermal radiation energy features. First, the thermal radiation energy of each pixel is calculated by image analysis software (for example, using Planck's law and Stefan-Boltzmann's law) to generate pixel thermal radiation energy data. Then, a clustering algorithm (such as K-means clustering) is applied to analyze the thermal radiation energy data to identify areas with similar thermal features, thereby obtaining thermal radiation energy clustered pixel data. These data can help identify the location and state of heating elements on the circuit board. For example, thermal imaging images are read and processed using image analysis software (such as MATLAB, Python's OpenCV or other thermal imaging analysis tools). The temperature data of each pixel (in degrees Celsius) is obtained from the thermal imager. The thermal radiation energy of each pixel is calculated using Planck's law. The formula for Planck's law is: I(\lambda, T) = \frac{2\pi hc^2}{\lambda^5} \frac{1}{e^{\frac{hc}{\lambda kT}} -1}, where I(\lambda, T) is the radiation energy per unit wavelength; h is Planck's constant (6.626 \times 10^{-34} \, \text{Js}6.626×10−34Js); c is the speed of light (3 \times 10^8 \, \text{m / s}3×108m / s); \lambda is the Boltzmann constant (1.381 \times 10^{-23} \, \text{J / K}1.381×10−23J / K); and T is the absolute temperature (in Kelvin). The total amount of radiant energy is calculated using the Stefan–Boltzmann law: E = \sigma T^4; where E is the radiant energy per unit area (watts per square meter); \sigma is the Stefan–Boltzmann constant (5.67 \times 10^{-8} \, \text{W / m}^2\text{K}^45.67×10−8W / m2K4). The above formula is then applied to each pixel to generate an array or matrix containing the thermal radiation energy of each pixel. The thermal radiation energy data of each pixel is organized into a two-dimensional array, where each row represents a pixel, containing its coordinates and thermal radiation energy value. Depending on the expected number of thermal feature areas, an appropriate K value (such as 3 or 5) is selected. The data is clustered using the K-means algorithm to identify areas with similar thermal features.
[0117] Step S24: extracting pixel wavelength light reflectance features according to the printed circuit board compensation spectrum imaging image set to obtain pixel wavelength light reflectance data, and performing wavelength light reflectance pixel clustering on the pixel wavelength light reflectance data to obtain wavelength light reflectance clustered pixel data;
[0118] In this embodiment, according to the compensated spectral imaging image set of the printed circuit board, the pixel wavelength light reflectance feature extraction is performed. The reflectance of different wavelengths is calculated using spectral analysis software to generate wavelength light reflectance data for each pixel. Subsequently, the reflectance data is grouped using a cluster analysis method (such as DBSCAN) to obtain wavelength light reflectance clustered pixel data. These data will be used to determine the optical properties and color distribution of the circuit board material. A spectral analysis instrument (such as a spectral imaging system) can be used to obtain light intensity data for each pixel at multiple wavelengths. Typically, these wavelengths can cover visible light and near-infrared regions, for example, from 400 nm to 1000 nm. Reflectance formula: R(\lambda) = \frac{I_{sample}(\lambda)}{I_{reference}(\lambda)}; wherein R(\lambda) is the reflectance, \lambda is the wavelength, and I_{sample}(\lambda) is the light intensity of the sample at wavelength \lambda. I_{reference}(\lambda) is the light intensity of a reference standard (such as a whiteboard) at the same wavelength. Then for each pixel, calculate its reflectance in the selected wavelength range to generate a reflectance dataset. The reflectance data of all pixels are organized into a matrix, with each row corresponding to a pixel and each column corresponding to a wavelength. This will form a high-dimensional dataset where each element represents the reflectance value for a specific wavelength and pixel combination. Visualize the clustering results to show the optical properties and color distribution of different materials, such as using a heat map or scatter plot.
[0119] Step S25: Identify the circuit board material area based on the thermal radiation energy clustered pixel data and the wavelength light reflectivity clustered pixel data, thereby obtaining a circuit board material area image set.
[0120] In this embodiment, the obtained thermal radiation energy cluster pixel data and wavelength light reflectivity cluster pixel data are combined to identify the circuit board material area. A multi-feature fusion method is used, such as using a support vector machine (SVM) or a convolutional neural network (CNN) for training and classification to identify different material areas (such as copper, tin, plastic, etc.). Through this step, the generated circuit board material area image set will clearly show the distribution of each material, providing an important basis for subsequent detection and analysis.
[0121] Optionally, step S21 is specifically:
[0122] Step S211: acquiring circuit board image shooting environment data, and performing ambient light feature extraction and ambient temperature feature extraction on the circuit board image shooting environment data, thereby obtaining shooting environment light data and shooting environment temperature data;
[0123] In this embodiment, the light intensity and temperature data of the circuit board shooting environment are collected in real time by sensors (such as light sensors and temperature sensors) installed on the shooting device. Specifically, the light sensor is used to measure the ambient light intensity (in lux) and record the data. The temperature sensor is used to monitor the temperature of the shooting environment (in degrees Celsius) to ensure that the environmental data collected at different times and under different conditions are representative. These data will be used for light and temperature feature extraction in subsequent image processing.
[0124] Step S212: performing image classification on the printed circuit board enhanced image set, thereby obtaining a printed circuit board enhanced spectral imaging image set and a printed circuit board enhanced thermal imaging image set;
[0125] In this embodiment, a convolutional neural network (CNN) is used to classify the enhanced printed circuit board image set, and the spectral imaging image and the thermal imaging image are classified. Based on the image sets of spectral imaging and thermal imaging that have been marked, a deep learning algorithm can be used to train the model of these marked spectral imaging and thermal imaging image sets, and then the image sets can be classified according to these trained models.
[0126] Step S213: performing time-series variation statistics of the pixel wavelength light reflectance of the printed circuit board enhanced spectral imaging image set, thereby obtaining pixel wavelength light reflectance variation data, and performing time-series correlation on the shooting environment illumination data and the pixel wavelength light reflectance variation data, thereby obtaining illumination-light reflectance correlation data;
[0127] In this embodiment, for each pixel, the time series change of light reflectivity at different wavelengths is recorded. The reflectivity data of each pixel at multiple wavelengths is obtained by a hyperspectral imaging device, and it is associated with the shooting time to generate time series change data. Further, the shooting environment illumination data and the light reflectivity change data are subjected to time series correlation analysis to establish a correlation model between illumination and light reflectivity. This process can be completed using a time series analysis method, such as an autoregressive moving average (ARMA) model.
[0128] Step S214: calculating the illumination condition compensation coefficient according to the illumination-light reflectance correlation data, thereby obtaining an illumination condition compensation coefficient group, and performing pixel brightness error compensation on the printed circuit board enhanced spectral imaging image set according to the illumination condition compensation coefficient group, thereby obtaining a printed circuit board compensated spectral imaging image set;
[0129] In this embodiment, based on the obtained illumination-light reflectance correlation data, a linear regression method is used to calculate the illumination condition compensation coefficient. The illumination data and the corresponding light reflectance data are divided into a training set and a test set. The training set data is fitted by a linear regression model to obtain the compensation coefficient. Subsequently, the coefficient is applied to the printed circuit board enhanced spectral imaging image set, and the brightness of each pixel is compensated for the error, and finally the printed circuit board compensated spectral imaging image set is obtained to enhance the accuracy of the image.
[0130] Step S215: performing pixel thermal radiation energy change statistics on the enhanced thermal imaging image set of the printed circuit board to obtain pixel thermal radiation energy change data, and performing time-series correlation on the shooting environment temperature data and the pixel thermal radiation energy change data to obtain temperature-thermal radiation energy correlation data;
[0131] In this embodiment, the pixel thermal radiation energy is statistically analyzed for the enhanced thermal imaging image set of the printed circuit board. The thermal radiation data (in watts) of each pixel is obtained using an infrared thermal imager, and the changes at each time point are recorded. By analyzing the temporal relationship between these thermal radiation energy data and the shooting environment temperature data, the correlation analysis method (such as the Pearson correlation coefficient) is used to establish the correlation data between temperature and thermal radiation energy. This will provide basic data support for subsequent temperature compensation.
[0132] Step S216: Calculating the temperature condition compensation coefficient according to the temperature-thermal radiation energy correlation data to obtain a temperature condition compensation coefficient group, and performing pixel temperature error compensation on the printed circuit board enhanced thermal imaging image set according to the temperature condition compensation coefficient group to obtain a printed circuit board compensated thermal imaging image set;
[0133] In this embodiment, the temperature condition compensation coefficient is calculated by using the obtained temperature-thermal radiation energy correlation data and adopting multivariate linear regression analysis. A regression model between temperature and thermal radiation energy is established, and the model is trained using historical data to obtain the corresponding compensation coefficient. Then, the pixel temperature error compensation is performed on the enhanced thermal imaging image set of the printed circuit board according to the coefficient to ensure the accuracy of the final thermal imaging image and generate the compensated thermal imaging image set of the printed circuit board.
[0134] Step S217: merging the printed circuit board compensated spectral imaging image set and the printed circuit board compensated thermal imaging image set to obtain an environmental compensation image set.
[0135] In this embodiment, the printed circuit board compensation spectral imaging image set and the printed circuit board compensation thermal imaging image set are merged. The two types of images are superimposed using image fusion technology, such as weighted averaging or wavelet transform, to form a comprehensive environmental compensation image set. This composite image can provide more comprehensive information, including the optical and thermal properties of the circuit board, thereby improving the accuracy and effectiveness of subsequent analysis.
[0136] Optionally, step S25 is specifically:
[0137] Step S251: obtaining a circuit board material characteristic library, and extracting the circuit board material light source reflection characteristic data and the circuit board material heat radiation characteristic data from the circuit board material characteristic library, thereby obtaining the circuit board material light source reflection characteristic data and the circuit board material heat radiation characteristic data;
[0138] In this embodiment, a complete circuit board material property library is established, including light source reflection characteristics and thermal radiation characteristics data of different materials (such as FR-4, CEM-1, polyimide, etc.). This can be obtained through laboratory testing and literature research. For each material, a spectrometer is used to measure its reflectivity at different wavelengths, and a thermal imager is used to measure its thermal radiation characteristics at a specific temperature. The extracted data should include the reflectivity and emissivity of each material in the visible and infrared spectra, and it should be systematically stored in the database for subsequent analysis.
[0139] Step S252: performing pixel light source reflection material identification on the wavelength light reflectance clustering pixel data according to the light source reflection characteristic data of the circuit board material, thereby obtaining light reflection identification material pixel data;
[0140] In this embodiment, based on the obtained light source reflection characteristic data, a clustering algorithm (such as K-means clustering) is used to analyze the wavelength light reflectance cluster pixel data. The input data is the spectral reflectance value of each pixel in the image. The algorithm will cluster similar reflectance values together to form different material categories. Finally, the material type corresponding to each cluster is identified, and an image containing light reflection identification material pixel data is generated to mark different material areas. For example, assume that the clustering results mark the pixels of FR-4 and CEM-1 materials as two different colors respectively.
[0141] Step S253: performing pixel thermal radiation energy material identification on the thermal radiation energy clustering pixel data according to the thermal radiation characteristic data of the circuit board material, thereby obtaining thermal radiation identification material pixel data;
[0142] In this embodiment, the thermal radiation energy clustering pixel data is processed based on the thermal radiation characteristic data. The thermal radiation energy value of each pixel in the thermal imaging image is used for cluster analysis. This can be obtained by a thermal imaging device to record the relationship between temperature and radiation energy. After analysis, different material types are identified, for example, some pixels are classified as high-temperature superconducting materials, while other pixels are classified as standard FR-4 materials. Finally, an image containing the thermal radiation identification material pixel data is generated, showing the thermal radiation characteristics of the material.
[0143] Step S254: performing a pixel identification material intersection operation on the light reflection identification material pixel data and the heat radiation identification material pixel data, thereby obtaining the circuit board material pixel data;
[0144] In this embodiment, the generated light reflection identification material pixel data and thermal radiation identification material pixel data are subjected to intersection operation. This process requires spatial comparison of the two sets of pixel data to find pixels that appear in both sets of data. For example, if a pixel is marked as FR-4 in the light reflection map and is also marked as FR-4 in the thermal radiation map, then this pixel will be retained in the final result. The result will generate a composite image containing the pixel data of the circuit board material.
[0145] Step S255: dividing the printed circuit board compensation spectral imaging image set and the printed circuit board compensation thermal imaging image set into material pixel regions according to the circuit board material pixel data, thereby obtaining a circuit board material region spectral imaging image set and a circuit board material region thermal imaging image set;
[0146] In this embodiment, the spectral imaging image set and the thermal imaging image set of the printed circuit board are divided into material pixel regions based on the obtained circuit board material pixel data. This can be achieved by using image segmentation technology (such as a region-based segmentation algorithm). By marking the connected areas of the same material pixels, regional images of different materials are formed. For example, the identified FR-4 area can be marked with a specific color to generate an image set showing different material areas, which is convenient for subsequent analysis and processing.
[0147] Step S256: merging the circuit board material area spectral imaging image set and the circuit board material area thermal imaging image set to obtain a circuit board material area image set.
[0148] In this embodiment, the generated spectral imaging image set and thermal imaging image set of the circuit board material area are merged. This process can be achieved using image fusion technology (such as multi-resolution fusion or image overlay method) to integrate regional information from different imaging modes. Finally, a comprehensive image is generated to show the spectral and thermal characteristics of different materials for further analysis of material performance and characteristics. For example, the merged image will simultaneously show the spectral characteristics and thermal radiation characteristics of FR-4 materials, providing engineers with more information during the design and analysis process.
[0149] Optionally, step S3 specifically includes:
[0150] Step S31: performing low-frequency material region statistics on the circuit board material region image set, thereby obtaining a low-frequency material region image set;
[0151] In this embodiment, the low-frequency material area statistics are performed on the circuit board material area image set, and image processing algorithms such as Gaussian blur and edge detection are used. First, the material area is extracted from the circuit board image set, the noise is removed by filtering, and then the material area is binarized using adaptive threshold technology. Next, the area, shape and other characteristics of the low-frequency material area are counted to form statistical data of the low-frequency material area, thereby generating a low-frequency material area image set. Image preprocessing techniques (such as median filtering and histogram equalization) in this process can effectively improve the accuracy of area recognition.
[0152] Step S32: classifying the low-frequency material region image set, thereby obtaining a low-frequency material region spectral imaging image set and a low-frequency material region thermal imaging image set;
[0153] In this embodiment, the low-frequency material area image set is classified and classified using a deep learning model (such as a convolutional neural network). First, a training set is constructed, which includes labeled spectral imaging and thermal imaging images. The model extracts features through multiple convolutional layers, and classifies through fully connected layers, outputting a low-frequency material area spectral imaging image set and a low-frequency material area thermal imaging image set. This process requires the selection of appropriate activation functions and optimization algorithms (such as the Adam optimizer) to improve classification accuracy.
[0154] Step S33: dividing the low-frequency material area spectral imaging image set into low-frequency wavelength reflectivity pixel areas, thereby obtaining a low-frequency wavelength reflectivity pixel area image set;
[0155] In this embodiment, the low-frequency material area spectral imaging image set is divided into low-frequency wavelength reflectivity pixel areas, and a spectral analysis method is used. First, the spectral features of the image are extracted, the reflectivity within the selected wavelength range is selected, and the reflectivity map is generated using the spectral data. Then, the reflectivity map is segmented, and a clustering algorithm (such as K-means) is applied to divide the pixels into different reflectivity areas to form a low-frequency wavelength reflectivity pixel area image set.
[0156] Step S34: performing pixel thermal radiation time series variation statistics on the low-frequency material area thermal imaging image set, thereby obtaining pixel thermal radiation time series variation data, and dividing the low-frequency material area thermal imaging image set into pixel areas with high thermal radiation variation according to the pixel thermal radiation time series variation data, thereby obtaining a high thermal radiation variation pixel area image set;
[0157] In this embodiment, the time series change statistics of the thermal radiation of pixels in the low-frequency material area thermal imaging image set are performed, and the thermal imaging sensor is used to continuously collect data. The change of the thermal radiation value of each pixel over time is recorded, and the time series characteristics are extracted using a time series analysis method (such as an autoregressive model), and the thermal radiation change of each pixel is calculated. Subsequently, based on these change data, the low-frequency material area thermal imaging image set is divided into pixel areas with high thermal radiation change by setting a threshold to form an image set of pixel areas with high thermal radiation change. The threshold selection needs to be optimized based on experimental data to ensure the accuracy of the detection.
[0158] Step S35: performing a pixel space position intersection operation on the low-frequency wavelength reflectivity pixel area image set and the high thermal radiation variation pixel area image set, thereby obtaining a circuit board solder joint area image set;
[0159] In this embodiment, the pixel spatial position intersection operation is performed on the low-frequency wavelength reflectivity pixel area image set and the high thermal radiation change pixel area image set. First, the two image sets are converted into binary images using image binarization technology, and the pixel areas with reflectivity and thermal radiation changes are marked respectively. Then, the intersection is obtained by logical AND operation, the circuit board solder joint area is identified, and the circuit board solder joint area image set is formed. This process needs to consider the pixel accuracy and the validity of the overlapping area to ensure the accurate detection of the solder joint. Because the solder joint usually has different reflectivity characteristics. Due to the physical properties of the solder and the substrate, the solder joint has a higher or lower reflectivity at a specific wavelength (especially a low-frequency wavelength). This reflective characteristic can be captured by imaging technology and used to identify the solder joint. The temperature change of the solder joint during operation is relatively significant. By performing the pixel spatial position intersection operation on the low-frequency wavelength reflectivity image set and the high thermal radiation change image set, the area with both high reflectivity and significant thermal radiation changes can be screened out, and the area is the solder joint area.
[0160] Step S36: marking the circuit board material area image set according to the circuit board solder point area image set, thereby obtaining the circuit board solder point marking image set, and dividing the circuit board solder point marking image set into solder point dense area images, thereby obtaining the solder point dense area image set;
[0161] In this embodiment, the solder joints of the circuit board material area image set are marked according to the circuit board solder joint area image set, and the solder joint detection is performed using a marking algorithm (such as template matching). The identified solder joint area is used as a template to match the material area image set, and the solder joint position is determined by calculating the similarity and marked. Subsequently, the solder joint marked image set is analyzed, and morphological operations (such as expansion and corrosion) are applied to divide the solder joints into dense areas, thereby obtaining a solder joint dense area image set to ensure the accuracy and effectiveness of the marking.
[0162] Step S37: performing solder overflow detection based on the solder joint dense area image set, thereby obtaining a solder overflow area image set.
[0163] In this embodiment, solder overflow detection is performed based on the image set of the dense solder joint area, using morphological analysis and machine learning algorithms. First, the image of the dense solder joint area is enhanced, and the edge detection algorithm is used to highlight the solder joint boundary. Then, a feature set is constructed, including information such as the shape, area, and color of the solder joint, and a classification algorithm (such as a support vector machine) is used to perform solder overflow detection. Finally, the image set of the solder overflow area is output, and redundant detection is removed through post-processing technology (such as non-maximum suppression) to ensure the accuracy of the detection results.
[0164] Optionally, step S36 is specifically:
[0165] Step S361: marking the solder joints of the circuit board material area image set according to the circuit board solder joint area image set, thereby obtaining the circuit board solder joint marking image set;
[0166] In this embodiment, a convolutional neural network is used to mark the corresponding solder joints in the entire circuit board material area image set according to the spatial information of each solder joint in the circuit board solder joint area image set to obtain a circuit board solder joint marking image set with solder joint markings.
[0167] Step S362: performing thermal imaging image extraction on the circuit board solder point mark image set to obtain a circuit board solder point mark thermal imaging image set, and performing circuit board area division on the circuit board solder point mark thermal imaging image set to obtain a circuit board solder point mark area division image set;
[0168] In this embodiment, thermal imaging extraction is performed on the solder joint mark image set. Thermal imaging images of each solder joint in different working states or idle states are captured, and image processing is performed to enhance the clarity of the thermal imaging. After extraction, the thermal imaging image is divided into regions, mainly based on the temperature distribution. By setting a specific temperature threshold, the solder joint area with high temperature is marked as a "high temperature area", and a thermal imaging image set of the circuit board solder joint mark is generated. At the same time, the image is further processed using an image segmentation algorithm (such as threshold segmentation or K-means clustering) to ensure that the segmentation result can accurately reflect the different areas of the circuit board.
[0169] Step S363: performing regional density evaluation on the circuit board solder joint mark region division image set, thereby obtaining circuit board image region density data;
[0170] In this embodiment, the regional density of the image set divided by the solder joint marking area is evaluated. First, the coordinates of each solder joint and its corresponding thermal imaging features are extracted, and then the number of solder joints in each area and their corresponding heat distribution are calculated. A density estimation algorithm (such as Gaussian kernel density estimation) can be used to calculate the density of the area to obtain the density data of the circuit board image area. The density distribution of different areas can be visualized for subsequent analysis.
[0171] Step S364: dividing the circuit board solder joint mark image set into solder joint dense area images according to the circuit board image area density data, thereby obtaining a solder joint dense area image set.
[0172] In this embodiment, based on the obtained circuit board image area density data, the solder joint mark image set is divided into solder joint dense area images. The specific method is to set a density threshold, and the area exceeding the threshold is considered to be a solder joint dense area. Then, the solder joint dense area is extracted using image processing tools (such as OpenCV) and a solder joint dense area image set is generated. In addition, subsequent analysis can also be performed, such as evaluating the thermal performance and welding quality of each solder joint, to provide a basis for subsequent quality control and optimization.
[0173] Optionally, step S37 is specifically:
[0174] Step S371: extracting temperature distribution features of the solder joint dense area according to the solder joint dense area image set, thereby obtaining temperature distribution data of the solder joint dense area;
[0175] In this embodiment, an image processing algorithm (such as a heat map generation algorithm) is used to process the image set of the dense solder joint area to extract the temperature distribution characteristics. This can be achieved by converting the image into a grayscale image and applying threshold segmentation, and then mapping the temperature value to a color gradient to generate a visual temperature distribution map. Finally, the obtained temperature distribution data will be stored in a matrix form for subsequent processing.
[0176] Step S372: Identify regional temperature hot spots based on the temperature distribution data of the solder point dense area, thereby obtaining regional temperature hot spot solder point data;
[0177] In this embodiment, after the temperature distribution data is extracted, a clustering algorithm (such as K-means clustering or DBSCAN algorithm) is used to analyze the temperature data to identify regional temperature hot spots. This process involves setting a temperature threshold and identifying solder joints with temperatures above the threshold as hot spot solder joints. For example, by setting the threshold to 75°C, solder joints with temperatures above this threshold in the temperature distribution data are marked as hot spots. Finally, the data of these regional temperature hot spot solder joints, including their coordinates and temperature values, are recorded for subsequent analysis.
[0178] Step S373: integrating solder joint morphological features based on the solder joint dense area temperature distribution data to obtain solder joint morphological feature data, and performing solder distribution pattern recognition based on the solder joint morphological feature data to obtain solder distribution pattern data;
[0179] In this embodiment, the morphological features of the solder joints are integrated based on the temperature distribution data. First, the geometric features of the solder joints, such as diameter, area, perimeter, and shape factor, are integrated through the image set of the dense solder joint area. For example, the spatial range of solder joints with similar reflectivity in a certain spatial range (the area occupied by each solder joint in the spectral reflectance image) can be calculated based on the data of different wavelengths in the spectral reflectance image contained in the image set of the dense solder joint area, so as to extract the geometric features of the solder joints. The edge detection algorithm (such as Canny edge detection) can also be used to identify the solder joint boundary, and then the above-mentioned geometric features are calculated. Then, these features are combined with the temperature distribution data for pattern recognition to identify the solder distribution pattern (such as a uniform distribution pattern in which the solder joint temperature and geometric features are relatively uniform, a concentrated distribution pattern in which the solder joint temperature and geometric features in a specific area are significantly higher than those in other areas, etc.). The temperature distribution around the solder joint is analyzed to obtain the temperature values at different positions and combine them with the geometric features of the solder joint. The heat flow distribution of the solder joint is determined by the temperature change in the thermal map. For example, a higher temperature may indicate a concentrated area of solder joints or unevenly distributed solder. Based on the extracted geometric features and temperature data, machine learning or statistical methods (such as cluster analysis and support vector machine) are used for pattern recognition. Finally, the solder distribution pattern data is organized into a database for subsequent use.
[0180] Step S374: performing low-frequency solder distribution pattern statistics on the solder distribution pattern data, thereby obtaining low-frequency solder distribution pattern data;
[0181] In this embodiment, after obtaining the solder distribution pattern data, low-frequency statistical analysis is performed on these data. In specific implementation, statistical analysis software or programming tools (such as Python's Pandas library) can be used to perform frequency statistics on the solder distribution pattern. Solder distribution patterns with frequencies lower than a set threshold (such as 5%) are regarded as low-frequency patterns, and the characteristics of these patterns are recorded and stored in a data set. By comparing the frequency of occurrence of each pattern, the potential causes of welding quality problems can be better understood.
[0182] Step S375: performing low-frequency solder distribution pattern solder point clustering on the temperature distribution data of the solder point dense area according to the low-frequency solder distribution pattern data, thereby obtaining regional low-frequency solder distribution pattern solder point data;
[0183] In this embodiment, solder joint clustering is implemented based on low-frequency solder distribution pattern data. In this step, a similarity metric (such as Euclidean distance) is used to perform cluster analysis on solder joints, and solder joints with low-frequency patterns are clustered. By setting the parameters of the clustering algorithm, it is ensured that solder joints with the same pattern are clustered together. Ultimately, the generated clustering results will provide regional information of the solder joints, so as to facilitate the subsequent analysis of the mutual influence between solder joints and the welding quality.
[0184] Step S376: Perform solder point area intersection operation on the regional temperature hot spot solder point data and the regional low-frequency solder distribution pattern solder point data to obtain solder overflow area data, and extract the solder overflow area image set from the solder point dense area image set based on the solder overflow area data to obtain the solder overflow area image set.
[0185] In this embodiment, the solder overflow area is identified by performing an intersection operation on the regional temperature hot spot solder point data and the low-frequency solder distribution pattern solder point data. This process can use set theory methods to find common elements of the two data sets. Then, by extracting image data related to these solder points, a solder overflow area image set is generated. For example, by marking the position of the overflow area in the original image, the relevant images are extracted for archiving. The final generated solder overflow area image set will provide a reference for subsequent quality control.
[0186] Optionally, step S4 is specifically:
[0187] Step S41: extracting thermal imaging images from the circuit board material compensation image set, thereby obtaining a printed circuit board compensation thermal imaging image set;
[0188] In this embodiment, the thermal imaging images included in the circuit board material compensation image set are extracted to obtain a printed circuit board compensation thermal imaging image set.
[0189] Step S42: performing heat distribution statistics of the solder overflow area according to the solder overflow area image set, thereby obtaining heat distribution data of the solder overflow area;
[0190] In this embodiment, a thermal imaging image set is used to perform a statistical analysis of the heat distribution of the solder overflow area. The average temperature, maximum temperature, and minimum temperature of the solder overflow area are analyzed using thermal imaging software to form heat distribution data. In addition, a data visualization tool (such as a heat map) is used to display the heat distribution of the solder overflow area, which is convenient for subsequent fault diagnosis and analysis.
[0191] Step S43: performing heat distribution statistics of the printed circuit board on the compensated thermal imaging image set of the printed circuit board, thereby obtaining heat distribution data of the printed circuit board;
[0192] In this embodiment, an image analysis tool (such as the OpenCV library in MATLAB or Python) is used to perform statistics on the overall heat distribution of the circuit board. During implementation, the thermal imaging image must first be grayed out, and a threshold must be set to identify the key hot spots on the PCB. Next, the heat value of each area is calculated and an overall heat distribution curve is generated, recording the temperature changes in specific areas (such as power supply areas, grounding areas, etc.). With these data, the heat distribution characteristics of the circuit board under different working conditions can be further analyzed to provide optimization suggestions.
[0193] Step S44: Calculating the heat difference of the heat distribution data of the solder overflow area and the heat distribution data of the circuit board, thereby obtaining the heat difference data of the solder overflow area;
[0194] In this embodiment, after obtaining the heat distribution data of the solder overflow area and the heat distribution data of the circuit board, the heat difference calculation is performed. The specific operation is to calculate the heat difference of each adjacent area and form a heat difference data set. For example, if the temperature of the solder overflow area is 80°C, and the average temperature of the area near the solder overflow area of the circuit board is 70°C, then the heat difference is 10°C. By statistically analyzing the differences in all areas, the area with abnormal temperature can be identified, and possible defects and faults can be further inferred.
[0195] Step S45: performing statistics on high heat difference areas of the heat difference data of the solder overflow area, thereby obtaining heat dissipation defect area data, and performing heat dissipation defect area image extraction on the circuit board material compensation image set according to the heat dissipation defect area data, thereby obtaining a heat dissipation defect image set;
[0196] In this embodiment, statistics of high heat difference areas are implemented for the heat difference data of the solder overflow area. A threshold value (for example, 5°C) can be set to filter the heat difference data and count the areas exceeding the threshold value. Subsequently, these high heat difference areas are image extracted in combination with the thermal imaging image set to generate an image set of heat dissipation defect areas. These images will be used for subsequent defect analysis. For example, if the heat difference near a circuit element is 6°C and there is solder overflow in the area, it can be determined as a potential heat dissipation defect.
[0197] Step S46: integrating the heat dissipation defect features of the heat dissipation defect image set to obtain heat dissipation defect feature data.
[0198] In this embodiment, for the extracted heat dissipation defect image set, heat dissipation defect feature integration is implemented. Image processing algorithms (such as edge detection, feature point extraction, etc.) are used to extract key features in the defect image. These features include the size, shape, location and heat distribution characteristics of the defect. Finally, the extracted feature data is organized into a feature database for subsequent analysis and training of machine learning models. By comparing the feature data of different image sets, a classification model for heat dissipation defects can be established to provide a basis for future production inspections.
[0199] Optionally, the present specification also provides a printed circuit board defect detection system based on image recognition, which is used to execute the printed circuit board defect detection method based on image recognition as described above, and the printed circuit board defect detection system based on image recognition includes:
[0200] The image enhancement module is used to obtain a printed circuit board image set, and perform image background removal on the printed circuit board image set to obtain a printed circuit board foreground image set; and perform image contrast enhancement on the printed circuit board foreground image set to obtain a printed circuit board enhanced image set;
[0201] A circuit board material identification module is used to obtain circuit board image shooting environment data, and perform environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set; and perform circuit board material area identification on the environmental compensation image set, thereby obtaining a circuit board material area image set;
[0202] The solder overflow detection module is used to identify the solder joints of the circuit board according to the circuit board material area image set, thereby obtaining the circuit board solder joint mark image set, divide the circuit board solder joint mark image set into solder joint dense area images, thereby obtaining the solder joint dense area image set; perform solder overflow detection according to the solder joint dense area image set, thereby obtaining the solder overflow area image set;
[0203] A heat dissipation defect detection module is used to perform heat dissipation defect detection on the circuit board material compensation image set according to the solder overflow area image set, thereby obtaining a heat dissipation defect image set, and to perform heat dissipation defect feature integration on the heat dissipation defect image set, thereby obtaining heat dissipation defect feature data;
[0204] The defect detection model building module is used to build a circuit board heat dissipation defect detection model based on heat dissipation defect feature data and solder overflow area image set.
[0205] The printed circuit board defect detection system based on image recognition of the present invention can implement any one of the printed circuit board defect detection methods based on image recognition of the present invention, and is used to combine the operation and signal transmission medium between various modules to complete the printed circuit board defect detection method based on image recognition. The internal modules of the system cooperate with each other, thereby improving the efficiency of circuit board defect detection.
[0206] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.
[0207] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those 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 invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A printed circuit board defect detection method based on image recognition, characterized in that: The following steps are involved: Step S1: obtaining a printed circuit board image set, and performing image background removal on the printed circuit board image set to obtain a printed circuit board foreground image set; performing image contrast enhancement on the printed circuit board foreground image set to obtain a printed circuit board enhanced image set; Step S2: Acquire circuit board image shooting environment data, and perform environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set; perform circuit board material area recognition on the environmental compensation image set, thereby obtaining a circuit board material area image set; Step S3: performing circuit board solder joint recognition according to the circuit board material area image set, thereby obtaining a circuit board solder joint mark image set, performing solder joint dense area image division on the circuit board solder joint mark image set, thereby obtaining a solder joint dense area image set; performing solder overflow detection according to the solder joint dense area image set, thereby obtaining a solder overflow area image set, wherein step S3 is specifically as follows: Step S31: performing low-frequency material region statistics on the circuit board material region image set, thereby obtaining a low-frequency material region image set; Step S32: classifying the low-frequency material region image set, thereby obtaining a low-frequency material region spectral imaging image set and a low-frequency material region thermal imaging image set; Step S33: dividing the low-frequency material area spectral imaging image set into low-frequency wavelength reflectivity pixel areas, thereby obtaining a low-frequency wavelength reflectivity pixel area image set; Step S34: performing pixel thermal radiation time series variation statistics on the low-frequency material area thermal imaging image set, thereby obtaining pixel thermal radiation time series variation data, and dividing the low-frequency material area thermal imaging image set into pixel areas with high thermal radiation variation according to the pixel thermal radiation time series variation data, thereby obtaining a high thermal radiation variation pixel area image set; Step S35: performing a pixel space position intersection operation on the low-frequency wavelength reflectivity pixel area image set and the high thermal radiation variation pixel area image set, thereby obtaining a circuit board solder joint area image set; Step S36: marking the circuit board material area image set according to the circuit board solder point area image set, thereby obtaining the circuit board solder point marking image set, and dividing the circuit board solder point marking image set into solder point dense area images, thereby obtaining the solder point dense area image set; Step S37: performing solder overflow detection according to the solder joint dense area image set, thereby obtaining a solder overflow area image set, wherein step S37 is specifically as follows: Step S371: extracting temperature distribution features of the solder joint dense area according to the solder joint dense area image set, thereby obtaining temperature distribution data of the solder joint dense area; Step S372: Identify regional temperature hot spots based on the temperature distribution data of the solder point dense area, thereby obtaining regional temperature hot spot solder point data; Step S373: integrating solder joint morphological features based on the solder joint dense area temperature distribution data to obtain solder joint morphological feature data, and performing solder distribution pattern recognition based on the solder joint morphological feature data to obtain solder distribution pattern data; Step S374: performing low-frequency solder distribution pattern statistics on the solder distribution pattern data, thereby obtaining low-frequency solder distribution pattern data; Step S375: performing low-frequency solder distribution pattern solder point clustering on the temperature distribution data of the solder point dense area according to the low-frequency solder distribution pattern data, thereby obtaining regional low-frequency solder distribution pattern solder point data; Step S376: performing a solder point area intersection operation on the regional temperature hot spot solder point data and the regional low-frequency solder distribution pattern solder point data, thereby obtaining solder overflow area data, and performing a solder overflow area image set extraction on the solder point dense area image set according to the solder overflow area data, thereby obtaining a solder overflow area image set; Step S4: Perform heat dissipation defect detection on the circuit board material compensation image set according to the solder overflow area image set, thereby obtaining a heat dissipation defect image set, and perform heat dissipation defect feature integration on the heat dissipation defect image set, thereby obtaining heat dissipation defect feature data, wherein step S4 is specifically as follows: Step S41: extracting thermal imaging images from the circuit board material compensation image set, thereby obtaining a printed circuit board compensation thermal imaging image set; Step S42: performing heat distribution statistics of the solder overflow area according to the solder overflow area image set, thereby obtaining heat distribution data of the solder overflow area; Step S43: performing heat distribution statistics of the printed circuit board on the compensated thermal imaging image set of the printed circuit board, thereby obtaining heat distribution data of the printed circuit board; Step S44: Calculating the heat difference of the heat distribution data of the solder overflow area and the heat distribution data of the circuit board, thereby obtaining the heat difference data of the solder overflow area; Step S45: performing statistics on high heat difference areas of the heat difference data of the solder overflow area, thereby obtaining heat dissipation defect area data, and performing heat dissipation defect area image extraction on the circuit board material compensation image set according to the heat dissipation defect area data, thereby obtaining a heat dissipation defect image set; Step S46: integrating heat dissipation defect features on the heat dissipation defect image set, thereby obtaining heat dissipation defect feature data; Step S5: constructing a circuit board heat dissipation defect detection model based on the heat dissipation defect feature data and the solder overflow area image set.
2. The printed circuit board defect detection method based on image recognition according to claim 1, characterized in that: Step S1 is specifically as follows: Step S11: acquiring a printed circuit board image set, and classifying the printed circuit board image set, thereby obtaining a printed circuit board spectral imaging image set and a printed circuit board thermal imaging image set; Step S12: extracting pixel color reflectance features from the printed circuit board spectral imaging image set to obtain image pixel color reflectance data, and removing low color reflectance pixel areas from the printed circuit board spectral imaging image set according to the image color reflectance data to obtain a printed circuit board spectral imaging foreground image; Step S13: extracting pixel thermal radiation energy features from the printed circuit board thermal imaging image set to obtain image pixel thermal radiation energy data, and removing low thermal radiation energy pixel areas from the printed circuit board thermal imaging image set according to the image pixel thermal radiation energy data to obtain a printed circuit board thermal imaging foreground image; Step S14: merging the image data of the printed circuit board spectral imaging foreground image and the printed circuit board thermal imaging foreground image, thereby obtaining a printed circuit board foreground image set; Step S15: performing image contrast enhancement on the printed circuit board foreground image set, thereby obtaining a printed circuit board enhanced image set.
3. The printed circuit board defect detection method based on image recognition according to claim 1, characterized in that: Step S2 is specifically as follows: Step S21: acquiring circuit board image shooting environment data, and performing environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set; Step S22: extracting a spectral imaging image set and a thermal imaging image set from the environmental compensation image set, thereby obtaining a printed circuit board compensation spectral imaging image set and a printed circuit board compensation thermal imaging image set; Step S23: extracting thermal radiation energy features according to the printed circuit board compensated thermal imaging image set to obtain pixel thermal radiation energy data, and clustering the pixel thermal radiation energy data to obtain thermal radiation energy clustered pixel data; Step S24: extracting pixel wavelength light reflectance features according to the printed circuit board compensation spectrum imaging image set to obtain pixel wavelength light reflectance data, and performing wavelength light reflectance pixel clustering on the pixel wavelength light reflectance data to obtain wavelength light reflectance clustered pixel data; Step S25: Identify the circuit board material area based on the thermal radiation energy clustered pixel data and the wavelength light reflectivity clustered pixel data, thereby obtaining a circuit board material area image set.
4. The printed circuit board defect detection method based on image recognition according to claim 3 is characterized in that: Step S21 is specifically as follows: Step S211: acquiring circuit board image shooting environment data, and performing ambient light feature extraction and ambient temperature feature extraction on the circuit board image shooting environment data, thereby obtaining shooting environment light data and shooting environment temperature data; Step S212: performing image classification on the printed circuit board enhanced image set, thereby obtaining a printed circuit board enhanced spectral imaging image set and a printed circuit board enhanced thermal imaging image set; Step S213: performing time-series variation statistics of the pixel wavelength light reflectance of the printed circuit board enhanced spectral imaging image set, thereby obtaining pixel wavelength light reflectance variation data, and performing time-series correlation on the shooting environment illumination data and the pixel wavelength light reflectance variation data, thereby obtaining illumination-light reflectance correlation data; Step S214: calculating the illumination condition compensation coefficient according to the illumination-light reflectance correlation data, thereby obtaining an illumination condition compensation coefficient group, and performing pixel brightness error compensation on the printed circuit board enhanced spectral imaging image set according to the illumination condition compensation coefficient group, thereby obtaining a printed circuit board compensated spectral imaging image set; Step S215: performing pixel thermal radiation energy change statistics on the enhanced thermal imaging image set of the printed circuit board to obtain pixel thermal radiation energy change data, and performing time-series correlation on the shooting environment temperature data and the pixel thermal radiation energy change data to obtain temperature-thermal radiation energy correlation data; Step S216: Calculating the temperature condition compensation coefficient according to the temperature-thermal radiation energy correlation data to obtain a temperature condition compensation coefficient group, and performing pixel temperature error compensation on the printed circuit board enhanced thermal imaging image set according to the temperature condition compensation coefficient group to obtain a printed circuit board compensated thermal imaging image set; Step S217: merging the printed circuit board compensated spectral imaging image set and the printed circuit board compensated thermal imaging image set to obtain an environmental compensation image set.
5. The printed circuit board defect detection method based on image recognition according to claim 3 is characterized in that: Step S25 is specifically as follows: Step S251: obtaining a circuit board material characteristic library, and extracting the circuit board material light source reflection characteristic data and the circuit board material heat radiation characteristic data from the circuit board material characteristic library, thereby obtaining the circuit board material light source reflection characteristic data and the circuit board material heat radiation characteristic data; Step S252: performing pixel light source reflection material identification on the wavelength light reflectance clustering pixel data according to the light source reflection characteristic data of the circuit board material, thereby obtaining light reflection identification material pixel data; Step S253: performing pixel thermal radiation energy material identification on the thermal radiation energy clustering pixel data according to the thermal radiation characteristic data of the circuit board material, thereby obtaining thermal radiation identification material pixel data; Step S254: performing a pixel identification material intersection operation on the light reflection identification material pixel data and the heat radiation identification material pixel data, thereby obtaining the circuit board material pixel data; Step S255: dividing the printed circuit board compensation spectral imaging image set and the printed circuit board compensation thermal imaging image set into material pixel regions according to the circuit board material pixel data, thereby obtaining a circuit board material region spectral imaging image set and a circuit board material region thermal imaging image set; Step S256: merging the circuit board material area spectral imaging image set and the circuit board material area thermal imaging image set to obtain a circuit board material area image set.
6. The printed circuit board defect detection method based on image recognition according to claim 1, characterized in that: Step S36 is specifically as follows: Step S361: marking the solder joints of the circuit board material area image set according to the circuit board solder joint area image set, thereby obtaining the circuit board solder joint marking image set; Step S362: performing thermal imaging image extraction on the circuit board solder point mark image set to obtain a circuit board solder point mark thermal imaging image set, and performing circuit board area division on the circuit board solder point mark thermal imaging image set to obtain a circuit board solder point mark area division image set; Step S363: performing regional density evaluation on the circuit board solder joint mark region division image set, thereby obtaining circuit board image region density data; Step S364: dividing the circuit board solder joint mark image set into solder joint dense area images according to the circuit board image area density data, thereby obtaining a solder joint dense area image set.
7. A printed circuit board defect detection system based on image recognition, characterized in that: Used to execute the printed circuit board defect detection method based on image recognition as claimed in claim 1, the printed circuit board defect detection system based on image recognition comprises: The image enhancement module is used to obtain a printed circuit board image set, and perform image background removal on the printed circuit board image set to obtain a printed circuit board foreground image set; and perform image contrast enhancement on the printed circuit board foreground image set to obtain a printed circuit board enhanced image set; A circuit board material identification module is used to obtain circuit board image shooting environment data, and perform environmental reflection compensation on the printed circuit board enhanced image set according to the circuit board image shooting environment data, thereby obtaining an environmental compensation image set; and perform circuit board material area identification on the environmental compensation image set, thereby obtaining a circuit board material area image set; The solder overflow detection module is used to identify the solder joints of the circuit board according to the circuit board material area image set, thereby obtaining the circuit board solder joint mark image set, divide the circuit board solder joint mark image set into solder joint dense area images, thereby obtaining the solder joint dense area image set; perform solder overflow detection according to the solder joint dense area image set, thereby obtaining the solder overflow area image set; A heat dissipation defect detection module is used to perform heat dissipation defect detection on the circuit board material compensation image set according to the solder overflow area image set, thereby obtaining a heat dissipation defect image set, and to perform heat dissipation defect feature integration on the heat dissipation defect image set, thereby obtaining heat dissipation defect feature data; The defect detection model building module is used to build a circuit board heat dissipation defect detection model based on heat dissipation defect feature data and solder overflow area image set.
Citation Information
Patent Citations
PCBA appearance defect intelligent detection method
CN117664990A
Printed wiring board inspection, work logging and information system
US4454585A