AI image detection method and system of electronic circuit board
By applying AI image detection methods on the circuit board production line and using real-time images and preset models for detection, the problem of inefficiency of traditional detection methods is solved, and automated and real-time defect detection is achieved.
Patent Information
- Application Number
- CN202510496365.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-04-21
AI Technical Summary
Traditional circuit board detection methods are inefficient, prone to errors, difficult to detect minor defects, and cannot adapt to complex and changeable circuit board designs.
Using the AI image detection method, by obtaining the real-time image of the circuit board in each production process, performing preliminary detection and precise detection based on the preset AI image detection model, constructing defect detection vectors, and filtering suitable AI models for detection.
Automatic defect detection of electronic circuit boards is realized, detection efficiency is improved, resource occupation is reduced, and real-time detection is ensured.
Smart Images

Figure CN120031870A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of circuit board production detection, and in particular to an AI image detection method and system for electronic circuit boards. Background Art
[0002] In the electronics manufacturing industry, electronic circuit boards (PCBs) are the basic components of electronic devices, and their quality and integrity are directly related to the performance and reliability of the final product. Traditional circuit board inspection methods mostly rely on manual visual inspection or use simple machine vision technology, which has problems such as low efficiency, prone to errors, difficulty in detecting tiny defects, and inability to adapt to complex and changing circuit board designs.
[0003] With the increase in the integration of circuit boards and the expansion of production scale, traditional inspection methods rely on manual visual inspection, which requires a lot of time and manpower. Especially on high-volume production lines, the inspection speed often becomes a bottleneck, affecting the overall production efficiency. Although simple machine vision systems can automate part of the inspection process, their processing speed and accuracy are limited by algorithms and hardware performance, and it is difficult to meet the requirements of efficient production. In addition, manual inspection is easily affected by factors such as fatigue and lack of concentration, resulting in missed or false detections. Machine vision systems may also make recognition errors when facing complex or similar patterns, especially when the defects differ slightly from normal features. Artificial vision is limited by the resolution of the naked eye, and it is difficult to detect defects such as tiny cracks, short circuits or open circuits. The resolution and sensitivity of traditional machine vision systems may not be sufficient to detect sub-millimeter or smaller defects, which is a major challenge for high-density integrated circuit boards. Summary of the invention
[0004] The present invention provides an AI image detection method and system for an electronic circuit board, which can improve the defect detection efficiency of the electronic circuit board.
[0005] In a first aspect, the present invention provides an AI image detection method for an electronic circuit board, the method comprising: acquiring real-time images of the circuit board to be tested in each production process; performing preliminary detection based on the real-time images of each production process and a preset first AI image detection model to determine whether the real-time image has defects; if the real-time image has defects, extracting real-time images of each production process before the target production process in which the defective real-time image is located; and constructing a defect detection vector based on the real-time images of each production process before the target production process; based on the target production process, screening and obtaining a second AI image detection model; performing precise detection based on the defect detection vector and the second AI image detection model to obtain a defect detection result of the circuit board to be tested.
[0006] In one possible implementation, a preliminary inspection is performed based on real-time images of each production process and a preset first AI image detection model to determine whether the real-time image has defects. It also includes: obtaining production process images of multiple electronic circuit boards in a historical period, and the defect status of each production process image, the defect status including the presence of defects and the absence of defects; generating a first training sample based on the production process images with defects; generating a second training sample based on the production process images without defects; and performing neural network training based on the first training sample and the second training sample to obtain a first AI image detection model.
[0007] In one possible implementation, real-time images of production processes before the target production process in which the real-time image with defects is located are extracted, including: determining the identification of the target circuit board and the target production process in which the real-time image with defects is located; based on the identification of the target circuit board, querying a database to obtain historical image data of the target circuit board; based on the target production process and the sequence of each production process, determining the production process to be extracted; based on the production process to be extracted and the historical image data of the target circuit board, extracting real-time images of the production processes before the target production process.
[0008] In one possible implementation, a defect detection vector is constructed based on real-time images of each production process before the target production process, including: dividing the real-time images of each production process before the target production process into regions based on the correspondence between the real-time images of each production process to obtain multiple images after the divided regions; performing horizontal feature extraction based on the real-time image of each production process to obtain horizontal features; performing vertical feature extraction based on the multiple images after the divided regions to obtain vertical features; and generating a defect detection vector based on the horizontal features and the vertical features.
[0009] In a possible implementation, before the second AI image detection model is screened based on the target production process, it also includes: obtaining production process images and related images of the production process images corresponding to each defect type, as well as the defect type corresponding to each production process image; the related images of the production process images include circuit board images of each production process before the production process where the production process image is located; the defect type includes one or more of the following: welding defects, mechanical damage, poor gold wire, wiring defects and component defects; based on each production process image and the related images of the production process image, horizontal feature extraction is performed to obtain the horizontal features of each circuit board image; based on each production process image and the related images of the production process image, region division and vertical feature extraction are performed to obtain the vertical features of each divided region; based on the horizontal features of each circuit board image and the vertical features of each divided region, a defect detection vector of each production process image is generated; based on the defect type corresponding to each production process image, a defect detection result of each production process image is generated; based on the defect detection vector and the defect detection result of each production process image, a third training sample is generated; based on the production process of each production process image, the third training sample is classified to obtain multiple sub-sample sets; based on the multiple sub-sample sets, neural network training is performed respectively to obtain multiple second AI image detection models.
[0010] In one possible implementation, accurate detection is performed based on the defect detection vector and the second AI image detection model to obtain the defect detection result of the circuit board to be tested, including: inputting the defect detection vector into the second AI image detection model to obtain the probability of each defect type in the target production process; based on the probability of each defect type in the target production process, determining the defect type of the circuit board to be tested.
[0011] In a possible implementation, a defect detection vector is constructed based on real-time images of each production process before the target production process, and the method also includes: dividing the image set based on the real-time images of each production process before the target production process to obtain an image set for each production process; wherein the image set of any production process includes the real-time image of the any production process and the real-time images of each production process before the any production process; based on the image set of each production process, horizontal feature extraction and vertical feature extraction are performed to obtain horizontal features and vertical features of each production process; based on the horizontal features and vertical features of each production process, a defect detection vector for each production process is generated.
[0012] In one possible implementation, accurate detection is performed based on a defect detection vector and a second AI image detection model to obtain a defect detection result of the circuit board to be tested, including: obtaining the probability of each defect type in the target production process based on the defect detection vector of the target production process and the second AI image detection model corresponding to the target production process; obtaining the probability of each defect type in each production process based on the defect detection vector of each production process and the second AI image detection model corresponding to each production process; generating a probability sequence of each defect type based on the probability of each defect type in the target production process and the probability of each defect type in each production process; and determining the defect detection result of the circuit board to be tested based on the probability sequence of each defect type.
[0013] In one possible implementation, after accurate detection is performed based on the defect detection vector and the second AI image detection model to obtain the defect detection result of the circuit board to be tested, it also includes: recording the defect information of each production process within a set period, the defect information includes the defect frequency of each defect type; based on the defect information of each production process, determining the key process and key defect type; the key process is the production process with a defect frequency greater than a first threshold, and the key defect type is the defect type with a defect frequency greater than a second threshold; extracting the product information of the electronic circuit board related to the key process and the key defect type, the product information includes product model, production batch, production date, production line number and production process parameters; based on the key process and key defect type, as well as the product information of the electronic circuit board, generating a defect analysis sequence; based on the defect analysis sequence, determining the cause of the defect and improvement measures.
[0014] In a second aspect, an embodiment of the present invention provides an AI image detection device for an electronic circuit board, the device comprising: a communication module and a processing module, the communication module being used to obtain real-time images of the circuit board to be tested in each production process; the processing module being used to perform preliminary detection based on the real-time images of each production process and a preset first AI image detection model to determine whether the real-time image has defects; if the real-time image has defects, extracting the real-time images of the production processes before the target production process in which the defective real-time image is located; and constructing a defect detection vector based on the real-time images of the production processes before the target production process; based on the target production process, screening and obtaining a second AI image detection model; based on the defect detection vector and the second AI image detection model, performing accurate detection to obtain a defect detection result of the circuit board to be tested.
[0015] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, the memory storing a computer program, the processor being used to call and run the computer program stored in the memory to perform the steps of the method described in the first aspect and any possible implementation method of the first aspect.
[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the steps of the method described in the first aspect and any possible implementation method of the first aspect are implemented.
[0017] The present invention provides an AI image detection method and system for electronic circuit boards. Compared with the traditional artificial visual detection method, the present invention performs preliminary detection and precise detection through real-time images of each production process of the circuit board, realizes automatic defect detection of the electronic circuit board, does not require manual participation, and improves the defect detection efficiency. In addition, the present invention performs preliminary detection and precise detection through the first AI image detection model and the second AI image detection model, which can reduce the resource usage in the defect detection process, ensure the real-time defect detection of the electronic circuit board, and thus improve the defect detection efficiency of the electronic circuit board. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0019] Figure 1 It is a flow chart of an AI image detection method for an electronic circuit board provided by an embodiment of the present invention; Figure 2 It is a structural schematic diagram of an AI image detection device for an electronic circuit board provided by an embodiment of the present invention; Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0021] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0022] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include other steps or modules that are not listed, or may optionally include other steps or modules that are inherent to these processes, methods, products or devices.
[0023] In order to make the purpose, technical solutions and advantages of the present invention more clear, the following will be described through specific embodiments in conjunction with the accompanying drawings of the present invention.
[0024] As described in the background art, the current traditional artificial visual inspection method has the technical problem of low efficiency.
[0025] To solve the above technical problems, Figure 1 As shown, an embodiment of the present invention provides an AI image detection method for an electronic circuit board. The method includes steps S101-S105.
[0026] S101, obtaining real-time images of the circuit board to be tested in each production process.
[0027] For example, the embodiments of the present invention can install high-resolution industrial cameras or visual sensors at each key production process on the production line to ensure that the overall picture and details of the circuit board can be clearly captured. The collected images are transmitted to the central processing unit or cloud server in real time through a wired or wireless network for subsequent processing. The received images are pre-processed by denoising, enhancing contrast, adjusting lighting, etc. to improve the accuracy of subsequent detection algorithms.
[0028] In some embodiments, the production process of the circuit board includes substrate cutting, inner layer circuit production, lamination, drilling, electroplating, outer layer circuit production, solder mask production and text printing.
[0029] S102: Based on the real-time images of each production process and a preset first AI image detection model, a preliminary detection is performed to determine whether there are defects in the real-time image.
[0030] In some embodiments, the first AI image detection model is obtained by training a neural network based on the production process images of multiple electronic circuit boards within a historical period and the defect status of each production process image.
[0031] In some embodiments, the first AI image detection model is used to perform a preliminary detection on a real-time image to determine whether there are defects.
[0032] Exemplarily, embodiments of the present invention can select or train an AI image detection model suitable for preliminary detection according to the production process characteristics and common defect types of the circuit board, such as a convolutional neural network (CNN) based on deep learning. The preprocessed real-time image is input into the first AI image detection model, and the model automatically analyzes the features in the image to determine whether there are defects. If a defect is detected, the defect location and type (such as short circuit, open circuit, component misalignment, etc.) are marked on the image.
[0033] S103. If there are defects in the real-time image, extract the real-time images of each production process before the target production process where the defective real-time image is located.
[0034] Exemplarily, embodiments of the present invention can, according to the defect detection result, trace back and extract the real-time images of all production processes before the target production process. Using image processing technology, extract the features related to the defect from the extracted historical images, such as component layout, welding quality, material color, etc. Combine the extracted features into a defect detection vector in a certain order or weight as the input for subsequent precise detection.
[0035] As a possible implementation manner, step S103 can be specifically implemented as steps S1031 - S1034.
[0036] S1031. Determine the identification of the target circuit board of the real-time image with defects and the target production process where it is located.
[0037] Exemplarily, when the AI image detection model detects a defect in the real-time image, first generate a unique identification code for the defective image for subsequent tracking and processing. At the same time, record the specific time point when the defective image is detected. According to the identification code of the defective image, associate it with the corresponding circuit board information to obtain the unique identification of the target circuit board (such as serial number, batch number, etc.). Combine the station information on the production line and the time point when the defective image is detected to determine the specific production process when the defect appears, that is, the target production process.
[0038] S1032. Based on the identification of the target circuit board, query the database to obtain the historical image data of the target circuit board.
[0039] Exemplarily, embodiments of the present invention can establish a connection with the production line database, which stores production process data of all circuit boards, including real-time images, production process information, quality inspection records, etc. Using the unique identifier of the target circuit board as a query condition, retrieve the historical image data of the circuit board in all production processes from the database. Ensure that the retrieved historical image data is sorted in the order of the production processes.
[0040] S1033. Based on the target production process and the sequence of each production process, determine the production processes to be extracted.
[0041] Exemplarily, embodiments of the present invention can clarify the sequence of each production process according to the process flow chart or production plan of the production line. Starting from the target production process, trace back reversely to determine all production processes that require image extraction before the target production process. Consider the dependency relationship and influence degree between production processes to ensure that the extracted images can comprehensively reflect the possible sources of defects.
[0042] S1034. Based on the production processes to be extracted and the historical image data of the target circuit board, extract the real-time images of each production process before the target production process.
[0043] Exemplarily, embodiments of the present invention can extract the real-time images of the corresponding processes from the historical image data of the target circuit board according to the list of production processes to be extracted. Ensure that the extracted images are clear and complete and can be used for subsequent defect analysis and traceability. Store the extracted real-time images in a specified folder or database for subsequent query and analysis. Generate corresponding metadata for the extracted images, such as extraction time, production process, circuit board identifier, etc., for easy tracking and management.
[0044] S104. Based on the real-time images of each production process before the target production process, construct a defect detection vector.
[0045] In some embodiments, the defect detection vector is the input vector of the second AI image detection model. The defect detection vector includes the horizontal features and vertical features of the real-time image. The horizontal features represent the features of each part within a single real-time image. The vertical features represent the features of the same region in multiple real-time images.
[0046] As a possible implementation, step S104 can be specifically implemented as steps S1041 - S1044.
[0047] S1041. Based on the corresponding relationship between the real-time images of each production process, divide the real-time images of each production process before the target production process into regions to obtain multiple images after region division.
[0048] Exemplarily, the embodiments of the present invention can analyze the process flow and image changes between various production processes and determine the corresponding relationship between real-time images. For example, before the welding process, printing, patch and other processes may be involved, and the corresponding areas of the images of these processes on the circuit board are known. According to the layout of the circuit board and the distribution of components, the real-time image of each production process is divided into multiple areas. When dividing the area, factors such as the type, size, and position of the components can be considered to ensure that each area contains independent detection objects or features. Mark the divided areas and record the boundaries and position information of each area. Store the multiple images after the area is divided for subsequent feature extraction.
[0049] S1042. Based on the real-time image of each production process, perform lateral feature extraction to obtain lateral features.
[0050] Exemplarily, transverse features refer to feature differences or commonalities between different regions in the same production process. For example, in the printing process, features such as ink thickness and uniformity of each printing area can be extracted as transverse features. Use image processing algorithms (such as edge detection, texture analysis, color recognition, etc.) to extract features from real-time images of each production process. For each region, calculate its characteristic values, such as mean, variance, histogram, etc., as the transverse features of the region. Store the extracted transverse features and integrate them according to the production process and region. This facilitates subsequent combination with longitudinal features to generate defect detection vectors.
[0051] S1043. Based on the multiple images after the division, extract longitudinal features according to the divided regions to obtain longitudinal features.
[0052] Exemplarily, longitudinal features refer to feature changes or trends between different production processes, the same area or similar areas. For example, between the printing and welding processes, features such as ink changes and welding quality in the same printing area can be extracted as longitudinal features. The present invention aligns and matches multiple images after dividing the areas according to the areas. Use algorithms such as time series analysis and change detection to extract feature changes or trends between different production processes in each area. The extracted longitudinal features are stored and integrated according to the area and production process. This facilitates subsequent combination with the lateral features to generate a defect detection vector.
[0053] S1044. Generate a defect detection vector based on the horizontal features and the vertical features.
[0054] Exemplarily, the embodiments of the present invention can fuse the horizontal features and the vertical features to form a complete feature set. Feature fusion can be performed using methods such as feature concatenation and weighted summation. Based on the fused feature set, a defect detection model is trained using a machine learning algorithm (such as a support vector machine, a neural network, etc.). The result of the model output is used as a defect detection vector, which contains defect information of the circuit board in different production processes. The generated defect detection vector is interpreted and analyzed to determine the type, location, and severity of the defect. The defect detection vector is applied to the quality control and defect tracing of the production line to improve the production quality and efficiency of the circuit board.
[0055] S105. Based on the target production process, a second AI image detection model is screened and obtained.
[0056] For example, the embodiment of the present invention can establish a model library containing multiple second AI image detection models according to different production processes and defect types of circuit boards. According to the characteristics of the target production process and the preliminary detection results, the second AI image detection model that best suits the process and defect type is selected from the model library.
[0057] In some embodiments, the second AI image detection model is obtained by training a neural network based on production process images corresponding to various defect types and related images of the production process images.
[0058] S106. Based on the defect detection vector and the second AI image detection model, accurate detection is performed to obtain a defect detection result of the circuit board to be tested.
[0059] In some embodiments, the defect detection result includes a defect type.
[0060] In some embodiments, the defect detection result also includes the identification of the circuit board to be tested, the time when the defect was discovered, the production process corresponding to the defect, etc.
[0061] As a possible implementation manner, step S106 may be specifically implemented as steps S1061 - S1062 .
[0062] S1061. Input the defect detection vector into the second AI image detection model to obtain the probability of each defect type in the target production process.
[0063] Exemplarily, ensure that the second AI image detection model has been trained and has the ability to identify various defect types that may occur in the target production process. The model may be a deep learning network, such as a variant of a convolutional neural network (CNN) or a recurrent neural network (RNN), specifically for image defect detection. The previously generated defect detection vector is passed as input data to the second AI image detection model. The defect detection vector contains the characteristic information of the circuit board in different production processes, which is the basis for the model to identify defects. The second AI image detection model infers the input defect detection vector and calculates the probability of each defect type in the target production process. The model may perform feature extraction, classification and probability calculation on the input data through a multi-layer neural network. The model outputs a probability distribution indicating the probability of each defect type in the target production process. These probability values can be used for subsequent defect type determination and defect severity assessment.
[0064] S1062. Determine the defect type of the circuit board to be tested based on the probability of each defect type in the target production process.
[0065] Exemplarily, an embodiment of the present invention can set a probability threshold value according to actual application requirements and model performance. When the probability of a certain defect type exceeds this threshold, it is considered that the circuit board to be tested has defects of this type. Defect type determination: traverse the probability distribution of the model output and find out the defect types that exceed the probability threshold. Use these defect types as defect detection results for the circuit board to be tested. Output the determined defect type to the production line control system or quality inspection personnel. Record the defect detection results, including information such as defect type, location, severity, etc., for subsequent quality traceability and improvement. Based on the defect detection results, the production line control system can decide whether the circuit board to be tested needs to be repaired, scrapped or reprocessed. Quality inspection personnel can adjust and optimize the production line based on the defect detection results to improve the production quality and efficiency of the circuit board.
[0066] Optionally, step S104 may also be implemented as steps A1-A3.
[0067] A1. Based on the real-time images of each production process before the target production process, the image set is divided to obtain an image set of each production process.
[0068] The image set of any production process includes the real-time image of the production process and the real-time images of each production process before the production process.
[0069] Exemplarily, for each production process before the target production process, an image set containing real-time images of the process and all previous processes is constructed. The purpose of this is to capture the possible evolution of defects between different processes. For any production process, its real-time image and the real-time images of all previous processes are collected to form an image set. Ensure that the images in the image set are sorted in the order of the production process for subsequent feature extraction. The constructed image set is stored in a specified database or folder for subsequent access and processing. Generate corresponding metadata for each image set, such as production process, number of images, construction time, etc.
[0070] A2. Based on the image set of each production process, horizontal feature extraction and vertical feature extraction are performed to obtain the horizontal features and vertical features of each production process.
[0071] Exemplarily, for each set of images of a production process, horizontal feature extraction and vertical feature extraction are performed separately. Horizontal feature extraction focuses on the feature differences or commonalities between different images in the same process. Vertical feature extraction focuses on the feature changes or trends in the same or similar areas between different processes. According to the production process and defect type of the circuit board, select the appropriate feature type for extraction. For example, the texture, color, shape, edge and other features of the image can be extracted. The extracted horizontal features and vertical features are stored separately and integrated according to the production process. This facilitates the subsequent generation of defect detection vectors for each production process.
[0072] A3. Generate a defect detection vector for each production process based on the horizontal and vertical features of each production process.
[0073] Exemplarily, the embodiment of the present invention can fuse the horizontal features and vertical features of each production process to form a complete feature set. Feature fusion can be performed using methods such as feature splicing and weighted summation. Based on the fused feature set, a machine learning algorithm (such as a support vector machine, a neural network, etc.) is used to train or apply an existing defect detection model. The result output by the model is used as a defect detection vector for each production process, which contains the defect information of the circuit board in the process.
[0074] Correspondingly, step S106 can be specifically implemented as steps B1-B4.
[0075] B1. Based on the defect detection vector of the target production process and the second AI image detection model corresponding to the target production process, the probability of each defect type in the target production process is obtained.
[0076] Exemplarily, an embodiment of the present invention may select or train a second AI image detection model for a target production process. The defect detection vector of the target production process is input into the model to obtain the probability of each defect type in the process. The model infers the input defect detection vector and calculates the probability of each defect type. The output probability distribution represents the possibility of each defect type in the target production process.
[0077] B2. Based on the defect detection vector of each production process and the second AI image detection model corresponding to each production process, the probability of each defect type in each production process is obtained.
[0078] Exemplarily, for each production process, a corresponding second AI image detection model is selected or trained. The defect detection vector of each production process is input into its corresponding model to obtain the probability of each defect type in the process. The defect type probabilities obtained for each production process are arranged in the order of the production processes to form a probability sequence.
[0079] B3. Based on the probability of each defect type in the target production process and the probability of each defect type in each production process, a probability sequence of each defect type is generated.
[0080] For example, the embodiments of the present invention can integrate the defect type probability of the target production process with the defect type probability of other production processes. Ensure that the probability sequence is arranged in the order of the production processes for subsequent analysis. Analyze the generated probability sequence to observe the changing trend of the defect type between different processes. The probability sequence can be further processed using statistical methods or machine learning algorithms to extract more useful information.
[0081] B4. Determine the defect detection result of the circuit board to be tested based on the probability sequence of each defect type.
[0082] Exemplarily, the embodiment of the present invention can traverse the probability sequence to find the defect type with a higher probability in each production process. Combined with the sequence of production processes and the evolution of defect types, the final defect type of the circuit board to be tested is determined. The determined defect type is output to the production line control system or quality inspection personnel. The defect detection results are recorded, including information such as defect type, location, severity, and evolution process between different processes.
[0083] The present invention provides an AI image detection method for an electronic circuit board, which performs preliminary detection and precise detection through real-time images of each production process of the circuit board, realizes automatic defect detection of the electronic circuit board, does not require human intervention, and improves the efficiency of defect detection. In addition, the present invention performs preliminary detection and precise detection through a first AI image detection model and a second AI image detection model, which can reduce the resource usage in the defect detection process, ensure the real-time nature of defect detection of the electronic circuit board, and thus improve the efficiency of defect detection of the electronic circuit board.
[0084] Optionally, the AI image detection method for electronic circuit boards provided in an embodiment of the present invention further includes steps S201-S203 before step S102.
[0085] S201. Acquire production process images of multiple electronic circuit boards in a historical period, and the defect status of each production process image.
[0086] In some embodiments, the defect status includes the presence of a defect and the absence of a defect.
[0087] Exemplarily, an embodiment of the present invention can obtain production process images of multiple electronic circuit boards in a historical period from the image acquisition system of the production line. These images should cover all key processes of circuit board production, such as patching, welding, testing, etc. Manual or automatic defect status annotation is performed on each production process image. Defect status includes "defect exists" and "defect does not exist". For images with defects, the type and location of the defect can be further annotated (if possible). The collected images and their defect status are organized into a data set for subsequent processing and analysis. The data set should be stored in a secure and reliable data storage system to ensure the integrity and availability of the data.
[0088] S202: Generate a first training sample based on a production process image with defects.
[0089] Exemplarily, the embodiments of the present invention can filter out all defective production process images from the data set. Ensure the diversity and representativeness of the samples, covering different types of defects and different production processes. Preprocess the selected images, such as cropping, scaling, normalization, etc., to unify the format and size of the images. If necessary, the images can also be enhanced, such as rotating, flipping, adding noise, etc., to increase the diversity and generalization ability of the samples. Annotate the preprocessed images to clarify the type and location of the defects (if possible). Organize the annotated images into the first training sample set for subsequent use in neural network training.
[0090] S203: Generate a second training sample based on the production process image without defects.
[0091] Exemplarily, the embodiments of the present invention can filter out all defect-free production process images from the data set. Ensure the diversity and representativeness of the samples, covering different production processes and normal production conditions. Perform the same preprocessing operation on the selected images as the first training samples to unify the format and size of the images. Arrange the preprocessed images into a second training sample set for subsequent use in neural network training. Since these images do not have defects, there is no need to mark the defect type and location.
[0092] S204: Perform neural network training based on the first training sample and the second training sample to obtain a first AI image detection model.
[0093] Exemplarily, the embodiments of the present invention may select a neural network architecture suitable for image defect detection, such as a convolutional neural network (CNN), a residual network (ResNet), etc. According to the size and complexity of the data set, the number of layers, convolution kernel size, activation function and other parameters of the neural network are adjusted. The first training sample and the second training sample are divided into a training set and a validation set respectively. The training set is used to train the neural network, and the validation set is used to evaluate the performance of the model and adjust the hyperparameters. The neural network is trained using the training set, and the parameters of the model are optimized by the back propagation algorithm. During the training process, a loss function (such as cross entropy loss) is used to measure the difference between the prediction result of the model and the true label. The loss function is minimized by an optimization algorithm such as gradient descent to improve the accuracy of the model. The performance of the model, such as accuracy, recall rate, F1 score, etc., is evaluated using the validation set. The hyperparameters of the model, such as learning rate, batch size, number of training rounds, etc., are adjusted according to the validation results. The training-validation process is repeated until the model performance reaches a satisfactory level. The trained first AI image detection model is saved as a file or database record for subsequent loading and use. The model is deployed to the image detection system on the production line to achieve real-time or batch circuit board defect detection.
[0094] In this way, the embodiment of the present invention can train a first AI image detection model before performing defect detection on the circuit board, so as to facilitate circuit board defect detection.
[0095] Optionally, the AI image detection method for electronic circuit boards provided in an embodiment of the present invention further includes steps S301-S308 before step S105.
[0096] S301. Acquire production process images corresponding to various defect types and images related to the production process images, as well as defect types corresponding to each production process image.
[0097] In some embodiments, the related images of the production process image include circuit board images of each production process before the production process where the production process image is located; the defect types include one or more of the following: welding defects, mechanical damage, poor gold wire, wiring defects and component defects.
[0098] Exemplarily, an embodiment of the present invention can obtain production process images corresponding to various defect types from the image acquisition system of the production line. For each production process image, circuit board images of each production process before the production process are also collected as related images. The range of defect types is clarified, including but not limited to welding defects, mechanical damage, poor gold wire, wiring defects and component defects. Each defect type is described and defined in detail for subsequent feature extraction and model training. Each production process image is labeled with the defect type to clarify its corresponding defect type. Ensure the accuracy and consistency of the annotation for subsequent training and verification.
[0099] S302: Extract lateral features based on each production process image and the related images of the production process image to obtain lateral features of each circuit board image.
[0100] Exemplarily, the embodiment of the present invention can pre-process the production process image and its related images, such as cropping, scaling, graying or color space conversion. Use image processing technology or feature extraction algorithm to extract lateral features from each circuit board image. The lateral features may include the texture, color, shape, edge, etc. of the image, which are used to describe the characteristics of the image in space. The extracted lateral features are stored to facilitate subsequent feature fusion and model training.
[0101] S303: Based on each production process image and the related images of the production process image, perform region division and longitudinal feature extraction to obtain the longitudinal features of each divided region.
[0102] Exemplarily, the embodiment of the present invention can perform region division on each circuit board image, dividing the image into multiple sub-regions or regions of interest (ROI). Region division can be performed based on the characteristics of the image content, structure or defect type. For each divided region, longitudinal feature extraction is performed in the production process image and its related images. The longitudinal features can describe the changes or trends of the region between different production processes, such as brightness changes, shape changes, etc. The extracted longitudinal features are stored according to the divided regions to facilitate subsequent feature fusion and model training.
[0103] S304: Generate a defect detection vector for each production process image based on the lateral features of each circuit board image and the longitudinal features of each divided area.
[0104] Exemplarily, embodiments of the present invention can fuse horizontal features and vertical features to form a complete feature set. The fusion method can be simple splicing, weighted summation, or more complex feature fusion algorithms. Based on the fused feature set, key features are extracted using feature selection or dimensionality reduction algorithms. The key features are combined into a defect detection vector to represent the defect information of the production process image.
[0105] S305. Generate defect detection results for each production process image based on the corresponding defect type of each production process image.
[0106] Exemplarily, embodiments of the present invention can clarify the representation method of the defect detection results, such as using labels, classification, or probability distribution, etc. According to the corresponding defect type of the production process image, its defect detection result is generated. The defect detection result can indicate whether there is a defect in the image, the type of the defect, and the severity of the defect, etc.
[0107] S306. Generate a third training sample based on the defect detection vector and the defect detection result of each production process image.
[0108] Exemplarily, embodiments of the present invention can combine the defect detection vector and the defect detection result into a training sample. Each training sample includes a defect detection vector and a corresponding defect detection result. The constructed training samples are stored for subsequent model training and verification.
[0109] S307. Classify the third training sample based on the production process of each production process image to obtain multiple sub-sample sets.
[0110] Exemplarily, embodiments of the present invention can classify the third training sample according to the production process of the production process image. The training samples belonging to the same production process are divided into the same sub-sample set. The classified sub-sample sets are stored for subsequent model training and verification.
[0111] S308. Perform neural network training respectively based on multiple sub-sample sets to obtain multiple second AI image detection models.
[0112] Exemplarily, an embodiment of the present invention may select a neural network architecture suitable for image defect detection, such as a convolutional neural network (CNN), a recurrent neural network (RNN), or a combination thereof. For each subsample set, a neural network is used for training. During the training process, a loss function is used to measure the difference between the model's prediction results and the actual defect detection results. The accuracy of the model is improved by minimizing the loss function through an optimization algorithm. The performance of each model is evaluated using a validation set, such as accuracy, recall, F1 score, etc. The model with the best performance is selected as the second AI image detection model based on the validation results. The trained second AI image detection model is saved as a file or database record. The model is deployed to the image detection system on the production line to implement circuit board defect detection for a specific production process.
[0113] Exemplarily, before defect type detection, the present invention obtains a second AI image detection model through neural network training to facilitate defect type detection of electronic circuit boards.
[0114] Optionally, the AI image detection method for electronic circuit boards provided in an embodiment of the present invention further includes steps S401-S405 after step S106.
[0115] S401. Record defect information of each production process within a set period, where the defect information includes the defect frequency of each defect type.
[0116] Exemplarily, an embodiment of the present invention can monitor and record defects in each production process on a production line within a set period (such as a week, a month, or a quarter). Use a special defect record table or database system to record the frequency of occurrence of each defect type. Clarify the scope of defect types, such as welding defects, mechanical damage, poor gold wire, wiring defects, component defects, etc., and ensure that all relevant personnel have a consistent understanding of the definition of defect types. Classify and record each defect in detail for subsequent analysis. Organize the collected defect information into tables or database records, including production process name, defect type, defect frequency, etc. Ensure the accuracy and completeness of the data to facilitate subsequent analysis and processing.
[0117] S402. Determine key processes and key defect types based on defect information of each production process.
[0118] In some embodiments, a critical process is a production process whose defect frequency is greater than a first threshold, and a critical defect type is a defect type whose defect frequency is greater than a second threshold.
[0119] Exemplarily, the embodiment of the present invention can set the first threshold and the second threshold according to the actual situation and historical data of the production line. The first threshold is used to determine whether the production process is a critical process, and the second threshold is used to determine whether the defect type is a critical defect type. Compare the defect frequency of each production process with the first threshold, and determine the production process with a defect frequency greater than the first threshold as a critical process. Compare the defect frequency of each defect type with the second threshold, and determine the defect type with a defect frequency greater than the second threshold as a critical defect type. Record the determined critical processes and critical defect types, and notify relevant departments and personnel so that they can focus on and improve them.
[0120] S403. Extract product information of electronic circuit boards related to key processes and key defect types.
[0121] In some embodiments, the product information includes product model, production batch, production date, production line number and production process parameters.
[0122] For example, the embodiment of the present invention can specify the scope of product information to be extracted, including product model, production batch, production date, production line number and production process parameters. Extract product information of electronic circuit boards related to key processes and key defect types from a production management system or database. Ensure that the extracted product information and defect information can accurately correspond. Organize the extracted product information into tables or database records to facilitate subsequent analysis and processing.
[0123] S404: Generate a defect analysis sequence based on the key process and key defect types, as well as product information of the electronic circuit board.
[0124] Exemplarily, an embodiment of the present invention may associate key processes, key defect types, and product information of electronic circuit boards to form a complete defect analysis data set. Based on the defect analysis data set, a defect analysis sequence is generated according to the order of production processes, the frequency of occurrence of defect types, or the relevance of product information. The defect analysis sequence may be a time series, a process sequence, or a correlation sequence, which is used to reveal the laws and causes of defect occurrence. The generated defect analysis sequence is visualized and displayed in the form of charts, reports, or dashboards, etc., to facilitate understanding and analysis by relevant personnel.
[0125] S405. Determine defect causes and improvement measures based on the defect analysis sequence.
[0126] Exemplarily, the embodiments of the present invention can analyze the causes of defects in depth according to the defect analysis sequence, combined with the process flow of the production process, equipment status, personnel operation and other factors. Cause and effect analysis diagrams, 5Why analysis methods and other tools can be used to analyze the causes of defects. Specific improvement measures and plans are formulated for the determined causes of defects. Improvement measures may include optimizing process flows, adjusting equipment parameters, strengthening personnel training, introducing new technologies or equipment, etc. The formulated improvement measures are implemented, and the implementation effects are verified and evaluated. If the improvement measures are effective, they are incorporated into standard operating procedures or management systems to continuously improve production quality.
[0127] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0128] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.
[0129] Figure 2 The structure diagram of an AI image detection device for electronic circuit boards provided by an embodiment of the present invention is shown. The image detection device 500 includes a communication module 501 and a processing module 502 .
[0130] The communication module 501 is used to obtain real-time images of the circuit board to be tested in each production process.
[0131] The processing module 502 is used to perform preliminary detection based on the real-time images of each production process and a preset first AI image detection model to determine whether the real-time image has defects; if the real-time image has defects, the real-time images of the production processes before the target production process where the defective real-time image is located are extracted; and based on the real-time images of the production processes before the target production process, a defect detection vector is constructed; based on the target production process, a second AI image detection model is screened and obtained; based on the defect detection vector and the second AI image detection model, accurate detection is performed to obtain the defect detection result of the circuit board to be tested.
[0132] Figure 3 Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 3 As shown, the electronic device 600 includes: a processor 601, a memory 602, and a computer program 603 stored in the memory 602 and executable on the processor 601. When the processor 601 executes the computer program 603, the steps in the above-mentioned method embodiments are implemented, for example Figure 1Alternatively, when the processor 601 executes the computer program 603, the functions of the modules / units in the above-mentioned device embodiments are realized, for example, Figure 2 The functions of the communication module 501 and the processing module 502 are shown.
[0133] Exemplarily, the computer program 603 may be divided into one or more modules / units, which are stored in the memory 602 and executed by the processor 601 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program 603 in the electronic device 600. For example, the computer program 603 may be divided into Figure 2 A communication module 501 and a processing module 502 are shown.
[0134] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. An AI image detection method for electronic circuit boards, characterized in that: include: Obtain real-time images of the circuit board under test in each production process; Based on the real-time images of each production process and a preset first AI image detection model, a preliminary detection is performed to determine whether the real-time images have defects; If the real-time image has defects, extract the real-time images of each production process before the target production process where the real-time image with defects is located; and construct a defect detection vector based on the real-time images of each production process before the target production process; Based on the target production process, a second AI image detection model is screened and obtained; Based on the defect detection vector and the second AI image detection model, accurate detection is performed to obtain the defect detection result of the circuit board to be tested.
2. The AI image detection method of electronic circuit board according to claim 1, characterized in that: The method further includes: performing a preliminary inspection based on the real-time images of each production process and the preset first AI image detection model to determine whether the real-time images have defects. Acquire production process images of multiple electronic circuit boards in a historical period, and defect states of each production process image, wherein the defect states include presence of a defect and absence of a defect; Generate a first training sample based on a production process image with defects; generating a second training sample based on the production process image without defects; Based on the first training sample and the second training sample, neural network training is performed to obtain the first AI image detection model.
3. The AI image detection method of electronic circuit board according to claim 1, characterized in that: The real-time images of each production process before the target production process where the real-time image with defects is extracted include: Determine the identity and target production process of the target circuit board of the real-time image having the defect; Based on the identification of the target circuit board, query the database to obtain historical image data of the target circuit board; Based on the target production process and the sequence of each production process, determine the production process to be extracted; Based on the production process to be extracted and the historical image data of the target circuit board, real-time images of each production process before the target production process are extracted.
4. The AI image detection method of electronic circuit board according to claim 1, characterized in that: The step of constructing a defect detection vector based on real-time images of each production process before the target production process includes: Based on the correspondence between the real-time images of each production process, the real-time images of each production process before the target production process are divided into regions to obtain a plurality of images after the division of regions; Based on the real-time image of each production process, horizontal feature extraction is performed to obtain horizontal features; Based on the multiple images after the division of regions, longitudinal features are extracted according to the divided regions to obtain longitudinal features; Based on the transverse features and the longitudinal features, a defect detection vector is generated.
5. The AI image detection method of electronic circuit board according to claim 1, characterized in that: Before the second AI image detection model is screened based on the target production process, the method further includes: Acquire production process images corresponding to various defect types and related images of the production process images, as well as defect types corresponding to each production process image; the related images of the production process image include circuit board images of each production process before the production process where the production process image is located; the defect types include one or more of the following: welding defects, mechanical damage, poor gold wire, wiring defects and component defects; Based on each production process image and the related images of the production process image, lateral feature extraction is performed to obtain the lateral features of each circuit board image; Based on each production process image and the related images of the production process image, regional division and longitudinal feature extraction are performed to obtain the longitudinal features of each divided area; Generate a defect detection vector for each production process image based on the lateral features of each circuit board image and the longitudinal features of each divided area; Generate defect detection results for each production process image based on the defect type corresponding to each production process image; generating a third training sample based on the defect detection vector and the defect detection result of each production process image; Classifying the third training samples based on the production process of each production process image to obtain a plurality of sub-sample sets; Based on the multiple sub-sample sets, neural network training is performed separately to obtain multiple second AI image detection models.
6. The AI image detection method of electronic circuit board according to claim 1, characterized in that: The method of performing accurate detection based on the defect detection vector and the second AI image detection model to obtain a defect detection result of the circuit board to be tested includes: Inputting the defect detection vector into the second AI image detection model to obtain the probability of each defect type in the target production process; Based on the probability of each defect type in the target production process, the defect type of the circuit board to be tested is determined.
7. The AI image detection method of electronic circuit board according to claim 4, characterized in that: The step of constructing a defect detection vector based on real-time images of each production process before the target production process also includes: Based on the real-time images of each production process before the target production process, the image set is divided to obtain the image set of each production process; wherein the image set of any production process includes the real-time image of the any production process and the real-time images of each production process before the any production process; Based on the image set of each production process, horizontal feature extraction and vertical feature extraction are performed to obtain the horizontal feature and vertical feature of each production process; Based on the transverse and longitudinal features of each production process, a defect detection vector of each production process is generated.
8. The AI image detection method of electronic circuit board according to claim 7, characterized in that: The method of performing accurate detection based on the defect detection vector and the second AI image detection model to obtain a defect detection result of the circuit board to be tested includes: Based on the defect detection vector of the target production process and the second AI image detection model corresponding to the target production process, the probability of each defect type in the target production process is obtained; Based on the defect detection vector of each production process and the second AI image detection model corresponding to each production process, the probability of each defect type in each production process is obtained; Based on the probability of each defect type in the target production process and the probability of each defect type in each production process, a probability sequence of each defect type is generated; Based on the probability sequence of each defect type, the defect detection result of the circuit board to be tested is determined.
9. The AI image detection method for an electronic circuit board according to any one of claims 1 to 8, characterized in that: After performing accurate detection based on the defect detection vector and the second AI image detection model to obtain a defect detection result of the circuit board to be tested, the method further includes: Recording defect information of each production process within a set period, wherein the defect information includes the defect frequency of each defect type; Based on the defect information of each production process, determine the key process and the key defect type; the key process is a production process with a defect frequency greater than a first threshold, and the key defect type is a defect type with a defect frequency greater than a second threshold; Extracting product information of electronic circuit boards related to the key process and key defect type, the product information including product model, production batch, production date, production line number and production process parameters; Generate a defect analysis sequence based on the key process and key defect type, and product information of the electronic circuit board; Based on the defect analysis sequence, the defect causes and improvement measures are determined.
10. An AI image detection system for electronic circuit boards, characterized in that: The image detection system includes an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor is used to call and run the computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
High-precision full-automatic FPC (Flexible Printed Circuit) defect detecting device and detecting process
CN104655641A
PCB defect two-stage detection method based on deep learning
CN115965583A
Industrial product quality detection method and system based on machine vision
CN119600032A
Ultra-high voltage cable surface quality inspection system using image based anomaly detection model
KR102627233B1
Cited By
Method and system for detecting outer circuit of PCB (Printed Circuit Board)
CN120953226A
A method and system for detecting outer layer circuits of a PCB
CN120953226B
Artificial Intelligence-Based Chip Defect Detection Method and System
CN122573861A