A method, device, equipment and storage medium for detecting defects in a flexible circuit board
By performing image processing and unit module segmentation on the flexible circuit board, and using pre-trained models for defect identification and reverse combination analysis, the problem of time-consuming, labor-intensive and cost-effective traditional manual detection is solved, and efficient and automated defect detection is achieved.
Patent Information
- Application Number
- CN202410742388.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Traditional methods of manual detection of flexible circuit board defects require high professional skills, time-consuming and costly, and cannot meet the needs of fast and large-scale production.
By acquiring the image of the flexible circuit board, segmenting the unit module, and inputting the unit module image to the pre-trained defect detection model for defect identification, the final reverse combination analysis obtains the defect location and category.
The automated defect detection process is realized, the detection efficiency is improved, labor costs are reduced, and the problem of poor algorithm reusability caused by fast style updates in customized production is overcome.
Smart Images

Figure CN118691567B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a flexible circuit board defect detection method, device, equipment and storage medium. Background Art
[0002] Flexible printed circuit board (FPC) is a kind of highly reliable and extremely flexible soft printed board made of polyimide or polyester film as the substrate. Compared with traditional printed boards and hard boards, flexible printed circuit boards have significant advantages such as high wiring density, small line width, large component density, thin thickness, and foldable bending, which are more in line with the requirements of the downstream electronic industry's intelligent, portable, and lightweight trends. At present, flexible printed boards have been widely used in aerospace, military, mobile terminals, mobile phones, digital cameras, new energy vehicles and other fields. However, the quality of FPC directly affects the quality of downstream products and even affects the safety performance of products. Therefore, downstream manufacturers have very strict quality requirements for FPC. The production process of flexible printed boards is more complicated than that of printed boards, and has higher requirements for process and production environment, and is easily affected by dust. At the same time, the mechanical strength of flexible printed boards is very small, and it is very easy to produce solder joints or disconnection of wiring during the process; the force bearing capacity is small, so it is easy to produce wrinkles, thus becoming a defective product. During the manufacturing process, there may be defects such as poor appearance (foreign matter, bubbles, reinforcement deviation); poor circuit (open circuit, short circuit, residual copper, hole, line width mismatch, wire damage); poor gold surface (scratches, oxidation, exposed copper), etc. Therefore, the quality of FPC needs to be strictly tested during the production process.
[0003] However, in the current flexible circuit board defect detection, the traditional manual detection method requires high professional skills of the inspectors, is time-consuming, labor-intensive and costly, and cannot meet the needs of rapid and large-scale production. Summary of the invention
[0004] The present invention provides a flexible circuit board defect detection method, device, equipment and storage medium to solve the technical problems that traditional manual detection methods have high requirements on the professional skills of detection personnel, are time-consuming, labor-intensive and costly, and cannot meet the needs of rapid and large-scale production.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for detecting defects in a flexible circuit board, comprising:
[0006] Acquire an image of the flexible circuit board to be inspected;
[0007] Performing unit module segmentation on the image to obtain unit module images corresponding to a plurality of unit modules; wherein the unit module is a minimum standard unit in a preset flexible circuit board;
[0008] Inputting each unit module image into a corresponding defect detection model, so that the defect detection model performs defect recognition on the unit module image and outputs a defect recognition result of the corresponding unit module;
[0009] According to the defect identification results of each unit module, the defect position and defect category of the flexible circuit board to be tested are obtained by reverse combination analysis;
[0010] Among them, the defect detection model of each unit module takes the historical defect image of each unit module as input and the defect recognition result of each unit module as output, and is obtained by training a preset neural network model.
[0011] As a preferred solution, the step of performing defect recognition on the unit module image and outputting the defect recognition result of the corresponding unit module includes:
[0012] According to the unit module image of the flexible circuit board to be detected and the preset production design template of the flexible circuit board, the convolution features and contour information in the production design template and the unit module image are extracted;
[0013] Performing feature alignment on the convolution features and contour information;
[0014] According to the convolution features and contour information after feature alignment, defect recognition is performed on the unit module image, and a defect recognition result of the corresponding unit module is output.
[0015] As a preferred solution, the method of extracting convolution features and contour information in the production design template and the unit module image according to the unit module image of the flexible circuit board to be detected and the preset production design template of the flexible circuit board includes:
[0016] According to a preset ResNet101 network, extract convolution features from the production design template and the unit module image;
[0017] According to a preset contour extraction algorithm based on wavelet decomposition and local similarity, contour information in the production design template and the unit module image is extracted, and noise removal and edge connection are performed on the contour information.
[0018] As a preferred solution, the contour information in the production design template and the unit module image is extracted according to a preset contour extraction algorithm based on wavelet decomposition and local similarity, and noise removal and edge connection are performed on the contour information, including:
[0019] Extracting contour information from the production design template and the unit module image;
[0020] Performing wavelet decomposition on the production design template and the unit module image, and then removing noise in the contour information according to the components after the wavelet decomposition and a preset noise threshold;
[0021] The local similarity of each position in the production design template and the unit module image is calculated, and then the contour information is edge-connected according to the local similarity.
[0022] As a preferred solution, the step of aligning the convolution features and the contour information includes:
[0023] According to the preset dual-channel self-attention mechanism, the connection between each convolution feature and contour information, as well as the connection between different convolution features and contour information are calculated, and then the convolution features and contour information are aligned according to the calculation results.
[0024] As a preferred solution, the defect recognition of the unit module image is performed according to the convolution features and contour information after feature alignment, and the defect recognition result of the corresponding unit module is output, including:
[0025] Inputting the convolution features and contour information after feature alignment into a preset Transformer decoder, so that the Transformer decoder decodes the convolution features and contour information to obtain corresponding prediction head features;
[0026] The prediction head feature is input into a preset prediction head, so that the prediction head performs forward calculation according to the prediction head feature, obtains the defect position and defect category of the unit module image, and outputs the defect recognition result of the corresponding unit module.
[0027] As a preferred solution, it also includes:
[0028] According to the preset adaptive learning rate adjustment algorithm based on accuracy and forgetting rate, the accuracy and forgetting rate of the defect detection model are calculated, and then the learning rate of the defect detection model is adjusted according to the accuracy and forgetting rate, and the defect detection model is learned and updated according to the adjusted learning rate.
[0029] Based on the above embodiment, another embodiment of the present invention provides a flexible circuit board defect detection device, including: an image acquisition module, a unit segmentation module, a defect recognition module and a reverse analysis module;
[0030] The image acquisition module is used to acquire an image of the flexible circuit board to be inspected;
[0031] The unit segmentation module is used to segment the image into unit modules to obtain unit module images corresponding to a plurality of unit modules; wherein the unit module is the smallest standard unit in a preset flexible circuit board;
[0032] The defect recognition module is used to input each unit module image into a corresponding defect detection model, so that the defect detection model performs defect recognition on the unit module image and outputs a defect recognition result of the corresponding unit module; wherein the defect detection model of each unit module takes the historical defect image of each unit module as input and the defect recognition result of each unit module as output, and is obtained by training a preset neural network model;
[0033] The reverse analysis module is used to perform reverse combination analysis based on the defect identification results of each unit module to obtain the defect position and defect category of the flexible circuit board to be detected.
[0034] Based on the above embodiments, another embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the flexible circuit board defect detection method described in the above invention embodiment is implemented.
[0035] Based on the above embodiments, another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the flexible circuit board defect detection method described in the above invention embodiment.
[0036] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0037] The present invention provides a flexible circuit board defect detection method, which comprises the following steps: acquiring an image of a flexible circuit board to be detected; segmenting the image into unit modules to obtain unit module images corresponding to a plurality of unit modules; wherein the unit modules are the smallest standard units in a preset flexible circuit board; inputting each unit module image into a corresponding defect detection model, so that the defect detection model performs defect recognition on the unit module image, and outputs a defect recognition result of the corresponding unit module; and performing reverse combination analysis to obtain a defect position and a defect category of the flexible circuit board to be detected according to the defect recognition result of each unit module; wherein the defect detection model of each standard unit module is obtained by training a preset neural network model with a historical defect image of each unit module as input and a defect recognition result of each unit module as output.
[0038] The defect detection method proposed by the present invention divides the flexible circuit board into the most basic unit modules and performs detection, and inputs the unit module images of each unit module after segmentation into the corresponding defect detection model, that is, the defect recognition results of each unit module, and then performs reverse combination analysis to obtain the defect position and defect category of the flexible circuit board to be detected. By realizing a standardized automatic detection process, the efficiency of flexible circuit board defect detection is greatly improved, the labor cost is reduced, and the problem of poor reusability of existing algorithms caused by the fast update of flexible circuit board styles in customized production can be overcome. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flow chart of a method for detecting defects in a flexible circuit board provided by an embodiment of the present invention;
[0040] Figure 2 It is a structural schematic diagram of the FPC surface defect detection device provided by the present invention;
[0041] Figure 3 This is the FPC detection flow chart;
[0042] Figure 4 It is a flowchart of the defect identification process;
[0043] Figure 5 It is a schematic diagram of the contour extraction algorithm based on wavelet decomposition and local similarity;
[0044] Figure 6 This is a schematic diagram of the structure of the feature alignment Transformer network based on dual-channel self-attention;
[0045] Figure 7 It is a schematic diagram of the structure of the FPC defect localization and classification network based on the DERT decoder and prediction head;
[0046] Figure 8 This is a schematic diagram of the incremental online learning process;
[0047] Fig. 9 It is a structural schematic diagram of a flexible circuit board defect detection device provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0050] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0051] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0052] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0053] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0054] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0055] Embodiment 1
[0056] Please refer to Figure 1, is a flow chart of a flexible circuit board defect detection method provided by an embodiment of the present invention, comprising the following specific steps:
[0057] S1, obtaining an image of a flexible circuit board to be inspected;
[0058] S2, segmenting the image into unit modules to obtain unit module images corresponding to a number of unit modules; wherein the unit module is a minimum standard unit in a preset flexible circuit board;
[0059] S3, inputting each unit module image into a corresponding defect detection model, so that the defect detection model performs defect recognition on the unit module image and outputs a defect recognition result of the corresponding unit module;
[0060] S4. According to the defect identification results of each unit module, reverse combination analysis is performed to obtain the defect position and defect category of the flexible circuit board to be detected;
[0061] Among them, the defect detection model of each unit module takes the historical defect image of each unit module as input and the defect recognition result of each unit module as output, and is obtained by training a preset neural network model.
[0062] For details, please refer to Figure 2 , is a structural schematic diagram of an FPC surface defect detection device provided by the present invention. The present invention provides a surface defect detection device for a flexible circuit board (FPC), which comprises an industrial computer, a bar light source, a camera, a linear module, a motion control card and an image acquisition card (wherein the motion control card and the image acquisition card are hardware devices for controlling the linear module and the camera). The composition of the device is specifically described below:
[0063] (1) Light source
[0064] According to the characteristic that FPC presents yellow, the present invention uses yellow light generated by a strip light source for fill light to illuminate the FPC surface in the camera shooting area. The light source has a programmable function. The industrial computer can control the closing and brightness of the light source through the IO card in a programming manner, thereby achieving the purpose of adjusting the brightness of the light source step by step. The brightness of the light source can be adjusted step by step, so that the device can adapt to different production environments, thereby improving the adaptability of the device to the production environment.
[0065] (2) Camera
[0066] This device uses a 12-megapixel camera. Due to the high resolution requirements for the FPC area angle and the detection process, this device uses a linear module to enable the camera and light source to move freely in the XY plane, thereby achieving full coverage of the FPC. The industrial computer controls the image acquisition card based on the in-place information of the motion acquisition card to achieve photo taking.
[0067] (3) Linear module
[0068] The industrial computer sends motion instructions to the linear module through the motion control card, thereby enabling the fixture to move freely in the XY plane.
[0069] (4) Suction cup
[0070] Taking into account the strong softness of FPC, this equipment adopts Bernoulli suction cup, and forms negative pressure at the suction nozzle through the vacuum generator, so as to realize non-contact picking of FPC and place it in the specified position according to the predetermined program.
[0071] (5) Industrial Computer
[0072] The industrial computer is the control subject of this equipment and is also responsible for image processing and defect detection tasks. In order to achieve the purpose of being ready for use after power-on, this industrial computer has the function of power-on self-start.
[0073] The operation process of the entire equipment is as follows:
[0074] (1) The industrial computer retrieves the pre-set motion trajectory and parameters, sends instructions to the motion control card, and starts loading;
[0075] (2) The motion control card controls the linear module and suction nozzle of the automatic feeding device to pick up the FPC and place it at the inspection station according to the received motion instructions and parameters;
[0076] (3) After the FPC arrives at the inspection station, the industrial computer is triggered to take photos;
[0077] (4) The industrial computer retrieves the pre-set motion trajectory and parameters, sends instructions to the motion control card, and controls the camera device to adjust the position of the camera and light source;
[0078] (5) After the camera and light source reach the predetermined position, the industrial computer takes pictures through the image acquisition card, identifies defects and saves the inspection results;
[0079] (6) After the detection is completed, the industrial computer retrieves the pre-set motion trajectory and parameters, sends instructions to the motion control card, and prepares for unloading;
[0080] (7) The motion control card controls the linear module and suction nozzle of the automatic loading device to pick up the FPC and place it in the storage position according to the received motion instructions and parameters.
[0081] For details, please refer to Figure 3 , which is a flow chart of FPC inspection. The industrial computer takes a picture through an image acquisition card to obtain an image of the flexible circuit board to be inspected, and then performs visual inspection on the image. The customized FPC is modularized to implement a standardized FPC inspection process, and the defect recognition result of the flexible circuit board is obtained. The visual inspection process is as follows:
[0082] (1) According to the characteristic that FPC is composed of functional modules and basic units, for a certain FPC, the entire FPC is first divided into functional modules and unit modules according to the production design template to achieve standardized organization of customized products. For example, when dividing the unit modules, the production design template image of the FPC of a certain product can be manually divided into several functional modules, and then each functional module is divided into the smallest unit modules; then this segmentation process is formed into a segmentation mask, which is used in the subsequent online recognition process to segment the unit modules of the FPC image to be tested;
[0083] (2) Design corresponding defect recognition models for the indivisible unit modules. The network structures of the defect recognition models corresponding to different unit modules are the same, but they are trained based on different historical defect data. For example, the line defect detection model is obtained by training the preset neural network model based on the historical defect data of the line.
[0084] (3) Using the designed defect recognition model, the defects of the unit modules are identified respectively;
[0085] (4) According to the defect recognition results of the unit module, reverse organization is performed to comprehensively determine the defect location and defect category in the FPC image. Figure 3 The reverse process from right to left shown combines the unit models into a complete FPC image according to the position relationship, and corresponds the recognition results of the corresponding positions to the FPC image.
[0086] Preferably, the defect recognition of the unit module image and outputting the defect recognition result of the corresponding unit module include: extracting convolution features and contour information in the production design template and the unit module image based on the unit module image of the flexible circuit board to be detected and the preset production design template of the flexible circuit board; aligning the convolution features and contour information; and performing defect recognition on the unit module image based on the convolution features and contour information after feature alignment, and outputting the defect recognition result of the corresponding unit module.
[0087] Preferably, the method of extracting convolution features and contour information in the production design template and the unit module image based on the unit module image of the flexible circuit board to be inspected and the preset production design template of the flexible circuit board includes: extracting convolution features in the production design template and the unit module image based on a preset ResNet101 network; extracting contour information in the production design template and the unit module image based on a preset contour extraction algorithm based on wavelet decomposition and local similarity, and performing noise removal and edge connection on the contour information.
[0088] Preferably, the contour information in the production design template and the unit module image is extracted according to a preset contour extraction algorithm based on wavelet decomposition and local similarity, and the contour information is subjected to noise removal and edge connection, including: extracting the contour information in the production design template and the unit module image; performing wavelet decomposition on the production design template and the unit module image, and then removing noise in the contour information according to components after wavelet decomposition and a preset noise threshold; calculating the local similarity of each position in the production design template and the unit module image, and then performing edge connection on the contour information according to the local similarity.
[0089] Preferably, the feature alignment of the convolution features and contour information includes: calculating the connection between each convolution feature and contour information, as well as the connection between different convolution features and contour information according to a preset dual-channel self-attention mechanism, and then feature aligning the convolution features and contour information according to the calculation results.
[0090] Preferably, the method of performing defect recognition on the unit module image based on the convolution features and contour information after feature alignment and outputting the defect recognition result of the corresponding unit module includes: inputting the convolution features and contour information after feature alignment into a preset Transformer decoder, so that the Transformer decoder decodes the convolution features and contour information to obtain corresponding prediction head features; inputting the prediction head features into a preset prediction head, so that the prediction head performs forward calculation according to the prediction head features to obtain the defect position and defect category of the unit module image, and outputting the defect recognition result of the corresponding unit module.
[0091] Specifically, the defect detection model performs defect recognition on the unit module image according to the visual detection algorithm, and the specific defect recognition process is as follows:
[0092] Please refer to Figure 4 , is a flowchart of the defect identification process.,During the circuit design process, there are local abnormal / normal ambiguities, such as Figure 4The middle frame marked part, so the present invention is combined with the production design template of the flexible circuit board to eliminate ambiguity.
[0093] At the same time, according to the experience of defect detection in FPC, contour information plays a key role, so the algorithm is first designed to extract contour information. In order to speed up the detection process, this algorithm adopts traditional contour extraction algorithms, such as Sobel, Roberts, etc. However, traditional contour extraction algorithms have problems such as noise and edge discontinuity. Therefore, this invention designs a contour extraction algorithm based on wavelet decomposition and local similarity, please refer to Figure 5 , is a schematic diagram of the contour extraction algorithm based on wavelet decomposition and local similarity. The image is decomposed using DB1 wavelet by taking advantage of the strong correlation of the edge area in the wavelet decomposition components. Then, the threshold method is used to remove noise from each decomposed component. The local similarity of each position is calculated according to the following formula:
[0094]
[0095] If the value is 1, it indicates that this is an edge, otherwise it is a non-edge. Finally, the final local edge indicative map is obtained through the inverse process of wavelet decomposition. Based on this, if the local edge indicative value corresponding to the contour extracted based on the traditional algorithm is less than the threshold T2, it is removed to eliminate noise; if the local edge indicative value corresponding to the background extracted based on the traditional algorithm is greater than the threshold T2 and there are contour points in its eight neighborhoods, the background is changed to contour points and the contour disconnection is connected.
[0096] At the same time, in order to extract more low-level and high-level semantic information, the present invention adopts the ResNet101 network structure to extract multi-scale high-level semantic information of the data to be detected and the production design template, providing rich discriminant information for the subsequent detection process.
[0097] In order to align the contour information and convolution features of the inspection data and the production design template, the present invention designs a feature alignment Transformer network based on dual-channel self-attention, please refer to Figure 6 , which is a structural diagram of the feature alignment Transformer network based on dual-channel self-attention. First, the dual-channel self-attention mechanism is used to calculate the connections between features and between different inputs. The Transformer's ability to extract long-range dependencies is used to align the contour information and convolution features of the data to be tested and the production design template, and the contour information and convolution features of the data to be tested and the production design template are integrated. Among them, X1 and X2 are the contour information or convolution features of the data to be tested and the production design template.
[0098] Finally, in order to locate and classify defects, the present invention uses the decoder and prediction head of the DERT detection algorithm to locate and classify defects. Please refer to Figure 7 , is a schematic diagram of the structure of the FPC defect location and classification network based on the DERT decoder and prediction head. The specific steps are:
[0099] (1) Input the features processed by the feature alignment module into the Transformer decoder for decoding to obtain the features used for prediction head;
[0100] (2) The prediction head performs forward calculations based on the features to predict the location and category of the defect, thereby locating and classifying the defect.
[0101] Preferably, it also includes: calculating the accuracy and forgetting rate of the defect detection model according to a preset adaptive learning rate adjustment algorithm based on accuracy and forgetting rate, and then adjusting the learning rate of the defect detection model according to the accuracy and forgetting rate, and learning and updating the defect detection model according to the adjusted learning rate.
[0102] Specifically, in order to solve the problem that the performance of the detection model is reduced due to data distribution differences and new defect categories in the specific detection tasks of the new production line, the present invention also designs an incremental online learning algorithm to adaptively update the detection model, improve the detection ability of the model for characteristic detection tasks, and achieve the purpose of rapid deployment. Figure 8 In the online learning process, the accuracy and forgetting rate of the model are the main indicators for measuring online learning tasks. The calculation formulas are shown in the following formulas (2) and (3).
[0103]
[0104] Among them, a t,i A represents the accuracy on the i-th task after learning the t-th task. t represents the average accuracy on all tasks after learning the tth task. F represents the forgetting rate.
[0105] In order to retain the original detection capability of the detection model and learn new knowledge in the new data set, the present invention designs an adaptive learning rate adjustment algorithm based on accuracy and forgetting rate, as shown in the following formula (4). When the accuracy rate increases or the forgetting rate decreases, the learning rate is increased to speed up the learning model update process and learn new knowledge; when the accuracy rate decreases or the forgetting rate increases, the learning rate is kept small to slow down the learning model update process and retain the original detection capability of the detection model.
[0106]
[0107] Among them, ηt Represents the learning rate of the tth round of training. τ is a hyperparameter for adjusting the learning process and can be set as a fixed parameter manually.
[0108] It can be seen that the present invention provides a method for detecting defects in flexible circuit boards. According to the production design template, the present invention proposes a method of breaking the whole into parts to divide the customized FPC into the most basic unit modules and detect them, realizing a standardized detection process and overcoming the problem that the FPC style is updated quickly in customized production, resulting in poor reusability of the existing detection algorithm. The designed contour extraction algorithm overcomes the problems of noise and edge disconnection in the traditional contour extraction algorithm, and significantly highlights the contour information in the convolution feature, which is conducive to defect location and classification. The designed feature alignment Transformer network based on dual-channel self-attention effectively realizes the alignment of the contour features and convolution features of the data to be inspected and the production design template, which is conducive to eliminating local ambiguity and providing rich feature information for defect location and classification. The FPC defect location and classification network based on DERT decoder and prediction head is adopted to realize accurate detection of FPC defects, reduce the over-inspection rate, and reduce the workload of secondary manual screening. The adaptive adjustment learning rate algorithm based on accuracy and forgetting rate is designed to realize the incremental online learning algorithm, accelerate the update process of the detection model, and achieve the purpose of rapid deployment in the new production line. The designed visual inspection algorithm can reduce the over-inspection rate of existing inspection algorithms and the workload of secondary manual screening. On the other hand, it can achieve rapid deployment, which is conducive to manufacturers changing product types and realizing rapid customized production.
[0109] Compared with other defect detection algorithms, the advantages of this algorithm are as follows:
[0110] (1) The proposed method of breaking the whole into parts divides the customized FPC into the most basic unit modules and performs testing, realizing a standardized testing process and overcoming the problem of poor reusability of existing algorithms due to the rapid update of FPC styles in customized production;
[0111] (2) The feature alignment Transformer network based on dual-channel self-attention effectively realizes the alignment of contour features and convolutional features of the inspection data and production design template, which is conducive to eliminating local ambiguity and providing rich feature information for defect location and classification;
[0112] (3) The FPC defect localization and classification network based on DERT decoder and prediction head is adopted to achieve accurate detection of FPC defects, reduce the over-inspection rate, and reduce the workload of secondary manual screening;
[0113] (4) An incremental online learning algorithm is used to update the detection model, and an adaptive learning rate adjustment algorithm based on accuracy and forgetting rate is proposed, which is conducive to speeding up the update of the detection model in the new production environment and achieving the purpose of rapid deployment.
[0114] Embodiment 2
[0115] Please refer to Fig. 9 , is a schematic diagram of the structure of a flexible circuit board defect detection device provided by an embodiment of the present invention, the device comprising: an image acquisition module, a unit segmentation module, a defect recognition module and a reverse analysis module;
[0116] The image acquisition module is used to acquire an image of the flexible circuit board to be inspected;
[0117] The unit segmentation module is used to segment the image into unit modules to obtain unit module images corresponding to a plurality of unit modules; wherein the unit module is the smallest standard unit in a preset flexible circuit board;
[0118] The defect recognition module is used to input each unit module image into a corresponding defect detection model, so that the defect detection model performs defect recognition on the unit module image and outputs a defect recognition result of the corresponding unit module; wherein the defect detection model of each unit module takes the historical defect image of each unit module as input and the defect recognition result of each unit module as output, and is obtained by training a preset neural network model;
[0119] The reverse analysis module is used to perform reverse combination analysis based on the defect identification results of each unit module to obtain the defect position and defect category of the flexible circuit board to be detected.
[0120] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0121] Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0122] Embodiment 3
[0123] Accordingly, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the flexible circuit board defect detection method described in the above-mentioned embodiment of the invention when executing the computer program.
[0124] The electronic device may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The device may include, but is not limited to, a processor and a memory.
[0125] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the device, and various interfaces and lines are used to connect various parts of the entire device.
[0126] Embodiment 4
[0127] Accordingly, an embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the flexible circuit board defect detection method described in the above-mentioned embodiment of the invention.
[0128] The memory can be used to store the computer program, and the processor realizes various functions of the device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0129] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, the steps of each method embodiment described above can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-On l yMemory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0130] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for detecting defects in a flexible circuit board, characterized in that: include: Acquire an image of the flexible circuit board to be inspected; Performing unit module segmentation on the image to obtain unit module images corresponding to a plurality of unit modules; wherein the unit module is a minimum standard unit in a preset flexible circuit board; Input each unit module image into a corresponding defect detection model, so that the defect detection model extracts convolution features and contour information in the production design template and the unit module image according to the unit module image of the flexible circuit board to be detected and the preset production design template of the flexible circuit board; aligns the convolution features and contour information; performs defect recognition on the unit module image according to the convolution features and contour information after feature alignment, and outputs a defect recognition result of the corresponding unit module; According to the defect identification results of each unit module, the defect position and defect category of the flexible circuit board to be tested are obtained by reverse combination analysis; Among them, the defect detection model of each unit module takes the historical defect image of each unit module as input and the defect recognition result of each unit module as output, and is obtained by training a preset neural network model.
2. The flexible circuit board defect detection method according to claim 1, characterized in that: The extracting of convolution features and contour information in the production design template and the unit module image according to the unit module image of the flexible circuit board to be detected and the preset production design template of the flexible circuit board includes: According to a preset ResNet101 network, extract convolution features from the production design template and the unit module image; According to a preset contour extraction algorithm based on wavelet decomposition and local similarity, contour information in the production design template and the unit module image is extracted, and noise removal and edge connection are performed on the contour information.
3. The method for detecting defects in a flexible circuit board according to claim 2, wherein: The extracting contour information from the production design template and the unit module image according to a preset contour extraction algorithm based on wavelet decomposition and local similarity, and performing noise removal and edge connection on the contour information, comprises: Extracting contour information from the production design template and the unit module image; Performing wavelet decomposition on the production design template and the unit module image, and then removing noise in the contour information according to the components after the wavelet decomposition and a preset noise threshold; The local similarity of each position in the production design template and the unit module image is calculated, and then the contour information is edge-connected according to the local similarity.
4. The method for detecting defects in a flexible circuit board according to claim 1, wherein: The step of aligning the convolution features and the contour information includes: According to the preset dual-channel self-attention mechanism, the connection between each convolution feature and contour information, as well as the connection between different convolution features and contour information are calculated, and then the convolution features and contour information are aligned according to the calculation results.
5. The method for detecting defects in a flexible circuit board according to claim 1, wherein: The step of performing defect recognition on the unit module image according to the convolution features and contour information after feature alignment, and outputting the defect recognition result of the corresponding unit module, comprises: Inputting the convolution features and contour information after feature alignment into a preset Transformer decoder, so that the Transformer decoder decodes the convolution features and contour information to obtain corresponding prediction head features; The prediction head feature is input into a preset prediction head, so that the prediction head performs forward calculation according to the prediction head feature, obtains the defect position and defect category of the unit module image, and outputs the defect recognition result of the corresponding unit module.
6. The method for detecting defects in a flexible circuit board according to claim 1, wherein: Also includes: According to the preset adaptive learning rate adjustment algorithm based on accuracy and forgetting rate, the accuracy and forgetting rate of the defect detection model are calculated, and then the learning rate of the defect detection model is adjusted according to the accuracy and forgetting rate, and the defect detection model is learned and updated according to the adjusted learning rate.
7. A flexible circuit board defect detection device, characterized in that: include: Image acquisition module, unit segmentation module, defect recognition module and reverse analysis module; The image acquisition module is used to acquire an image of the flexible circuit board to be inspected; The unit segmentation module is used to segment the image into unit modules to obtain unit module images corresponding to a plurality of unit modules; wherein the unit module is the smallest standard unit in a preset flexible circuit board; The defect recognition module is used to input each unit module image into a corresponding defect detection model, so that the defect detection model extracts the convolution features and contour information in the production design template and the unit module image according to the unit module image of the flexible circuit board to be detected and the preset production design template of the flexible circuit board; aligns the convolution features and contour information; performs defect recognition on the unit module image according to the convolution features and contour information after feature alignment, and outputs the defect recognition result of the corresponding unit module; wherein the defect detection model of each unit module takes the historical defect image of each unit module as input and the defect recognition result of each unit module as output, and is obtained by training a preset neural network model; The reverse analysis module is used to perform reverse combination analysis based on the defect identification results of each unit module to obtain the defect position and defect category of the flexible circuit board to be detected.
8. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the flexible circuit board defect detection method as claimed in any one of claims 1 to 6 when executing the computer program.
9. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute the flexible circuit board defect detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Circuit board detection method and device, computer equipment and storage medium
CN115937170A
Printed circuit board assembly defect detection and change detection model training method and device
CN116091416A