Self-adaptive imaging method and system suitable for circuit board defect detection
By using an adaptive imaging method and neural networks to optimize the imaging conditions and parameters of the circuit board, the problem of decreased imaging quality caused by differences in manufacturing processes is solved, the efficiency and accuracy of circuit board defect detection are improved, and the reliance on human experience is reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-03-24
AI Technical Summary
In traditional circuit board defect detection, differences in manufacturing processes, component layout, or changes in the production environment can lead to a decline in image quality, affecting detection efficiency and accuracy. Furthermore, it relies on human experience and image post-processing.
An adaptive imaging method is adopted to generate a total difference vector by acquiring the current image of the circuit board, and to generate optical and acquisition correction vectors using a trained neural network model to optimize imaging conditions and parameters.
It significantly improves the efficiency and accuracy of defect detection, reduces reliance on human experience, decreases the need for image post-processing, and enhances the robustness and reliability of the detection system.
Smart Images

Figure CN121724975A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of circuit board defect detection, and in particular to an adaptive imaging method and system suitable for circuit board defect detection. Background Technology
[0002] Circuit board defect detection begins with image acquisition, and image quality and acquisition conditions are crucial to the detection effect. Newly manufactured or new batches of circuit boards may exhibit variations in ink color or shade due to differences in manufacturing processes, component layout, and production environment. Using the same optical conditions for image acquisition can easily result in unclear defect detection targets, requiring further post-processing such as gain compensation, which severely impacts defect detection efficiency. Alternatively, relying on manual experience to adjust optical parameters has relatively low accuracy and often requires repeated adjustments. Summary of the Invention
[0003] To achieve more accurate and faster circuit board defect detection, this application provides an adaptive imaging method and system suitable for circuit board defect detection.
[0004] Firstly, this application provides an adaptive imaging method suitable for circuit board defect detection, employing the following technical solution: Acquire the current image of the circuit board under the current optical conditions and acquisition parameters; Based on the preset target image imaging requirements, a current total difference vector is generated according to the currently acquired image; Based on the current total difference vector, the current optical conditions, and the current acquisition parameters, a trained neural network model is used to generate an optical correction vector and an acquisition correction vector, so as to reacquire the next acquisition image of the circuit board under the corrected optical conditions and according to the corrected acquisition parameters.
[0005] Through the above technical solution, this method effectively solves the problem of declining imaging quality caused by differences in manufacturing processes, component layout, or changes in the production environment in traditional circuit board defect detection by introducing an adaptive imaging mechanism. It significantly improves the efficiency and accuracy of defect detection, reduces reliance on human experience, and reduces the need for image post-processing. At the same time, by changing the imaging optical conditions and acquisition parameters of the same batch of circuit boards, the efficiency of circuit board defect detection is improved.
[0006] In one specific implementation, the target image imaging requirement includes the target imaging object and the target imaging standard of the target imaging object; The target imaging object is adapted to the target material, the target imaging object includes the detection material, and the target imaging standard is the standard pixel value of the target material.
[0007] The above technical solution clarifies the specific requirements for the preset target image imaging, providing a precise quantitative basis for the adaptive imaging method to generate the total difference vector. This effectively solves the problem of inaccurate difference vectors caused by the ambiguous definition of the target image imaging requirements, thus ensuring that the neural network model can generate more targeted and effective optical correction vectors and acquisition correction vectors. Ultimately, this solution enables the system to continuously acquire circuit board images that meet the imaging quality requirements of specific detection materials, significantly improving the accuracy and reliability of circuit board defect detection.
[0008] In one specific implementation, prior to generating the current total difference vector, the method further includes: Determine whether the currently acquired image contains all of the target imaging objects; If not all of the target imaging objects are included, then based on the missing target imaging objects, another currently acquired image is acquired at the target location under the current optical conditions and the current acquisition parameters.
[0009] Through the above technical solution, this application ensures that the currently acquired image is complete and comprehensive, containing all target imaging objects to be detected, before adaptive imaging parameter correction. This significantly improves the accuracy and representativeness of the current total difference vector, thereby enabling the neural network model to generate more accurate and effective correction parameters. This helps achieve higher precision and more comprehensive coverage in circuit board defect detection, avoiding missed detections or improper corrections due to incomplete initial image information, thus improving the robustness and reliability of the entire detection system.
[0010] In a specific implementation scheme, generating the current total difference vector based on the currently acquired image, according to the preset target image imaging requirements, includes: For each target material, extract the current pixel value from the currently acquired image and obtain the corresponding current sub-difference vector: The current total difference vector is obtained by fusing all the current sub-difference vectors.
[0011] Through the above technical solution, this application can perform refined evaluation of the imaging quality of different materials on a circuit board, avoiding the errors that may arise from a general evaluation of the entire image. By generating independent sub-difference vectors for each target material and fusing them into a total difference vector, the system can provide the neural network model with more comprehensive and targeted imaging quality deviation information. This enables the neural network model to generate more accurate optical and acquisition parameter correction schemes, thereby effectively optimizing the imaging quality of all key materials on the circuit board and significantly improving the accuracy and reliability of defect detection.
[0012] In one specific implementation, before fusing all the current sub-difference vectors to obtain the current total difference vector, the following is included: Determine whether each current sub-difference vector is within the corresponding preset error allowable range; If all the current sub-difference vectors are within the corresponding preset error allowable range, then the current optical conditions and current acquisition parameters are determined to be the target optical conditions and target acquisition parameters, and the sub-vectors are no longer fused. Conversely, if they do not merge, they continue to merge.
[0013] By employing the aforementioned technical solution, this application avoids unnecessary sub-vector fusion and parameter correction when the imaging quality already meets the requirements, thereby significantly improving the efficiency of the adaptive imaging method. This conditional correction mechanism reduces the consumption of computational resources, shortens the time required to achieve optimal imaging results, and reduces the risk of introducing new problems due to over-correction, making the circuit board defect detection process more efficient and stable. In one specific implementation, after the next acquired image of the circuit board is reacquired, the following is included: For each target material, the verification pixel value in the next acquired image is extracted, and the corresponding verification sub-difference vector is obtained; Determine whether each of the verification sub-difference vectors is within the corresponding preset error allowable range; If all the verification sub-difference vectors are within the corresponding preset error allowable range, then the corrected optical conditions and the corrected acquisition parameters are determined as the target optical conditions and the target acquisition parameters. Conversely, all the verification sub-difference vectors are fused to obtain the next total difference vector. Based on the next total difference vector, the corrected optical conditions, and the corrected acquisition parameters, the trained neural network model is used to further correct the optical conditions and the acquisition parameters.
[0014] Through the above technical solution, this application introduces crucial verification and iterative correction steps after initial modification, effectively solving the problem that a single correction may not fully meet the target imaging requirements. By performing detailed verification on the next acquired image and determining whether further correction is needed based on the verification results, this method can ensure that the finally determined optical conditions and acquisition parameters truly enable the circuit board's imaging quality to meet the preset standards. This significantly improves the accuracy and reliability of defect detection, reduces missed or false detections caused by poor imaging quality, and thus enhances the performance and efficiency of the entire detection system.
[0015] In one specific implementation, fusing all the current sub-difference vectors to obtain the current total difference vector includes: The weight numerator of each target material is calculated based on the material importance and difference intensity of the target material, and the normalized denominator is calculated based on several weight numerators. The normalized weight of each target material is calculated based on several of the weighted numerators and the normalized denominator. The current total difference vector is obtained by fusing the sub-difference vectors according to several normalized weights, and its calculation formula is as follows:
[0016] Where D is the total difference vector, and n is the number of material types. The preset importance weight for the i-th material. Let the difference of the i-th material be represented. Difference vector amplitude / intensity This refers to the temperature parameter.
[0017] Through the above technical solution, this application can fully consider the actual importance of different target materials in circuit board defect detection and the severity of their current imaging deviations when generating the current total difference vector. This weighted fusion mechanism based on material importance and difference intensity enables the generated current total difference vector to more accurately and specifically reflect the overall imaging quality problems of the circuit board, especially highlighting key areas or serious deviations that have a significant impact on the detection results. Therefore, when this total difference vector is used as input to the trained neural network model, the model can more effectively identify and correct optical conditions and acquisition parameters that lead to poor imaging quality, avoiding excessive focus on minor or slight deviations, thereby significantly improving the correction efficiency of the adaptive imaging method and the accuracy of the final imaging, ensuring the reliability of circuit board defect detection.
[0018] Secondly, this application provides an adaptive imaging system suitable for circuit board defect detection, employing the following technical solution: The system includes: The image acquisition module is used to acquire the current image of the circuit board under the current optical conditions and acquisition parameters; The difference vector generation module is used to generate the current total difference vector based on the currently acquired image, according to the preset target image imaging requirements. The imaging condition correction module is used to generate an optical correction vector and an acquisition correction vector based on the current total difference vector, the current optical conditions, and the current acquisition parameters, using a trained neural network model, so as to re-acquire the next image of the circuit board under the corrected optical conditions and according to the corrected acquisition parameters.
[0019] Thirdly, this application provides a computer device that adopts the following technical solution: it includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described above, an adaptive imaging method suitable for circuit board defect detection.
[0020] Fourthly, this application provides a computer-readable storage medium, which employs the following technical solution: storing a computer program that can be loaded by a processor and executed as described above for an adaptive imaging method suitable for circuit board defect detection.
[0021] In summary, this application has the following beneficial technical effects: This method effectively solves the problem of declining imaging quality caused by differences in manufacturing processes, component layout, or changes in the production environment in traditional circuit board defect detection by introducing an adaptive imaging mechanism. It significantly improves the efficiency and accuracy of defect detection, reduces reliance on human experience, and reduces the need for image post-processing. At the same time, by changing the imaging optical conditions and acquisition parameters of the same batch of circuit boards, the efficiency of circuit board defect detection is improved. Attached Figure Description
[0022] Figure 1 This is a flowchart of an adaptive imaging method suitable for circuit board defect detection in an embodiment of this application.
[0023] Figure 2 This is a schematic diagram illustrating the target image imaging requirements.
[0024] Figure 3 This is a schematic diagram of circuit board image acquisition.
[0025] Figure 4 This is a structural block diagram of an adaptive imaging method suitable for circuit board defect detection in an embodiment of this application.
[0026] Figure reference numerals: 401, image acquisition module; 402, difference vector generation module; 403, imaging condition correction module. Detailed Implementation
[0027] The following is in conjunction with the appendix Figures 1-4 This application will be described in further detail.
[0028] This application discloses an adaptive imaging method suitable for circuit board defect detection, which is used to improve the accuracy and efficiency of circuit board defect detection through adaptive imaging.
[0029] In circuit board defect inspection, the imaging quality of the image acquisition stage is highly dependent on the compatibility of optical conditions and acquisition parameters. When dealing with newly produced or new batches of circuit boards, differences in manufacturing processes, component layouts, and production environments may lead to variations in ink color or inconsistencies in ink density on the circuit board surface. If the established optical conditions are used for image acquisition, the defect detection target will not be clearly displayed, requiring image post-processing techniques for gain compensation or repeated manual adjustments of optical parameters based on experience. This process not only prolongs the inspection cycle but also reduces the automation and reliability of the inspection process. The introduction of image post-processing increases computational resource consumption, while manual adjustments result in insufficient stability of parameter settings due to subjective experience.
[0030] For example, in a batch inspection scenario for a certain type of multilayer printed circuit board, the surface reflectivity of new batches of boards varies due to the use of inks from different suppliers. In images acquired under standard white light illumination, the pad areas appear overexposed, while the circuit details lack contrast. Operators must manually adjust the light source intensity, angle, and camera exposure time, requiring multiple iterations to obtain acceptable image quality. This stagnation in image acquisition directly impacts the accuracy of subsequent defect identification and the overall production line efficiency. Furthermore, image quality issues caused by mismatched optical parameters require additional gain compensation processing, further increasing system response latency.
[0031] If the aforementioned issues are not addressed, the adaptability of circuit board defect detection systems will be limited, requiring manual intervention for parameter calibration each time a circuit board undergoes a process change. This process not only weakens the real-time response capability of the detection system but may also introduce additional detection errors due to improper parameter settings. Furthermore, the repetitive nature of manual adjustments increases the frequency of detection process interruptions. In the long run, these problems will hinder the widespread application of automated inspection technology in diverse production environments, affecting the consistency of product quality control.
[0032] Therefore, this application proposes an adaptive imaging method suitable for circuit board defect detection, which improves the accuracy and efficiency of circuit board defect detection through adaptive imaging.
[0033] like Figure 1 As shown, the method includes: S10: Acquire the current image of the circuit board under the current optical conditions and current acquisition parameters.
[0034] Specifically, optical conditions refer to various environmental factors and equipment settings that affect light illumination and reflection during image acquisition, such as the type, intensity, angle, color temperature, and illumination method of the light source. Acquisition parameters refer to various settings that control the working state of the imaging device (such as a camera) during image acquisition, such as exposure time, aperture size, gain, white balance, and focal length. Operators can manually set the current optical conditions, such as light source intensity, and the current acquisition parameters, such as camera exposure time, based on experience, and then trigger the image acquisition device to take a picture, obtaining the currently acquired image, while simultaneously recording the current optical conditions and current acquisition parameters.
[0035] In one embodiment, a new batch of circuit boards on a circuit board production line needs to undergo defect inspection. The ink color of this batch of circuit boards differs from previous batches, for example, the ink color is darker. An initial image is acquired for the new batch of circuit boards, resulting in a currently acquired image. Due to the darker ink color, some key detection areas (such as pads and lines) in this currently acquired image may appear unclear, lack contrast, or have distorted colors, making it difficult to meet the requirements of subsequent defect detection algorithms.
[0036] S20: Based on the preset target image imaging requirements, generate the current total difference vector according to the currently acquired image.
[0037] Specifically, image imaging requirements refer to the desired imaging quality, content, or standards for the final acquired image. Examples include the sharpness, color accuracy, contrast, or identifiability of specific materials (e.g., gold, copper surfaces) / regions (e.g., PCB components) under different RGB channels. The process involves directly comparing the pixel values of specific materials / regions in the currently acquired image with preset target pixel values, such as calculating the difference in average brightness or color channels, and using this as a difference sub-vector. These difference sub-vectors for materials / regions are then combined to form the current total difference vector.
[0038] S30, based on the current total difference vector, current optical conditions and current acquisition parameters, uses a trained neural network model to generate optical correction vector and acquisition correction vector, so as to reacquire the next acquisition image of the circuit board under the corrected optical conditions and according to the corrected acquisition parameters.
[0039] Specifically, the total difference vector, current optical conditions, and current acquisition parameters are input into a neural network model. The model can be trained to look up the corresponding optical and acquisition correction vectors in a predefined lookup table based on the input values; alternatively, it can be trained to perform a multivariate linear regression, mapping the input parameters to the output correction vectors; or it can employ a feedforward neural network with a few hidden layers and neurons to perform a non-linear transformation on the input data to generate correction vectors. After generating the correction vectors, the system applies these corrections to the current optical conditions and acquisition parameters, forming the corrected conditions and parameters. Subsequently, the imaging device re-acquires images under these new conditions to obtain the next acquired image.
[0040] This method effectively solves the problem of declining imaging quality caused by differences in manufacturing processes, component layout, or changes in the production environment in traditional circuit board defect detection by introducing an adaptive imaging mechanism. It significantly improves the efficiency and accuracy of defect detection, reduces reliance on human experience, and reduces the need for image post-processing. At the same time, by changing the imaging optical conditions and acquisition parameters of the same batch of circuit boards, the efficiency of circuit board defect detection is improved.
[0041] In one embodiment, to enable more accurate and rapid circuit board defect detection, the target image imaging requirement includes a target imaging object and a target imaging standard for the target imaging object; wherein, the target imaging object is adapted to the target material, the target imaging object includes the detection material, and the target imaging standard is the standard pixel value of the target material.
[0042] Specifically, image imaging requirements refer to the desired imaging quality, content, or standards for the final acquired image, such as the clarity, color accuracy, contrast, or identifiability of specific materials (e.g., gold surfaces, copper surfaces, etc.) / areas (e.g., PCB components) under different RGB channels.
[0043] Image imaging requirements include the target imaging object and the target imaging standard of the target imaging object.
[0044] The target imaging object refers to a specific part or feature on a circuit board that needs to be precisely imaged and inspected; it is the focus of defect detection. For example, it could be a material that has good imaging performance under RGB channels (such as copper, tin, solder resist, or substrate material on the circuit board), or it could be a key structure on the circuit board such as pads, wires, or component leads.
[0045] like Figure 2 The diagram illustrates the target image imaging requirements. In one embodiment, as shown... Figure 2 The circuit board shown on the left is made of gold, copper, and ink, such as... Figure 2The right side shows the imaging diagrams of the circuit board materials in the RGB three channels. The key materials detected in the RGB three channels are the gold surface, the copper surface, and the ink, respectively. Therefore, the target imaging objects are the gold surface, the copper surface, and the ink.
[0046] Target imaging standards are quantitative indicators that measure whether a target object achieves the expected imaging quality. They provide an objective basis for image quality assessment and can be expressed as numerical indicators such as a specific range of pixel values. Imaging standards can be specifically expressed as pixel values, that is, the expected pixel values or range of pixel values that the target material should present in the image under ideal imaging conditions. These can be obtained in advance through calibration experiments or reference images, representing the average pixel value or RGB value of a defect-free target material, or calculated based on the material's optical properties and the imaging system's response curve. Under ideal imaging conditions, the pixel values of a copper surface should fall within a specific range, such as 200 to 240 (within the 0-255 pixel range); this is the standard pixel value for the target material.
[0047] The proposed solution clearly defines the specific requirements for the pre-defined target image imaging, providing a precise quantitative basis for the adaptive imaging method in generating the total difference vector. This effectively solves the problem of inaccurate difference vectors caused by the ambiguous definition of the target image imaging requirements, thereby ensuring that the neural network model can generate more targeted and effective optical correction vectors and acquisition correction vectors. Ultimately, this solution enables the system to continuously acquire circuit board images that meet the imaging quality requirements of specific detection materials, significantly improving the accuracy and reliability of circuit board defect detection.
[0048] In one embodiment, to make circuit board defect detection more accurate and faster, the following steps can be performed before generating the current total difference vector: Determine whether the currently acquired image contains all target imaging objects; Specifically, when the target imaging object is a certain area on a circuit board, image processing techniques, such as template matching or feature point detection algorithms, can be used to compare the currently acquired image with a pre-stored circuit board layout diagram or a reference image of the target imaging object to identify and locate each target imaging object in the image. When the target imaging object is a material on the circuit board, the approximate area of each detection material on the circuit board can be preset, and then these areas in the currently acquired image can be analyzed. For example, by calculating the pixel statistical features (such as average brightness, contrast, and texture features) within the area or running a lightweight target detection model, it can be determined whether the currently acquired image contains the required detection material.
[0049] If not all target imaging objects are included, then based on the missing target imaging objects, another currently acquired image is acquired at the target location under the current optical conditions and current acquisition parameters.
[0050] Specifically, the system can determine the precise or approximate location of the missing target objects on the circuit board based on preset circuit board layout information or previously identified missing information. The imaging system (e.g., by controlling a motion platform or adjusting the camera's field of view) is guided to these target locations and, under the current imaging parameters (i.e., current optical conditions and current acquisition parameters), acquires one or more additional images specifically covering the previously missing target objects. These supplementary acquired images can be stitched, fused, or logically combined with the original currently acquired images to form a complete image dataset containing all target objects, which can then be used for subsequent differential vector generation.
[0051] like Figure 3 The image shown is a schematic diagram of circuit board image acquisition. Figure 3 The circuit board shown is made of gold, copper, and ink. The target imaging object of this circuit board is the gold and copper surfaces. The area enclosed by the dashed line is the camera's acquisition range, such as... Figure 3 The image shows that only the gold surface was captured, while the copper surface was missed. Therefore, the camera's capture range needs to be adjusted to capture the missing copper surface.
[0052] This application ensures that the currently acquired image is complete and comprehensive, containing all target objects to be detected, before adaptive imaging parameter correction. This significantly improves the accuracy and representativeness of the current total difference vector, enabling the neural network model to generate more accurate and effective correction parameters. This contributes to achieving higher precision and more comprehensive coverage in circuit board defect detection, avoiding missed detections or improper corrections due to incomplete initial image information, thereby improving the robustness and reliability of the entire detection system.
[0053] In one embodiment, to achieve more accurate and faster circuit board defect detection, the step of generating the current total difference vector based on the currently acquired image, according to the preset target image imaging requirements, can be specifically performed as follows: For each target material, extract the current pixel value from the currently acquired image and obtain the corresponding current sub-difference vector: fuse all current sub-difference vectors to obtain the current total difference vector.
[0054] Specifically, for each target material on the circuit board, the system accurately extracts the current pixel value of that material region from the currently acquired image. These extracted pixel values are then compared with the preset target imaging standard for that material to generate a current sub-difference vector specifically for that material. Subsequently, all these independent current sub-difference vectors are effectively fused to form a comprehensive current total difference vector.
[0055] For example, a circuit board contains two target materials that need to be accurately detected: material A and material B. The preset target image imaging requirements specify that the ideal average pixel value for material A is 200, and the ideal average pixel value for material B is 100. After acquiring the current image, the system first processes the image to identify all material A and material B regions. For material A, the system calculates its average pixel value to be 180. Therefore, the current sub-difference vector for material A is [180 - 200] = [-20]. For material B, the system calculates its average pixel value to be 120. Therefore, the current sub-difference vector for material B is [120 - 100] =
[20] . Subsequently, these two current sub-difference vectors [-20] and
[20] are merged, for example, by simple concatenation, to form the current total difference vector [-20, 20]. This total difference vector is then fed into the trained neural network model, guiding the model to generate targeted optical correction vectors and acquisition correction vectors, so that in the next acquisition, the pixel value of material A is closer to 200 and the pixel value of material B is closer to 100.
[0056] This application enables a refined evaluation of the imaging quality of different materials on a circuit board, avoiding errors that may arise from a general evaluation of the entire image. By generating independent sub-difference vectors for each target material and fusing them into a total difference vector, the system can provide the neural network model with more comprehensive and targeted imaging quality deviation information. This allows the neural network model to generate more accurate optical and acquisition parameter correction schemes, thereby effectively optimizing the imaging quality of all key materials on the circuit board and significantly improving the accuracy and reliability of defect detection.
[0057] In one embodiment, to make circuit board defect detection more accurate and faster, the following steps can be performed before fusing all current sub-difference vectors to obtain the current total difference vector: Determine whether each current sub-difference vector is within the corresponding preset error allowable range; if all current sub-difference vectors are within the corresponding preset error allowable range, then determine the current optical conditions and current acquisition parameters as the target optical conditions and target acquisition parameters, and no longer fuse sub-vectors; otherwise, continue fusing.
[0058] Specifically, the current sub-difference vector represents the deviation between the actual pixel value of a specific material and the target standard pixel value. The allowable error range defines the maximum acceptable limit of this deviation. This determination can be achieved in several ways, for example, by calculating the magnitude of each current sub-difference vector and comparing it with a preset threshold; If the sub-difference vectors of all materials fall within their respective preset error allowable ranges, this indicates that the current imaging conditions are sufficient to meet the imaging requirements of all target materials. In this case, the system will immediately confirm the current optical conditions and acquisition parameters as the final target optical conditions and target acquisition parameters, and stop the subsequent sub-vector fusion and parameter correction process based on the neural network model. If one or more sub-difference vectors exceed their corresponding error tolerance range, the system will determine that there is still room for improvement in the current imaging quality and continue to perform the sub-difference vector fusion step to generate a comprehensive current total difference vector. This total vector will be used as input to the neural network model to guide the generation of optical correction vectors and acquisition correction vectors, so that the next acquisition image of the circuit board can be acquired under the corrected optical conditions and based on the corrected acquisition parameters.
[0059] This application significantly improves the efficiency of adaptive imaging methods by determining whether the current imaging quality meets the requirements, thereby avoiding unnecessary sub-vector fusion and parameter correction when the imaging quality has already met the standards. This conditional correction mechanism reduces the consumption of computational resources, shortens the time required to achieve the best imaging effect, and reduces the risk of introducing new problems due to over-correction, making the circuit board defect detection process more efficient and stable.
[0060] In one embodiment, to make circuit board defect detection more accurate and faster, after the step of acquiring the next image of the circuit board, the following can be specifically performed: For each target material, the verification pixel value is extracted from the next acquired image, and the corresponding verification sub-difference vector is obtained. It is determined whether each verification sub-difference vector is within the corresponding preset error allowable range. If all verification sub-difference vectors are within the corresponding preset error allowable range, the corrected optical conditions and corrected acquisition parameters are determined as the target optical conditions and target acquisition parameters. Otherwise, all verification sub-difference vectors are fused to obtain the next total difference vector. Based on the next total difference vector, the corrected optical conditions, and the corrected acquisition parameters, the trained neural network model is used to continue to correct the optical conditions and acquisition parameters.
[0061] Specifically, after acquiring the next captured image after initial correction, the system extracts the pixel values corresponding to each preset target material in the image. These extracted pixel values are called verification pixel values, and they reflect the actual imaging of the material under the current correction conditions. Subsequently, these verification pixel values are compared with the target imaging standard (e.g., target pixel values) corresponding to the target material, and the difference between the two is calculated to form a verification sub-difference vector; After obtaining the verification sub-difference vector for each target material, the system compares it with a pre-defined error tolerance range. This error tolerance range defines an acceptable deviation threshold for image quality. For example, it can be set such that the magnitude of the verification sub-difference vector or a component thereof must be less than a preset value or within a certain percentage range. If a verification sub-difference vector exceeds this range, it indicates that the image quality of that material has not yet met the requirements. The error tolerance range can be set based on empirical values, industry standards, or optimized through experimental data to ensure that over-correction is avoided while meeting detection requirements. When the system detects that the verification sub-difference vectors of all target materials are within their respective preset error allowable ranges, this indicates that the corrected optical conditions and acquisition parameters have successfully enabled the circuit board to achieve the expected target imaging quality. In this case, the current corrected optical conditions and corrected acquisition parameters are confirmed as the final target optical conditions and target acquisition parameters, and the imaging process can be stopped, or these parameters can be saved for subsequent batch inspections. If any one or more verification sub-difference vectors exceed their corresponding error tolerance range, it indicates that the current imaging quality does not fully meet the requirements. In this case, the system will fuse the verification sub-difference vectors of all target materials to generate a comprehensive next total difference vector.
[0062] The next difference vector, along with the currently corrected optical conditions and acquisition parameters, is fed as input to a pre-trained neural network model. Based on these inputs, the neural network model recalculates and outputs new optical and acquisition correction vectors. These new correction vectors are used to further adjust the optical conditions and acquisition parameters to more closely approximate the target imaging requirements in the next imaging iteration. This process forms a closed-loop iterative correction mechanism, enabling the system to progressively optimize imaging parameters until the ideal imaging effect is achieved.
[0063] This application introduces crucial verification and iterative correction steps after initial revisions, effectively addressing the issue that a single correction may not fully meet the target imaging requirements. By meticulously verifying the next acquired image and determining whether further corrections are necessary based on the verification results, this method ensures that the final determined optical conditions and acquisition parameters truly achieve the preset standard for the imaging quality of the circuit board. This significantly improves the accuracy and reliability of defect detection, reduces missed or false detections due to poor imaging quality, and thus enhances the performance and efficiency of the entire detection system.
[0064] In one embodiment, to achieve more accurate and faster circuit board defect detection, the step of fusing all current sub-difference vectors to obtain the current total difference vector can be specifically performed as follows: The weight numerator of each target material is calculated based on its material importance and difference intensity. A normalized denominator is then calculated based on several weight numerators. The normalized weight of each target material is calculated based on several weight numerators and the normalized denominator. The current total difference vector is obtained by fusing the sub-difference vectors based on several normalized weights.
[0065] Specifically, material importance can be pre-set based on the priority of different areas or components on the circuit board in terms of functionality, reliability, or difficulty of defect detection. For example, the material importance of critical component areas is higher than that of non-critical areas. The difference intensity reflects the degree of deviation between a specific material in the currently acquired image and the target imaging standard, which can usually be obtained by calculating the magnitude or norm of the current sub-difference vector.
[0066] First, the weight numerator of each target material is calculated based on its material importance and difference strength. The calculation formula is as follows:
[0067] in, For the weight numerator of the i-th material, The preset material weights (indicating the importance of the material). This represents the magnitude of the current difference after exponential amplification (indicating the intensity of the difference). Then, the normalized denominator is calculated based on the numerator with several weights, and the calculation formula is as follows:
[0068] Where Z is the normalized denominator, For the weight numerator of the i-th material, The preset material weights (indicating the importance of the material). This represents the magnitude of the current difference after exponential amplification (indicating the intensity of the difference); Finally, the current total difference vector is obtained by fusing the sub-difference vectors with several normalized weights, and its calculation formula is as follows:
[0069] In summary, the formula for calculating the total difference vector can be expressed as:
[0070] Where D is the total difference vector, and n is the number of material types. The preset importance weight for the i-th material. Let the difference of the i-th material be represented. Difference vector amplitude / intensity This refers to the temperature parameter.
[0071] Regarding parameters The impact is explained as follows: when At that time, the weight distribution characteristics are as follows: The weights are entirely determined by The decision applies to scenarios where only preset coefficients are trusted, ignoring actual differences. when When the weight distribution is small, the difference intensity has a certain influence, but it will not dominate. The applicable scenario is to balance the preset coefficient and the actual difference. when When the weight distribution is large, the weight distribution is dominated by the intensity of the difference, amplifying the weight of significant differences. It is suitable for highlighting areas of significant change. when When the weight distribution is reduced to selecting only the material with the greatest difference, it is applicable to extreme cases and only focuses on the most significant difference.
[0072] This application, when generating the current total difference vector, fully considers the actual importance of different target materials in circuit board defect detection and the severity of their current imaging deviations. This weighted fusion mechanism based on material importance and difference intensity enables the generated current total difference vector to more accurately and specifically reflect the overall imaging quality problems of the circuit board, especially highlighting key areas or severe deviations that have a significant impact on the detection results. Therefore, when this total difference vector is used as input to the trained neural network model, the model can more effectively identify and correct optical conditions and acquisition parameters that lead to poor imaging quality, avoiding excessive focus on minor or slight deviations. This significantly improves the correction efficiency of the adaptive imaging method and the accuracy of the final imaging, ensuring the reliability of circuit board defect detection.
[0073] Based on the above method, embodiments of this application also disclose an adaptive imaging system suitable for circuit board defect detection. For example... Figure 4 The system includes the following modules: Image acquisition module 401 is used to acquire the current image of the circuit board under the current optical conditions and current acquisition parameters; The difference vector generation module 402 is used to generate the current total difference vector based on the currently acquired image and the preset target image imaging requirements. The imaging condition correction module 403 is used to generate an optical correction vector and an acquisition correction vector based on the current total difference vector, the current optical conditions and the current acquisition parameters, using a trained neural network model, so as to re-acquire the next image of the circuit board under the corrected optical conditions and according to the corrected acquisition parameters.
[0074] In one embodiment, the difference vector generation module 402 is specifically used for target image imaging requirements including target imaging object and target imaging standard of target imaging object; wherein, target imaging object is adapted to target material, target imaging object includes detection material, and target imaging standard is standard pixel value of target material.
[0075] In one embodiment, the difference vector generation module 402 is specifically used to determine whether the currently acquired image contains all the target imaging objects; if it does not contain all the target imaging objects, it supplements the target location with another currently acquired image under the current optical conditions and current acquisition parameters based on the missing target imaging objects.
[0076] In one embodiment, the difference vector generation module 402 is specifically used to extract the current pixel value in the currently acquired image for each target material and obtain the corresponding current sub-difference vector; and to fuse all the current sub-difference vectors to obtain the current total difference vector.
[0077] In one embodiment, the difference vector generation module 202 is specifically used to determine whether each current sub-difference vector is within the corresponding preset error allowable range; if all current sub-difference vectors are within the corresponding preset error allowable range, then the current optical conditions and current acquisition parameters are determined as the target optical conditions and target acquisition parameters, and the sub-vectors are no longer fused; otherwise, fusion continues.
[0078] In one embodiment, the imaging condition correction module 403 is specifically used to extract the verification pixel value in the next acquired image for each target material and obtain the corresponding verification sub-difference vector. Determine whether each verification sub-difference vector is within the corresponding preset error allowable range; if all verification sub-difference vectors are within the corresponding preset error allowable range, then determine the corrected optical conditions and corrected acquisition parameters as the target optical conditions and target acquisition parameters; otherwise, fuse all verification sub-difference vectors to obtain the next total difference vector, and based on the next total difference vector, the corrected optical conditions, and the corrected acquisition parameters, use the trained neural network model to continue to correct the optical conditions and acquisition parameters.
[0079] In one embodiment, the imaging condition correction module 403 is specifically used to calculate the weight numerator of each target material based on the material importance and difference intensity of the target material; calculate a normalized denominator based on several weight numerators; calculate a normalized weight for each target material based on several weight numerators and the normalized denominator; and fuse the sub-difference vectors based on several normalized weights to obtain the current total difference vector, the calculation formula of which is:
[0080] Where D is the total difference vector, and n is the number of material types. The preset importance weight for the i-th material. Let the difference of the i-th material be represented. Difference vector amplitude / intensity This refers to the temperature parameter.
[0081] This application also discloses a computer device.
[0082] Specifically, the computer device includes a memory and a processor, the memory storing a computer program that can be loaded by the processor and executed as described above for an adaptive imaging method suitable for circuit board defect detection.
[0083] This application also discloses a computer-readable storage medium.
[0084] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and executed as described above in an adaptive imaging method suitable for circuit board defect detection. The computer-readable storage medium includes, for example, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0085] This specific embodiment is merely an explanation of the present invention and is not intended to limit the invention. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of the claims of the present invention.
Claims
1. An adaptive imaging method suitable for circuit board defect detection, characterized in that, The method includes: Acquire the current image of the circuit board under the current optical conditions and acquisition parameters; Based on the preset target image imaging requirements, a current total difference vector is generated according to the currently acquired image; Based on the current total difference vector, the current optical conditions, and the current acquisition parameters, a trained neural network model is used to generate an optical correction vector and an acquisition correction vector, so as to reacquire the next acquisition image of the circuit board under the corrected optical conditions and according to the corrected acquisition parameters.
2. The method according to claim 1, characterized in that, The target image imaging requirements include the target imaging object and the target imaging standard of the target imaging object; The target imaging object is adapted to the target material, the target imaging object includes the detection material, and the target imaging standard is the standard pixel value of the target material.
3. The method according to claim 2, characterized in that, Before generating the current total difference vector, the following is also included: Determine whether the currently acquired image contains all of the target imaging objects; If not all of the target imaging objects are included, then based on the missing target imaging objects, another currently acquired image is acquired at the target location under the current optical conditions and the current acquisition parameters.
4. The method according to claim 3, characterized in that, The process of generating the current total difference vector based on the currently acquired image, according to the preset target image imaging requirements, includes: For each target material, extract the current pixel value from the currently acquired image and obtain the corresponding current sub-difference vector: The current sub-difference vectors are merged to obtain the current total difference vector.
5. The method according to claim 4, characterized in that, Before fusing all the current sub-difference vectors to obtain the current total difference vector, the process includes: Determine whether each current sub-difference vector is within the corresponding preset error allowable range; If all the current sub-difference vectors are within the corresponding preset error allowable range, then the current optical conditions and current acquisition parameters are determined to be the target optical conditions and target acquisition parameters, and the sub-vectors are no longer fused. Conversely, if they do not merge, they continue to merge.
6. The method according to claim 5, characterized in that, After the next acquired image of the circuit board is obtained again, the following is included: For each target material, the verification pixel value in the next acquired image is extracted, and the corresponding verification sub-difference vector is obtained; Determine whether each of the verification sub-difference vectors is within the corresponding preset error allowable range; If all the verification sub-difference vectors are within the corresponding preset error allowable range, then the corrected optical conditions and the corrected acquisition parameters are determined as the target optical conditions and the target acquisition parameters. Conversely, all the verification sub-difference vectors are fused to obtain the next total difference vector. Based on the next total difference vector, the corrected optical conditions, and the corrected acquisition parameters, the trained neural network model is used to further correct the optical conditions and the acquisition parameters.
7. The method according to claim 5, characterized in that, The process of fusing all the current sub-difference vectors to obtain the current total difference vector includes: The weight numerator of each target material is calculated based on the material importance and difference intensity of the target material, and the normalized denominator is calculated based on several weight numerators. The normalized weight of each target material is calculated based on several of the weighted numerators and the normalized denominator. The current total difference vector is obtained by fusing the sub-difference vectors according to several normalized weights, and its calculation formula is as follows: Where D is the total difference vector, and n is the number of material types. The preset importance weight for the i-th material. Let the difference of the i-th material be represented. Difference vector amplitude / intensity This refers to the temperature parameter.
8. An adaptive imaging system suitable for circuit board defect detection, characterized in that, The system includes: Image acquisition module (401) is used to acquire the current image of the circuit board under the current optical conditions and current acquisition parameters; The difference vector generation module (402) is used to generate the current total difference vector based on the currently acquired image and the preset target image imaging requirements. The imaging condition correction module (403) is used to generate an optical correction vector and an acquisition correction vector based on the current total difference vector, the current optical conditions and the current acquisition parameters, using a trained neural network model, so as to re-acquire the next image of the circuit board under the corrected optical conditions and according to the corrected acquisition parameters.
9. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and executed according to any one of claims 1 to 7.