Flexible circuit board defect detection method, device, equipment and storage medium
By compressing and mapping the global image of the flexible circuit board, and using the target detection model to identify the defective area, the problems of high positioning accuracy and frequent image splicing in the existing technology are solved, and the detection efficiency is improved.
Patent Information
- Application Number
- CN202410800426.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-20
AI Technical Summary
The existing technology requires equipment to have high positioning accuracy when detecting small defects on flexible circuit boards, and requires multiple splicing of images, resulting in low defect detection efficiency.
By obtaining the global image of the flexible circuit board for compression processing, using the pre-trained target detection model to detect the defective area in the compressed image, and mapping the target original area in the global image according to the compression ratio, performing defect identification processing and reducing equipment positioning accuracy. requirements, reduce the amount of data calculation and improve detection efficiency.
It effectively reduces the positioning accuracy requirements of the equipment, reduces the amount of data calculation, improves the efficiency of defect detection, and simplifies the detection process.
Smart Images

Figure CN118429328B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of flexible circuit boards, and in particular to a defect detection method, device, equipment and storage medium for flexible circuit boards. Background Art
[0002] Flexible printed circuit (FPC) is a bendable and windable printed circuit made of polyimide or polyester film as the substrate. It is an indispensable important carrier or key connection method in the fields of aviation, aerospace, military, automobile and consumer electronics. As electronic products develop towards the trend of being light, thin, small and compact, the precision of FPC and the complexity of the process are increasing, and the quality control of FPC is becoming more and more stringent.
[0003] When performing defect detection on FPC, the scanned images are usually registered and defect detection is performed by matching feature points. This method requires the equipment to have high positioning accuracy when detecting small defects, and requires multiple splicing of images, which is not conducive to improving defect detection efficiency. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a method, device, equipment and storage medium for detecting flexible circuit boards to solve the problem in the prior art that when detecting small defects on flexible circuit boards, the equipment is required to have high positioning accuracy and the image needs to be spliced multiple times, which is not conducive to improving the efficiency of defect detection.
[0005] A first aspect of an embodiment of the present application provides a defect detection method for a flexible circuit board, the method comprising:
[0006] Acquiring a global image of the flexible circuit board;
[0007] Compressing the global image to obtain a compressed image;
[0008] Detecting a target compression area including defects in the compressed image by using a pre-trained target detection model;
[0009] According to the compression ratio of the compression processing, mapping processing is performed in combination with the target compression area to determine the target original area corresponding to the target compression area in the global image;
[0010] Defect recognition processing is performed according to the target original area to obtain a defect detection result of the flexible circuit board.
[0011] In combination with the first aspect, in a first possible implementation manner of the first aspect, before detecting the target compressed area including defects in the compressed image by using a pre-trained target detection model, the method further includes:
[0012] Acquire a sample original image, wherein the sample original image includes a first calibration area where defects are pre-calibrated;
[0013] Compressing the sample original image according to a preset compression ratio to obtain a sample compressed image, and determining a second calibration area of the first calibration area in the sample compressed image according to the compression ratio;
[0014] The sample compressed image is calculated by a target detection model, and the parameters of the target detection model are adjusted according to a first difference between the second calibration area and the target detection area output by the target detection model until the first difference meets preset requirements, thereby obtaining a trained target detection model.
[0015] In combination with the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, before compressing the global image to obtain the compressed image, the method further includes:
[0016] Obtaining a first score of the target detection model performance trained with different compression ratios, and obtaining a second score corresponding to the detection efficiency determined by the compression ratio;
[0017] A compression ratio of the global image is determined according to the first score and the second score.
[0018] In combination with the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, obtaining a first score of the performance of the target detection model trained with different compression ratios includes:
[0019] Obtaining performance parameters of the target detection model trained with different compression ratios, the performance parameters comprising at least one of accuracy, recall, precision, and F1 score;
[0020] A first score of the performance of the target detection model trained with the different compression ratios is determined according to the performance parameter and the weight coefficient corresponding to the performance parameter.
[0021] In combination with the first aspect, in a fourth possible implementation manner of the first aspect, performing defect recognition processing according to the target original area to obtain a defect detection result of the flexible circuit board includes:
[0022] By using a pre-trained target segmentation model, segmenting the target original area to obtain defect segmentation information;
[0023] The defect segmentation information is classified by a pre-trained classification model to obtain the defect type of the target original area.
[0024] In combination with the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, before obtaining defect segmentation information by segmenting the target original area using the pre-trained target segmentation model, the method further includes:
[0025] Acquire a sample original image, wherein the sample original image includes a defect calibration contour for pre-calibrating defects;
[0026] Compressing the sample original image according to a preset compression ratio to obtain a sample compressed image;
[0027] Determine the target detection area in the sample compressed image by using the trained target detection model;
[0028] Determine, according to the target detection area and the compression ratio, a defect original area corresponding to the target detection area in the sample original image;
[0029] The original defect area is calculated by the target segmentation model, and the parameters of the target segmentation model are adjusted according to the second difference between the defect calibration contour and the defect segmentation contour output by the target segmentation model until the second difference meets the predetermined requirements, thereby obtaining a trained target segmentation model.
[0030] In combination with the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the sample original image further includes pre-calibrated defect type calibration information;
[0031] After obtaining the trained target segmentation model, the method further includes:
[0032] The defect segmentation information output by the target segmentation model is calculated through the target classification model, and the parameters of the target classification model are adjusted according to the third difference between the defect type calibration information and the defect classification output by the target classification model until the third difference meets the preset requirements, thereby obtaining a trained target classification model.
[0033] A second aspect of an embodiment of the present application provides a defect detection device for a flexible circuit board, the device comprising:
[0034] A global image acquisition unit, used to acquire a global image of the flexible circuit board;
[0035] A compression unit, used for compressing the global image to obtain a compressed image;
[0036] A target compression region detection unit, configured to detect a target compression region including defects in the compressed image by using a pre-trained target detection model;
[0037] a target original region determining unit, configured to perform mapping processing in combination with the target compressed region according to the compression ratio of the compression processing, and determine the target original region corresponding to the target compressed region in the global image;
[0038] The defect detection result recognition unit is used to perform defect recognition processing according to the target original area to obtain a defect detection result of the flexible circuit board.
[0039] A third aspect of an embodiment of the present application provides a defect detection device for a flexible circuit board, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any method described in the first aspect when executing the computer program.
[0040] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0041] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application obtain a global image of the flexible circuit board, compress the global image to obtain a compressed image, extract the target compression area in the compressed image according to the target detection model, determine the target original area in the global image by the target compression area and the compression ratio, perform defect recognition processing according to the determined target original area, and obtain the defect detection result. Since this method is based on global image detection, it can reduce the positioning accuracy requirements of the equipment and reduce the equipment cost; and the target compression area where the defect is located is detected by compressing the image, and then the target original area is obtained by mapping, and there is no need to splice the image, which can effectively reduce the amount of data calculation and improve the efficiency of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0043] Figure 1 It is a schematic diagram of the implementation process of a defect detection method for a flexible circuit board provided in an embodiment of the present application;
[0044] Figure 2 This is a schematic diagram of an implementation flow of a method for determining a scaling ratio provided in an embodiment of the present application;
[0045] Figure 3It is a schematic diagram of an implementation flow of a method for training a target detection model provided in an embodiment of the present application;
[0046] Figure 4 It is a schematic diagram of an implementation flow of a training method for a target segmentation model provided in an embodiment of the present application;
[0047] Figure 5 is a schematic diagram of a defect detection device for a flexible circuit board provided in an embodiment of the present application;
[0048] Figure 6 It is a schematic diagram of a defect detection device for a flexible circuit board provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] 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 application. However, it should be clear to those skilled in the art that the present application may also 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 application.
[0050] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0051] Flexible printed circuit (FPC) is a bendable and windable printed circuit made of polyimide or polyester film as the substrate. It is an indispensable important carrier or key connection method in the fields of aviation, aerospace, military, automobile and consumer electronics. As electronic products develop towards the trend of light, thin, small and compact, the precision of FPC and the complexity of the process are increasing, and the requirements for FPC quality control are also getting higher and higher.
[0052] When performing defect detection on flexible circuit boards, a line scan image including the flexible circuit board is usually obtained through a high-precision line scan device. Since the flexible circuit board is relatively large, it is necessary to obtain multiple line scan images, and then stitch the line scan images together by matching feature points. During the stitching process, it is necessary to find feature points of different line scan images. Due to the large amount of line scan data, the stitching time is long, which is not conducive to improving the efficiency of defect detection. In addition, when multiple scans are performed by the line scan device, the detection position of the flexible circuit board is required to be high, which can easily cause over-inspection of non-detection positions.
[0053] Based on this, the present application embodiment proposes a method for detecting a flexible circuit board, such as Figure 1 As shown, the method includes:
[0054] In S101, a global image of the flexible circuit board is acquired.
[0055] The global image obtained by the embodiment of the present application may be a high-resolution image to meet the requirements for detecting tiny defects. For example, the global image may be acquired by a 16K (not limited to 16K, but also other higher or lower resolutions) line scan camera to obtain a high-resolution global image with a resolution of 16348*22748. The global image may include an image of the entire flexible circuit board to be inspected, or it may be a partial image of the flexible circuit board to be inspected. When the global image is a partial image of the flexible circuit board to be inspected, since the global image includes more pixel information, the number of splicing times for detecting the entire flexible circuit board can be effectively reduced, thereby improving image splicing and detection efficiency.
[0056] The global image acquisition is not limited to line scan cameras, but may also include high-resolution area array cameras, etc. By acquiring a global image including the entire flexible circuit board or a part of the flexible circuit board, the number of image stitching can be effectively reduced and the defect detection efficiency can be improved.
[0057] In a possible implementation, the collected global image may be further preprocessed to improve the quality of the global image and make the detection result more accurate.
[0058] For example, the collected global image can be smoothed to filter out small noise points in the global image, so that the defect information can be more prominent. The smoothing process can use a mean filter or a median filter of a predetermined size to filter out small noise points.
[0059] The mean filter may be a linear filter method that replaces the value of each pixel with the average value of the pixel values in a neighborhood of a predetermined size around the pixel. The median filter may be a nonlinear filter method that replaces the value of each pixel with the median value of the pixel values in a neighborhood of a predetermined size around the pixel.
[0060] In a possible implementation, the preprocessing process can also convert the global image in the spatial domain into a frequency domain image, such as by mapping the global image from the pixel space to the frequency space through Fourier transform, and filtering out the high-frequency signal through a low-pass filter, thereby effectively removing or reducing the texture information in the image.
[0061] In S102, the global image is compressed to obtain a compressed image.
[0062] The embodiment of the present application can use a predetermined compression ratio to compress the global image. For example, the preset compression ratio can be 10 to 1, that is, one pixel in the global image is converted into one pixel in the compressed image. For example, the size of the global image captured by a 16K camera is 16348*22748. After compression processing with a compression ratio of 10 to 1, a compressed image with a size of 1634*2274 can be obtained.
[0063] When compressing an image, the correspondence between the pixels of the global image and the pixels in the compressed image can be determined according to the compression ratio. For example, if the compression ratio of the global image is 10 to 1, then the pixel at the position (x, y) in the compressed image corresponds to the 100 pixels of the global image near (10x, 10y). The corresponding pixels in the global image can be fitted and calculated using a predetermined polynomial to obtain the pixel values corresponding to the compressed image.
[0064] In a possible implementation, the compression ratio can also be determined according to the resolution of the image, or according to the size of the first inch of the flexible circuit board corresponding to a single pixel. For example, the correspondence between a single pixel in the compressed image and the first size of the flexible circuit board can be predetermined, and the compression ratio can be determined based on the correspondence, combined with the correspondence between a single pixel in the global image and the second size of the flexible circuit board. For example, the first size of the flexible circuit board corresponding to a single pixel in the compressed image is predetermined to be 48um, and if the second size of the flexible circuit board corresponding to a single pixel in the global image is 4.8um, then the compression ratio is: first size / second size is 10:1.
[0065] In a possible implementation, after determining the image size and pixel size of the global image, the image size can be Figure 2 The method shown determines a compression ratio matching a global image, comprising:
[0066] In S201, a first score of the performance of the target detection model trained with different compression ratios is obtained, and a second score corresponding to the detection efficiency determined by the compression ratio is obtained.
[0067] For the same defect detection device, or for the same type of defect detection device, training can be performed at different compression ratios based on the sample original images generated by the defect detection device to determine the first score of the target detection model performance trained at different compression ratios.
[0068] The first score of the target detection model performance may be calculated by obtaining one or more performance parameters. The performance parameters may include at least one of accuracy, recall, precision, and F1 score.
[0069] Among them, accuracy refers to the ratio of correctly classified samples to the total number of samples in the calculation results of the target detection model. Recall refers to the ratio of samples that the target detection model can correctly identify as positive to all actual positive samples. Precision refers to the ratio of samples predicted as positive by the target detection model to actually positive. F1 score is the harmonic mean of precision and recall.
[0070] The first score can be calculated by performing weighted calculation based on the predetermined weights corresponding to the various performance parameters.
[0071] In general, if the global image remains unchanged, the higher the compression ratio, the more difficult it is to detect defects. However, although the lower the compression ratio, the more obvious the defect features are, the better the performance of the trained target detection model is. However, the image data that the target detection model needs to calculate is very large, and the calculation efficiency of the target detection model will be greatly reduced, which is not conducive to improving the detection efficiency of flexible circuit boards. Therefore, the second score can be determined by the detection efficiency. The higher the second score, the higher the detection efficiency.
[0072] For example, commonly used compression ratios may include ratios such as 5:1, 10:1, 15:1, 20:1, 40:1, etc. The first score and the second score of the global image or the sample original image at different compression ratios can be calculated respectively, and the compression ratio with the highest score can be selected for model training and defect detection.
[0073] In S202, a compression ratio of the global image is determined according to the first score and the second score.
[0074] The weight coefficients corresponding to the first score and the second score can be set in advance. The total score can be calculated based on the first score, the second score and the corresponding weight coefficients. The compression ratio corresponding to the highest total score is selected, and the image can be compressed according to the compression ratio during defect detection.
[0075] In S103, a target compression area including defects in the compressed image is detected by using a pre-trained target detection model.
[0076] The pre-trained target detection model can detect the target compression area included in the compressed image. The target compression area can be an area including defects in the compressed image. The target compression area can be represented by a rectangular area, for example, the rectangular area can be represented by the coordinates of two vertices on the diagonal of the rectangle, usually the lower left corner vertex and the upper right corner vertex, for example, it can be represented as (x1, y1, x2, y2), (x1, y1) and (x2, y2) respectively represent the coordinates of the two vertices. In order to further improve the convenience of processing the target compression area, it can also be represented by the values of the vertex, length and width, so that the shape characteristics of the target compression area can be determined more quickly, and the convenience of target output can be improved. For example, the target compression area can be represented as (x, y, w, h), where (x, y) represents the coordinates of the vertex (usually the lower left corner vertex), w represents the width of the rectangle, and h represents the height of the rectangle.
[0077] In the embodiment of the present application, in order to obtain an accurate and reliable target detection model, it is necessary to train the target detection model. The specific process can be as follows: Figure 3 As shown, including:
[0078] In S301, a sample original image is acquired, where the sample original image includes a first calibrated area where defects are calibrated in advance.
[0079] In order to effectively train the target detection model, the embodiment of the present application can collect multiple global images as sample original images through an image acquisition device. The sample original image includes the area where the calibrated defect is located, that is, the first calibration area. The first calibration area can be a rectangular area, or it can also be an area of other shapes.
[0080] In S302, the sample original image is compressed according to a preset compression ratio to obtain a sample compressed image, and a second calibration region of the first calibration region in the sample compressed image is determined according to the compression ratio.
[0081] In the embodiment of the present application, when training the target detection model, different compression ratios can be selected in sequence for training calculations. The performance of the target detection model trained with different compression ratios and the efficiency of defect detection according to the compression ratios are used to determine the pros and cons of each compression ratio, thereby selecting the best compression ratio for calculation processing.
[0082] After the sample original image is compressed, the second calibration area in the sample compressed image, that is, the area where the defect is located in the compressed image, can be determined according to the compression ratio. The second calibration area can also be a rectangular area or an area of other shapes.
[0083] For example, a vertex of the first calibration area is (a, b), and the compression ratio is 10 to 1, then the coordinates of the vertex of the second calibration area can be expressed as: (|a / 10|, |b / 10|).
[0084] In S303, the sample compressed image is calculated by the target detection model, and the parameters of the target detection model are adjusted according to the first difference between the second calibration area and the target detection area output by the target detection model until the first difference meets the preset requirements, thereby obtaining a trained target detection model.
[0085] After compression processing, the size of the compressed image (sample compressed image) that needs to be calculated is usually much smaller than the size of the global image (sample original image), which can greatly improve the efficiency of the detection calculation of the target detection model.
[0086] The target detection model detects and outputs the target detection area, compares the target detection area with the second calibration area, and determines the first difference. The first difference can be represented by the size of the overlap rate between the target detection area and the second calibration area. The larger the overlap rate, the smaller the first difference. When the first difference overlap rate reaches a certain requirement, it can be considered that the target detection model has been trained. The performance of the trained target detection model can be evaluated through the detection samples in the sample original image, and the first score of the target detection model is determined based on the evaluated performance.
[0087] In S104, mapping processing is performed in combination with the target compressed area according to the compression ratio of the compression processing to determine the target original area corresponding to the target compressed area in the global image.
[0088] After efficiently detecting the target compressed area including defects in the compression input error, the target compressed area can be mapped according to the compression ratio to determine the target original area corresponding to the target compressed area in the global image.
[0089] For example, the target compression area can be a rectangular area determined by two vertices. When mapping the rectangular area to the global image, the coordinates of each vertex can be multiplied by the compression ratio to obtain the vertex coordinates of the target compression area in the global image. For example, the two vertices of the target compression area in the compressed image are (x1, y1, x2, y2), and the compression ratio is 10 to 1. Then the two vertices of the target original area in the global image are (10*x1, 10*y1, 10*x2, 10*y2). Alternatively, when the target compression area is represented by vertices, length and width, the target original area in the global image can be determined according to the same mapping method.
[0090] In a possible implementation, in order to reduce the probability of missing defective areas, when determining the target original area based on the target compressed area, a predetermined number of pixels (eg, 20 pixels) may be expanded outward to facilitate more comprehensive defect detection.
[0091] In S105, defect recognition processing is performed according to the target original area to obtain a defect detection result of the flexible circuit board.
[0092] In the embodiment of the present application, when defect recognition processing is performed on the target original area, it may include defect classification processing on the target original area, or it may also include defect segmentation processing and defect classification processing.
[0093] When performing target segmentation processing on the target original area, the target segmentation model can be used to calculate the target detection area included in the target original area. The area where the defect is located is obtained by segmentation to improve the defect classification efficiency.
[0094] When training the target segmentation model, the target detection area with the pre-calibrated defect calibration contour can be calculated by the target segmentation model to obtain the calculated defect segmentation contour. According to the difference between the defect calibration contour and the defect segmentation model, the parameters of the target segmentation model are adjusted so that the target segmentation model can output a more accurate defect segmentation contour.
[0095] Among them, the defect segmentation contour can be used to segment the defect through the segmentation contour to obtain a more effective defect image.
[0096] In a possible implementation, the target segmentation model can be trained in combination with the target detection model to improve the accuracy of the target segmentation model. The training process can be as follows: Figure 4 As shown, including:
[0097] In S401, a sample original image is acquired, where the sample original image includes a defect calibration contour for pre-calibrating defects.
[0098] The sample original image may be a global image. To train the segmentation model, the contour of the defect included in the sample original image may be pre-calibrated, and the defect calibration contour may be obtained by calibrating the defect.
[0099] In S402, the sample original image is compressed according to a preset compression ratio to obtain a sample compressed image.
[0100] Through the performance and detection efficiency of the target detection model, it can be determined that the target detection model has better performance and the detection efficiency can also be effectively improved by the compression ratio, and the sample original image is compressed to obtain a sample compressed image.
[0101] In S403, the target detection area in the sample compressed image is determined by using the trained target detection model.
[0102] According to the pre-trained target detection model, the target detection area included in the compressed image can be detected. When the target detection area is a rectangle, the target detection area can be represented by two vertices, or by vertices, length and width, and the target detection area can be determined more intuitively.
[0103] In S404, the defect original area corresponding to the target detection area in the sample original image is determined according to the target detection area and the compression ratio.
[0104] Based on the target detection area and the compression ratio, the area of the target detection area in the sample original image, that is, the defect original area, can be obtained.
[0105] For example, the original defect area in the original image of the sample can be obtained by mapping the compression ratio, such as multiplying the coordinates or size of the target detection area by the compression ratio.
[0106] In order to more reliably determine the area where the defect is located in the sample original image, the defect original area can be expanded, such as expanding outward by a predetermined number of pixels to obtain an expanded defect original area, which is conducive to more comprehensive detection of defect information.
[0107] In S405, the original defect area is calculated by the target segmentation model, and the parameters of the target segmentation model are adjusted according to the second difference between the defect calibrated contour and the defect segmentation contour output by the target segmentation model until the second difference meets the predetermined requirements, thereby obtaining a trained target segmentation model.
[0108] When training the target segmentation model, the embodiment of the present application uses the target detection area output by the target classification model, and then determines the defect original area corresponding to the target detection area through mapping. Based on the defect original area, segmentation calculation is performed through the target segmentation model, and the defect segmentation contour obtained by segmentation is compared with the pre-calibrated defect calibration contour to obtain a second difference. The target segmentation model is adjusted according to the second difference until the second difference meets the predetermined requirements, and the overlap rate of the proportional defect segmentation contour and the defect calibration contour reaches a predetermined ratio, then the target segmentation model can be considered to have completed training. Since the size of the sample original image is different from the size of the defect original area input by the target segmentation model, for example, the sample original image exceeds 16000*16000, and the defect original area is usually less than 2048*2048, therefore, the target segmentation model is trained based on the target detection area output by the target detection model after mapping, which can effectively improve the accuracy of the association calculation between the target segmentation model and the target detection model.
[0109] In a possible implementation, by Figure 4 After the method shown completes the training of the target segmentation model, the target classification model can also be used to calculate the defect segmentation contour obtained by the trained target segmentation model to obtain the defect classification, and the pre-calibrated defect type calibration information is compared to determine the third difference. The parameters of the target classification model are adjusted according to the third difference until the third difference meets the predetermined requirements. Classification processing through the classification model can effectively remove the influence of environmental interference and defect false point interference, and reduce system over-inspection. Direct training with the output results of the target detection model and the target segmentation model is conducive to improving the accuracy of the target segmentation model, and is conducive to accurately classifying defects based on the output results of the target detection model and the target segmentation model according to the trained target classification model.
[0110] It should be understood that the size of the serial numbers of the steps in the above embodiments does not 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 embodiments of the present application.
[0111] Figure 5 A defect detection device for a flexible circuit board provided in an embodiment of the present application includes:
[0112] The global image acquisition unit 501 is used to acquire the global image of the flexible circuit board.
[0113] The compression unit 502 is used to compress the global image to obtain a compressed image.
[0114] The target compression region detection unit 503 is used to detect the target compression region including defects in the compressed image by using a pre-trained target detection model.
[0115] The target original region determining unit 504 is used to perform mapping processing in combination with the target compressed region according to the compression ratio of the compression processing, and determine the target original region corresponding to the target compressed region in the global image.
[0116] The defect detection result identification unit 505 is used to perform defect identification processing according to the target original area to obtain a defect detection result of the flexible circuit board.
[0117] Figure 5 The defect detection device of the flexible circuit board shown in FIG. Figure 1 The defect detection method of the flexible circuit board shown corresponds to the above.
[0118] Figure 6 Schematic diagram of a defect detection device for a flexible circuit board provided in one embodiment of the present application. Figure 6 As shown, the defect detection device 6 for a flexible circuit board of this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a defect detection program for a flexible circuit board. When the processor 60 executes the computer program 62, the steps in the above-mentioned flexible circuit board defect detection method embodiments are implemented. Alternatively, when the processor 60 executes the computer program 62, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0119] Exemplarily, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 62 in the defect detection device 6 for the flexible circuit board. For example, the computer program 62 may be divided into:
[0120] The flexible circuit board defect detection device 6 can be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The flexible circuit board defect detection device can include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art can understand that Figure 6It is only an example of the defect detection device 6 for a flexible circuit board and does not constitute a limitation of the defect detection device 6 for a flexible circuit board. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the defect detection device for a flexible circuit board may also include input and output devices, network access devices, buses, etc.
[0121] The processor 60 may be a central processing unit (CPU), or 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.
[0122] The memory 61 may be an internal storage unit of the defect detection device 6 for a flexible circuit board, such as a hard disk or memory of the defect detection device 6 for a flexible circuit board. The memory 61 may also be an external storage device of the defect detection device 6 for a flexible circuit board, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the defect detection device 6 for a flexible circuit board. Further, the memory 61 may also include both an internal storage unit and an external storage device of the defect detection device 6 for a flexible circuit board. The memory 61 is used to store the computer program and other programs and data required by the defect detection device for a flexible circuit board. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0123] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0124] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0125] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0126] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0127] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0128] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0129] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. 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. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. 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 embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person 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 application, and should all be included in the protection scope of the present application.
Claims
1. A defect detection method for a flexible circuit board, It is characterized in that The method comprises: Acquiring a global image of the flexible circuit board; Compressing the global image to obtain a compressed image; Detecting a target compression area including defects in the compressed image by using a pre-trained target detection model; According to the compression ratio of the compression processing, mapping processing is performed in combination with the target compression area to determine the target original area corresponding to the target compression area in the global image; Performing defect recognition processing according to the target original area to obtain a defect detection result of the flexible circuit board; Before detecting the target compressed area including defects in the compressed image by using the pre-trained target detection model, the method further includes: Acquire a sample original image, wherein the sample original image includes a first calibration area where defects are pre-calibrated; Compressing the sample original image according to a preset compression ratio to obtain a sample compressed image, and determining a second calibration area of the first calibration area in the sample compressed image according to the compression ratio; Calculating the sample compressed image through the target detection model, and adjusting the parameters of the target detection model according to a first difference between the second calibration area and the target detection area output by the target detection model, until the first difference meets a preset requirement, thereby obtaining a trained target detection model; Before compressing the global image to obtain a compressed image, the method further includes: Obtaining a first score of the target detection model performance trained with different compression ratios, and obtaining a second score corresponding to the detection efficiency determined by the compression ratio; A compression ratio of the global image is determined according to the first score and the second score.
2. The method according to claim 1, It is characterized in that Obtaining a first score of the performance of the target detection model trained with different compression ratios, including: Obtaining performance parameters of the target detection model trained with different compression ratios, the performance parameters comprising at least one of accuracy, recall, precision, and F1 score; A first score of the performance of the target detection model trained with the different compression ratios is determined according to the performance parameter and the weight coefficient corresponding to the performance parameter.
3. The method according to claim 1, It is characterized in that Performing defect recognition processing according to the target original area to obtain a defect detection result of the flexible circuit board includes: By using a pre-trained target segmentation model, segmenting the target original area to obtain defect segmentation information; The defect segmentation information is classified by a pre-trained classification model to obtain the defect type of the target original area.
4. The method according to claim 3, It is characterized in that Before obtaining defect segmentation information in the target original area by segmenting the target segmentation model completed in advance, the method further includes: Acquire a sample original image, wherein the sample original image includes a defect calibration contour for pre-calibrating defects; Compressing the sample original image according to a preset compression ratio to obtain a sample compressed image; Determine the target detection area in the sample compressed image by using the trained target detection model; Determine, according to the target detection area and the compression ratio, a defect original area corresponding to the target detection area in the sample original image; The original defect area is calculated by the target segmentation model, and the parameters of the target segmentation model are adjusted according to the second difference between the defect calibration contour and the defect segmentation contour output by the target segmentation model until the second difference meets the predetermined requirements, thereby obtaining a trained target segmentation model.
5. The method according to claim 4, It is characterized in that The sample original image also includes pre-calibrated defect type calibration information; After obtaining the trained target segmentation model, the method further includes: The defect segmentation information output by the target segmentation model is calculated through the target classification model, and the parameters of the target classification model are adjusted according to the third difference between the defect type calibration information and the defect classification output by the target classification model until the third difference meets the preset requirements, thereby obtaining a trained target classification model.
6. A defect detection device for a flexible circuit board, It is characterized in that The device comprises: A global image acquisition unit, used to acquire a global image of the flexible circuit board; A compression unit, used for compressing the global image to obtain a compressed image; A target compression region detection unit, configured to detect a target compression region including defects in the compressed image by using a pre-trained target detection model; a target original region determining unit, configured to perform mapping processing in combination with the target compressed region according to the compression ratio of the compression processing, and determine the target original region corresponding to the target compressed region in the global image; A defect detection result recognition unit, used to perform defect recognition processing according to the target original area to obtain a defect detection result of the flexible circuit board; Before detecting the target compressed area including defects in the compressed image by the pre-trained target detection model, the method further includes: obtaining a sample original image, wherein the sample original image includes a first calibrated area for pre-calibrating defects; compressing the sample original image according to a preset compression ratio to obtain a sample compressed image, and determining a second calibrated area of the first calibrated area in the sample compressed image according to the compression ratio; calculating the sample compressed image by the target detection model, and adjusting the parameters of the target detection model according to a first difference between the second calibrated area and the target detection area output by the target detection model, until the first difference meets the preset requirements, thereby obtaining a trained target detection model; Before compressing the global image to obtain a compressed image, the method further includes: Obtain a first score of the target detection model performance trained with different compression ratios, and obtain a second score corresponding to the detection efficiency determined by the compression ratio; and determine the compression ratio of the global image based on the first score and the second score.
7. A defect detection device for a flexible circuit board, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Defect detection method, related device, equipment and storage medium
CN112001902A
