Test method and system of image detection algorithm, computer equipment and storage medium
By automating the testing of image detection algorithms through Shell and Python scripts, the problems of low efficiency and large errors in traditional testing methods are solved, efficient and reliable wafer defect detection is achieved, and rapid algorithm iteration and environmental adaptability are supported.
Patent Information
- Application Number
- CN202510947716.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-09-30
AI Technical Summary
Existing image detection algorithms have accuracy, reliability and stability issues in wafer defect detection. Traditional testing methods are inefficient and susceptible to human errors, making it difficult to meet the needs of rapid iteration and updates.
Use Shell scripts to compile image detection algorithms into binary programs, dynamically generate configuration files, and verify detection results through Python scripts. Establish an automated testing system, use standard defect coordinates and preset radius threshold matching areas to identify valid defects and noise, generate performance evaluation reports, and support multi-threaded parallel detection and automated report generation.
It improves test efficiency and accuracy, ensures the reliability and flexibility of detection, can timely discover the advantages and disadvantages of algorithms, improves detection efficiency and data integrity, and provides automated report feedback.
Smart Images

Figure CN120723653A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image detection technology, and in particular to a testing method, system, computer equipment and storage medium for an image detection algorithm. Background Art
[0002] With the continuous advancement of semiconductor manufacturing technology, quality control in wafer production has become increasingly important. During the production process, defects such as dust and scratches often appear on the wafer surface. These problems can not only lead to a decline in the performance of the final product, but in severe cases, even affect the product's service life. Therefore, timely detection and elimination of these surface defects is crucial to improving wafer yield.
[0003] However, the application of image detection algorithms in wafer defect detection currently faces several challenges, particularly in terms of accuracy, reliability, and stability. These issues stem primarily from the image recognition algorithm's accuracy, stability, and adaptability to diverse production environments. Therefore, rigorous testing of image detection algorithms is essential to ensure their reliability. However, traditional manual testing methods are inefficient and labor-intensive. Manual operations are also susceptible to subjective judgment errors and fatigue, making them incapable of meeting the demands for rapid iteration and updates of image detection algorithms. Summary of the Invention In order to solve the technical problem that existing testing methods are difficult to meet the testing requirements of rapid iteration and update of image detection algorithms, the present invention provides a testing method, system, computer equipment and storage medium for an image detection algorithm.
[0004] The solution to the technical problem of the present invention is to provide a testing method for an image detection algorithm, comprising the following steps: Obtain the current image detection algorithm, the image sample to be tested, and the standard defect data file with standard results; Compiling the current image detection algorithm into a binary image detection program through a Shell script, and dynamically generating and configuring a configuration file required by the binary image detection program; Controlling the binary image detection program and associating it with a configuration file, performing defect detection on the image sample to be tested, and outputting a detection result including the coordinates of the detected defects; The detection results are verified using the standard defect data file through a Python program, and a performance evaluation report based on the current image detection algorithm is output and saved in a database.
[0005] Preferably, verifying the detection result using the standard defect data file comprises the following steps: The standard defect data file includes standard defect coordinates, a preset radius threshold is set for each standard defect coordinate, and a matching area is established with the standard defect coordinate as the center and the preset radius threshold; Matching the detected defect coordinates with the matching area; if the detected defect coordinates fall within the matching area, the detected defect is determined to be a valid defect; if the detected defect coordinates do not fall within any matching area, the detected defect is determined to be noise; The output performance evaluation report at least includes the number of effective defects and the number of noises.
[0006] Preferably, the method further includes the following steps: obtaining a performance evaluation report of a previous version of the image detection algorithm from a database, and comparing the performance evaluation report of the current image detection algorithm with the performance evaluation report of the previous version of the image detection algorithm; A new defect list and a disappeared defect list are set. The new defect list is used to record new valid defects, and the disappeared defect list is used to record disappeared valid defects. If the new defect list is not empty, it is determined that the current image detection algorithm is effectively iterated. If the disappeared defect list is not empty, it is determined that the current image detection algorithm introduces a new program error.
[0007] Preferably, dynamically generating and configuring the configuration file required by the binary image detection program includes the following steps: Dynamically generate a JSON configuration file of scan channel configuration parameters, wherein the scan channel configuration parameters are used to control the startup state of each scan channel; The XML algorithm parameter file is dynamically adjusted through a Python script, and the XML algorithm parameter file is used to configure the optical parameters required for different image samples to be tested.
[0008] Preferably, the JSON configuration file further defines a thread number parameter, and the thread number parameter is used to implement multi-threaded parallel defect detection on the image sample to be tested.
[0009] Preferably, the test result includes a structured defect list and a binary result file, and the test method further includes: Parsing the binary result file to generate a readable defect attribute table; The original defect record in the structured defect list is directly read, and a consistency check is performed between the defect attribute table and the original defect record.
[0010] Preferably, the method further comprises the following steps: Convert the performance evaluation report into a test report in HTML format, and send the test report to a designated mailbox; The test report includes at least task status, execution time, number of valid defects, total number of defects, capture rate, and noise quantity.
[0011] To solve the above technical problems, the present invention provides another technical solution as follows: a testing system for an image detection algorithm, for executing the above-mentioned testing method for an image detection algorithm, comprising a data acquisition module: for acquiring a current image detection algorithm, an image sample to be tested, and a standard defect data file with standard results; Compilation module: used to compile the current image detection algorithm into a binary image detection program through a Shell script; Dynamic configuration generation module: used to dynamically generate and configure the configuration file required by the binary image detection program; Parsing and execution module: used to control the binary image detection program and associate its configuration file to perform defect detection on the image sample to be tested, and output the detection result; Verification module: Use the standard defect data file to verify the detection results through the Python program, output a performance evaluation report based on the current image detection algorithm and save it to the database.
[0012] In order to solve the above technical problems, the present invention provides another technical solution as follows: a computer device includes a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the above-mentioned image detection algorithm testing method.
[0013] In order to solve the above technical problem, the present invention provides another technical solution as follows: when the computer program is executed by a processor, the test method of the above image detection algorithm is implemented.
[0014] Compared with the prior art, the image detection algorithm testing method, system, computer device, and storage medium provided by the present invention have the following beneficial effects: 1. The test method of the image detection algorithm of the present invention implements the algorithm compilation, configuration generation and detection execution process through Shell script, and verifies the detection results through Python script, constructing a complete and automated test system, which is different from the traditional manual or scattered test methods, avoiding errors caused by manual intervention, and improving test efficiency. This test method comprehensively uses Shell and Python, two languages with different characteristics. Shell scripts are good at low-level tasks such as system command operations and environment configuration, while Python scripts have advantages in running console program test cases and flexibly processing test logic. The two work together, give full play to their respective advantages, and can efficiently complete the test tasks of the image detection algorithm, ensuring that the image detection algorithm shows good performance in practical applications. In addition, by compiling the image detection algorithm into a binary program and dynamically generating the required configuration files, it can be ensured that it can automatically adapt to and perform defect detection according to the specific image sample to be tested under different environments. This flexibility enhances the versatility of the algorithm, allowing it to effectively respond to the detection needs of various image samples to be tested.
[0015] 2. The image detection algorithm testing method of the present invention verifies detection results by establishing a matching area based on standard defect coordinates and a preset radius threshold. This method accurately identifies valid defects and noise, ensuring detection reliability. Furthermore, the preset radius threshold can be adjusted to meet different needs to obtain the most realistic verification results.
[0016] 3. The image detection algorithm testing method of this invention can promptly identify the strengths and weaknesses of the algorithm during its iteration by comparing performance evaluation reports from different versions. The establishment of a list of newly added defects and a list of disappeared defects can effectively track algorithm improvements, ensuring that each update improves performance and helping to identify potential program errors.
[0017] 4. The testing method of the image detection algorithm of the present invention dynamically generates a scanning channel configuration file and adjusts the XML algorithm parameter file, so that the system can automatically adjust according to different detection requirements, has better flexibility and adaptability, avoids the complexity of manual configuration adjustment, and improves the automation level of the testing process.
[0018] 5. The testing method of the image detection algorithm of the present invention realizes multi-threaded parallel defect detection by setting the thread number parameter, which can significantly improve the detection efficiency. Especially when processing large-scale image samples to be tested, the parallel operation can better utilize environmental resources and shorten the processing time.
[0019] 6. The testing method of the image detection algorithm of the present invention generates a defect attribute table by parsing the binary result file and performs consistency check between the defect attribute table and the original defect record, thereby ensuring the integrity and accuracy of the data.
[0020] 7. The testing method of the image detection algorithm of the present invention generates a test report in HTML format and sends it via email, which can conveniently perform automated report generation and distribution, ensuring that relevant personnel can timely understand the performance of the image detection algorithm and comprehensively evaluate the performance of the algorithm.
[0021] 8. The present invention also provides a testing system for an image detection algorithm, which has the same beneficial effects as the above-mentioned testing method for an image detection algorithm, and will not be described in detail here.
[0022] 9. An embodiment of the present invention further provides a computer device having the same beneficial effects as the above-mentioned testing method of an image detection algorithm, which will not be described in detail here.
[0023] 10. An embodiment of the present invention further provides a computer-readable storage medium, which has the same beneficial effects as the above-mentioned testing method of an image detection algorithm, and is not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1 It is a flow chart of steps S1 to S4 of the testing method provided in the first embodiment of the present invention.
[0026] Figure 2 It is a flow chart of steps S41 to S42 of the testing method provided in the first embodiment of the present invention.
[0027] Figure 3 This is a flowchart of the test method provided by the first embodiment of the present invention with steps S5 to S6 added.
[0028] Figure 4 It is a flow chart of steps S21 to S22 of the testing method provided in the first embodiment of the present invention.
[0029] Figure 5 It is a flow chart of steps S31 to S32 of the testing method provided in the first embodiment of the present invention.
[0030] Figure 6 This is a flowchart of the test method provided by the first embodiment of the present invention with step S7 added.
[0031] Figure 7 This is a schematic diagram of the framework of the test system provided by the second embodiment of the present invention. Figure 1 .
[0032] Figure 8 This is a schematic diagram of the framework of the test system provided by the second embodiment of the present invention. Figure 2 .
[0033] Figure 9 It is a schematic diagram of the framework of a computer device provided by the third embodiment of the present invention.
[0034] Figure 10 It is a schematic diagram of the framework of the storage medium provided by the fourth embodiment of the present invention.
[0035] Description of the accompanying drawings: 1. Test system; 2. Computer equipment; 3. Storage media; 10. Data acquisition module; 11. Compilation module; 12. Dynamic configuration generation module; 13. Parsing and execution module; 14. Verification module; 15. Comparison module; 16. Determination module; 20. Memory; 21. Processor; 22. Computer program; 30. Computer program. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0037] The terms “vertical,” “horizontal,” “left,” “right,” “up,” “down,” “upper left,” “upper right,” “lower left,” “lower right,” and similar expressions used herein are for illustrative purposes only.
[0038] It should be noted that current wafer defect inspection equipment primarily utilizes two technical approaches: electron beam scanning and high-precision camera scanning. Electron beam scanning identifies defects by utilizing signal differences generated by the interaction of a high-energy electron beam with the wafer surface. High-precision camera scanning, on the other hand, acquires images of the wafer surface and analyzes and processes them using image detection algorithms to detect and track defects. Both technical approaches rely on the accuracy of image detection algorithms to ensure effective defect detection. See also Figure 1 A first embodiment of the present invention provides a method for testing an image detection algorithm, comprising the following steps: Step S1: Obtain the current image detection algorithm, the image sample to be tested, and the standard defect data file with standard results; Step S2: compile the current image detection algorithm into a binary image detection program through a Shell script, and dynamically generate and configure the configuration file required by the binary image detection program; Step S3: controlling the binary image detection program and associating its configuration file to perform defect detection on the image sample to be tested, and outputting a detection result including the coordinates of the detected defects; Step S4: Use the Python program to verify the detection results using the standard defect data file, output a performance evaluation report based on the current image detection algorithm, and save it to the database.
[0039] As can be understood, in step S1, there are multiple image samples to be tested, each of which is an image obtained by scanning a complete wafer. Each image sample to be tested is associated with a corresponding standard defect data file. This standard defect data file contains standard defect and noise data pre-detected in the image sample to be tested, such as defect location, size, and type. Both the image samples to be tested and the standard defect data files are stored in a database and automatically loaded when testing begins.
[0040] It is understandable that when selecting image samples to be tested, it should be ensured that different types of wafers, different defect types, different noise levels, etc. are covered to ensure that the accuracy and reliability of the current image detection algorithm can be fully tested.
[0041] As a specific example, the standard defect data file refers to a klarf file.
[0042] It is understandable that in step S2, the current image detection algorithm is compiled into a binary image detection program, which can efficiently process a large number of image samples to be tested, and is more convenient to deploy without relying on the development environment. Shell scripts can achieve a flexible, automated and efficient compilation process by integrating various compilation tools, which can greatly improve the repeatability and cross-platform nature of the compilation process. Shell scripts can also flexibly adjust the generated configuration file content according to the different requirements of the current image detection algorithm and different image samples to be tested, further reducing the errors and time consumption of manual configuration.
[0043] Optionally, the algo_build function of the shell script compiles the current image detection algorithm into a binary image detection program. This compilation can be accomplished internally using the CMake tool and its compilation options. The config_output function of the shell script automatically generates or modifies the configuration files required by the binary image detection program. These configuration files include XML and JSON configuration files.
[0044] Optionally, in step S3, the algo_test function of the Shell script can be used to launch a binary image detection program to analyze and detect defects in the image sample to be tested. The detection result is a cvs file.
[0045] As can be understood, in step S4, the Python program verifies the detection results using a standard defect data file, automatically determining the correctness of the current image detection algorithm's detection results and ensuring their accuracy. Outputting a performance evaluation report based on the current image detection algorithm provides a clear and intuitive understanding of its performance, avoiding the tedious and error-prone manual judgment. Storing the performance report in a database creates a versioned historical record, providing effective data support for image detection algorithm iteration.
[0046] Optionally, the Python program implements the verification process based on the subprocess module.
[0047] Understandably, in order to meet the ever-increasing demand for wafer defect detection, image detection algorithms are continuously developed and iterated. The test methods of steps S1 to S4 comprehensively use two languages with different characteristics, Shell and Python, to implement algorithm compilation, configuration generation and detection execution processes through Shell scripts, and to verify the detection results through Python scripts, thus building a complete and automated test system. This system is different from traditional manual or scattered testing methods, avoids errors caused by human intervention, and improves test efficiency.
[0048] Understandably, Shell scripts excel at low-level tasks such as operating system commands and configuring the environment, while Python scripts excel at running console program test cases and flexibly handling test logic. Working together, the two can fully leverage their respective strengths to efficiently complete the image detection algorithm's testing tasks, ensuring that the image detection algorithm demonstrates good performance in practical applications. Furthermore, by compiling the image detection algorithm into a binary program and dynamically generating the required configuration files, it is possible to automatically adapt and execute defect detection based on the specific image samples under test in different environments. This flexibility enhances the algorithm's versatility, enabling it to effectively address the detection needs of a variety of image samples under test.
[0049] Please see further Figure 2 In step S4, the test results are verified using the standard defect data file, including the following steps: Step S41: The standard defect data file includes standard defect coordinates, a preset radius threshold is set for each standard defect coordinate, and a matching area is established with the standard defect coordinate as the center and the preset radius threshold; Step S42: Match the detected defect coordinates with the matching area. If the detected defect coordinates fall within the matching area, the detected defect is determined to be a valid defect. If the detected defect coordinates do not fall within any matching area, the detected defect is determined to be noise.
[0050] It can be understood that in steps S41 to S42, the detection results are verified by the matching area established by the standard defect coordinates and the preset radius threshold, and the traditional subjective defect judgment is converted into objective spatial matching, which can accurately identify effective defects and noise and ensure detection reliability.
[0051] It can be understood that the larger the preset radius threshold, the more defects are judged as valid defects, but it is easy to cause false alarms. When the preset radius threshold is too large, some noise will be detected as valid defects; on the contrary, the smaller the preset radius threshold, the coordinate deviation will be generated when the camera shoots the image sample to be tested, which will cause the detection results to not match the standard defect data file, resulting in too few valid defects.
[0052] In this embodiment, the preset radius threshold is adjustable. Different standard defects may correspond to different preset radius thresholds. In different testing processes, the preset radius threshold may also be adjusted according to different requirements to obtain the most realistic verification results.
[0053] For example, a standard defect coordinate is (100, 100) and the preset threshold radius is set to 2. Then the matching area is a circular area with (100, 100) as the center and a radius of 2. The detected defect coordinates in the test results are matched with the matching area one by one for verification. If the detected defect coordinates fall within the matching area, the detected defect is considered a valid defect. If the detected defect coordinates do not fall into any matching area, the detected defect is considered noise.
[0054] It can be understood that the unit of the preset radius threshold should be consistent with the unit of the defect coordinates. Optionally, the unit can be pixel, mm, μm, etc.
[0055] Optionally, during the verification process, if the detected defect coordinates fall within one of the matching regions, the defect corresponding to the detected defect coordinates can be determined as a valid defect. Alternatively, during the verification process, a matching priority can be further set. If a detected defect coordinate falls within multiple matching regions, the matching priority is used to determine which standard defect the defect corresponding to the detected defect coordinate corresponds to.
[0056] Furthermore, the output performance evaluation report includes at least the number of effective defects and the number of noises, so as to intuitively determine whether the current image detection algorithm is an effective iteration.
[0057] Further reading Figure 3 , the testing method of the image detection algorithm also includes the following steps: Step S5: Obtaining a performance evaluation report of a previous version of the image detection algorithm from the database, and comparing the performance evaluation report of the current image detection algorithm with the performance evaluation report of the previous version of the image detection algorithm; Step S6: Set a new defect list and a disappeared defect list. The new defect list is used to record new valid defects, and the disappeared defect list is used to record disappeared valid defects. If the new defect list is not empty, it is determined that the current image detection algorithm is effectively iterated. If the disappeared defect list is not empty, it is determined that the current image detection algorithm introduces a new program error.
[0058] It is understood that if the current performance evaluation report is compared with the previous version of the performance evaluation report and a valid defect is detected that was not detected in the previous version, then the defect is considered a new valid defect and the data of the valid defect is stored in the new defect list. If a valid defect was detected in the previous version but not in the current version, then the valid defect is considered a disappeared valid defect and the data of the valid defect is stored in the disappeared defect list.
[0059] It is understandable that step S6 may also be replaced by other logical determination criteria.
[0060] Exemplarily, step S6 can be replaced as follows: if the number of defects in the current performance evaluation report decreases compared with the performance evaluation report of the previous version, the quality of the current image detection algorithm deteriorates; if the number of defects increases, further determine whether the amount of noise decreases. If it increases, the quality of the current image detection algorithm deteriorates; if it decreases, the current image detection algorithm is effectively iterated.
[0061] Understandably, steps S5 and S6 establish a database-based algorithm iteration evaluation system. By automatically comparing performance evaluation reports from different versions, it is possible to promptly detect whether the number of effective defects increases or decreases during the algorithm iteration process, thereby determining whether the current image algorithm is effectively iterating forward. This provides a quantitative and objective evaluation standard for algorithm iterative optimization. The addition of a defect list and a disappeared defect list effectively tracks algorithm improvements, ensuring that each update improves performance and helps identify potential program errors.
[0062] Please see further Figure 4 In step S2, the configuration file required by the binary image detection program is dynamically generated and configured, including the following steps: Step S21: Dynamically generate a JSON configuration file of scan channel configuration parameters, where the scan channel configuration parameters are used to control the startup state of each scan channel; Step S22: Dynamically adjust the XML algorithm parameter file through the Python script. The XML algorithm parameter file is used to configure the optical parameters required by different image samples to be tested.
[0063] Understandably, when performing wafer surface defect detection, multiple scanning channels are required to collect different optical information of the same wafer area, such as brightness, polarization, etc. During the testing process, different defect types require different scanning channel combinations.
[0064] In step S21, a JSON configuration file containing scan channel configuration parameters is dynamically generated to control the activation status of each scan channel. The system automatically activates the required scan channel combination based on the defect type and disables ineffective scan channels, reducing computational complexity. This avoids missed detections due to ignoring a scan channel, or over-detection due to activating all channels, which can occur with traditional fixed-scan channel testing.
[0065] For example, the same wafer area is scanned by three scanning channels TDI1, TDI2, and TDI3, but defect signals of different physical characteristics are captured respectively. When dust-type defects need to be detected, scanning channels TDI1 and TDI2 are automatically turned on according to the JSON configuration file, and TDI3 is turned off. When scratch-type defects need to be detected, scanning channels TDI1 and TDI3 are automatically turned on according to the JSON configuration file, and TDI2 is turned off.
[0066] Understandably, in step S22, the XML algorithm parameter file is used to configure the optical parameters required for different image samples to be tested, such as exposure time and light source intensity. The Python script can dynamically adjust these optical parameters based on the different types of image samples to be tested, automatically adjusting to the optimal parameter configuration, reducing errors and improving accuracy and detection efficiency.
[0067] It can be understood that dynamically generating and configuring the configuration files required by the binary image detection program can automatically adjust according to different detection requirements, has better flexibility and adaptability, avoids the complexity of manual configuration adjustment, and improves the automation level of the test process.
[0068] Furthermore, the JSON configuration file defines a parameter for the number of threads, which is used to implement multi-threaded, parallel defect detection on the image samples under test. This significantly improves detection efficiency, especially when processing large numbers of image samples. Parallel operations can better utilize environmental resources and shorten processing time.
[0069] Optionally, in this embodiment, the JSON configuration file may be automatically configured by the JQ tool, and the binary image detection program is run in conjunction with the generated JSON configuration file.
[0070] Please continue reading Figure 5 The test results include a structured defect list and a binary result file. When outputting the test results in step S3, the following steps are also included: Step S31: Parse the binary result file to generate a readable defect attribute table; Step S32: directly read the original defect record in the structured defect list, and perform consistency check on the defect attribute table and the original defect record.
[0071] Understandably, the structured defect list is the raw output file, which can be directly read. The binary result file is a binary file containing all text information and the image sample information to be tested. Performing a consistency check on the data in both ensures the consistency between the defect attribute table obtained after parsing and the original defect record, avoiding deviations caused by data formatting or parsing errors, thereby improving data accuracy and ensuring the reliability of subsequent testing processes.
[0072] Optionally, the structured defect list is an original CSV file, the binary result file is an APTK file, and a dedicated parser is used to parse the APTK file.
[0073] Please see further Figure 6 The testing method of the image detection algorithm of this embodiment further includes the following steps: Step S7: Convert the performance evaluation report into a test report in HTML format, and send the test report to a designated mailbox.
[0074] Understandably, after the current image detection algorithm test is completed, automated report generation and distribution can ensure that relevant personnel can understand the performance of the image detection algorithm in a timely manner and comprehensively evaluate the performance of the algorithm.
[0075] It is understandable that step S7 may also include the conclusions obtained in steps S5 to S6 on whether the current image detection algorithm is a valid iteration or whether a new program error is introduced into the test report, so as to facilitate users to obtain the test results more intuitively.
[0076] Furthermore, the test report includes at least task status, execution time, number of valid defects, total number of defects, capture rate, and noise quantity.
[0077] It can be understood that the task status refers to the current progress or status of the image detection task, which may include whether the test is completed, whether the test is successful, whether there are any anomalies or interruptions, etc. The task status can display the execution status of the algorithm and help determine whether the task has achieved the expected goals; the execution time refers to the time spent from the start to the end of the test, which is used to measure the efficiency and speed of the current image detection algorithm; the number of effective defects is used to intuitively display the number of defects successfully identified by the current image detection algorithm; the total number of defects refers to the number of defects pre-marked in the image sample to be tested; the capture rate refers to the ratio of the number of effective defects to the total number of defects, which is used to intuitively display the performance of the current image detection algorithm.
[0078] As can be understood, the testing method of this embodiment completes a complete closed-loop process, from testing the current image detection algorithm, to collecting, analyzing, and comparing performance evaluation reports, and finally providing feedback to users. This highly automated process enables rapid and accurate feedback of test and evaluation results to developers, helping to promptly identify issues with the current image detection algorithm, adjust development direction, and improve development iteration efficiency.
[0079] See also Figure 7 The second embodiment of the present invention provides a testing system 1 for an image detection algorithm, which is used to execute the above-mentioned testing method for the image detection algorithm, including: Data acquisition module 10: used to obtain the current image detection algorithm, the image sample to be tested, and the standard defect data file with standard results; Compilation module 11: used to compile the current image detection algorithm into a binary image detection program through a Shell script; Dynamic configuration generation module 12: used to dynamically generate and configure the configuration file required by the binary image detection program; Parsing and execution module 13: used to control the binary image detection program and associate its configuration file to perform defect detection on the image sample to be tested, and output the detection results; Verification module 14: Use the Python program to verify the detection results using the standard defect data file, output the performance evaluation report based on the current image detection algorithm and save it to the database.
[0080] Further, see Figure 8 , the test system 1 also includes Comparison module 15: used to obtain the previous version of the performance evaluation report from the database and compare the current performance evaluation report with the previous version of the performance evaluation report; Determination module 16: sets a new defect list and a disappeared defect list. If the new defect list is not empty, it is determined that the current image detection algorithm is effectively iterated; if the disappeared defect list is not empty, it is determined that the current image detection algorithm introduces a new program error.
[0081] It can be understood that the test system 1 provided in this embodiment includes all the beneficial effects of the above-mentioned test method, which will not be described in detail here.
[0082] See also Figure 9 The third embodiment of the present invention provides a computer device 2, including a memory 20, a processor 21 and a computer program 22 stored in the memory 20, and the processor 21 executes the computer program 22 to implement the above-mentioned image detection algorithm testing method.
[0083] It can be understood that the computer device 2 provided in this embodiment includes all the beneficial effects of the above-mentioned testing method, which will not be repeated here.
[0084] See also Figure 10 A fourth embodiment of the present invention provides a computer-readable storage medium 3 on which a computer program 30 is stored. When the computer program 30 is executed by a processor, the test method of the above-mentioned image detection algorithm is implemented.
[0085] It can be understood that the storage medium 3 provided in this embodiment includes all the beneficial effects of the above-mentioned testing method, which will not be described in detail here.
[0086] In the embodiments provided herein, it should be understood that "B corresponding to A" means that B is associated with A and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based solely on A; B can also be determined based on A and / or other information.
[0087] It should be understood that references to "one embodiment" or "an embodiment" throughout this specification mean that specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "in one embodiment" or "in an embodiment" appearing throughout this specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present invention.
[0088] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0089] The flow charts and block diagrams in the accompanying drawings of the present invention illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementation schemes, the functions marked in the box can also occur in a different order than those marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is determined based on the functions involved. It should be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0090] Compared with the prior art, the image detection algorithm testing method, system, computer device, and storage medium provided by the present invention have the following beneficial effects: 1. The test method of the image detection algorithm of the present invention implements the algorithm compilation, configuration generation and detection execution process through Shell script, and verifies the detection results through Python script, constructing a complete and automated test system, which is different from the traditional manual or scattered test methods, avoiding errors caused by manual intervention, and improving test efficiency. This test method comprehensively uses Shell and Python, two languages with different characteristics. Shell scripts are good at low-level tasks such as system command operations and environment configuration, while Python scripts have advantages in running console program test cases and flexibly processing test logic. The two work together, give full play to their respective advantages, and can efficiently complete the test tasks of the image detection algorithm, ensuring that the image detection algorithm shows good performance in practical applications. In addition, by compiling the image detection algorithm into a binary program and dynamically generating the required configuration files, it can be ensured that it can automatically adapt to and perform defect detection according to the specific image sample to be tested under different environments. This flexibility enhances the versatility of the algorithm, allowing it to effectively respond to the detection needs of various image samples to be tested.
[0091] 2. The image detection algorithm testing method of the present invention verifies detection results by establishing a matching area based on standard defect coordinates and a preset radius threshold. This method accurately identifies valid defects and noise, ensuring detection reliability. Furthermore, the preset radius threshold can be adjusted to meet different needs to obtain the most realistic verification results.
[0092] 3. The image detection algorithm testing method of this invention can promptly identify the strengths and weaknesses of the algorithm during its iteration by comparing performance evaluation reports from different versions. The establishment of a list of newly added defects and a list of disappeared defects can effectively track algorithm improvements, ensuring that each update improves performance and helping to identify potential program errors.
[0093] 4. The testing method of the image detection algorithm of the present invention dynamically generates a scanning channel configuration file and adjusts the XML algorithm parameter file, so that the system can automatically adjust according to different detection requirements, has better flexibility and adaptability, avoids the complexity of manual configuration adjustment, and improves the automation level of the testing process.
[0094] 5. The testing method of the image detection algorithm of the present invention realizes multi-threaded parallel defect detection by setting the thread number parameter, which can significantly improve the detection efficiency. Especially when processing large-scale image samples to be tested, the parallel operation can better utilize environmental resources and shorten the processing time.
[0095] 6. The testing method of the image detection algorithm of the present invention generates a defect attribute table by parsing the binary result file and performs consistency check between the defect attribute table and the original defect record, thereby ensuring the integrity and accuracy of the data.
[0096] 7. The testing method of the image detection algorithm of the present invention generates a test report in HTML format and sends it via email, which can conveniently perform automated report generation and distribution, ensuring that relevant personnel can timely understand the performance of the image detection algorithm and comprehensively evaluate the performance of the algorithm.
[0097] 8. The present invention also provides a testing system for an image detection algorithm, which has the same beneficial effects as the above-mentioned testing method for an image detection algorithm, and will not be described in detail here.
[0098] 9. An embodiment of the present invention further provides a computer device having the same beneficial effects as the above-mentioned testing method of an image detection algorithm, which will not be described in detail here.
[0099] 10. An embodiment of the present invention further provides a computer-readable storage medium, which has the same beneficial effects as the above-mentioned testing method of an image detection algorithm, and is not described in detail here.
[0100] The above is a detailed introduction to the testing method, system, computer equipment and storage medium of an image detection algorithm disclosed in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention. Any modifications, equivalent replacements and improvements made within the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for testing an image detection algorithm, characterized in that: The following steps are involved: Obtain the current image detection algorithm, the image sample to be tested, and the standard defect data file with standard results; Compiling the current image detection algorithm into a binary image detection program through a Shell script, and dynamically generating and configuring a configuration file required by the binary image detection program; Controlling the binary image detection program and associating it with a configuration file, performing defect detection on the image sample to be tested, and outputting a detection result including the coordinates of the detected defects; The detection results are verified using the standard defect data file through a Python program, and a performance evaluation report based on the current image detection algorithm is output and saved in a database.
2. The method for testing an image detection algorithm according to claim 1, wherein: Verifying the detection result using the standard defect data file includes the following steps: The standard defect data file includes standard defect coordinates, a preset radius threshold is set for each standard defect coordinate, and a matching area is established with the standard defect coordinate as the center and the preset radius threshold; Matching the detected defect coordinates with the matching area; if the detected defect coordinates fall within the matching area, the detected defect is determined to be a valid defect; if the detected defect coordinates do not fall within any matching area, the detected defect is determined to be noise; The output performance evaluation report at least includes the number of effective defects and the number of noises.
3. The method for testing an image detection algorithm according to claim 2, wherein: The following steps are also included: Obtain the performance evaluation report of the previous version of the image detection algorithm from the database, and compare the performance evaluation report of the current image detection algorithm with the performance evaluation report of the previous version of the image detection algorithm; A new defect list and a disappeared defect list are set. The new defect list is used to record new valid defects, and the disappeared defect list is used to record disappeared valid defects. If the new defect list is not empty, it is determined that the current image detection algorithm is effectively iterated. If the disappeared defect list is not empty, it is determined that the current image detection algorithm introduces a new program error.
4. The method for testing an image detection algorithm according to claim 1, wherein: Dynamically generating and configuring the configuration file required by the binary image detection program includes the following steps: Dynamically generate a JSON configuration file of scan channel configuration parameters, wherein the scan channel configuration parameters are used to control the startup state of each scan channel; The XML algorithm parameter file is dynamically adjusted through a Python script, and the XML algorithm parameter file is used to configure the optical parameters required for different image samples to be tested.
5. The method for testing an image detection algorithm according to claim 4, wherein: The JSON configuration file also defines a thread number parameter, which is used to implement multi-threaded parallel defect detection on the image sample to be tested.
6. The method for testing an image detection algorithm according to claim 1, wherein: The test results include a structured defect list and a binary result file. The test method further includes: Parsing the binary result file to generate a readable defect attribute table; The original defect record in the structured defect list is directly read, and a consistency check is performed between the defect attribute table and the original defect record.
7. The method for testing an image detection algorithm according to claim 1, wherein: The following steps are also included: Convert the performance evaluation report into a test report in HTML format, and send the test report to a designated mailbox; The test report includes at least task status, execution time, number of valid defects, total number of defects, capture rate, and noise quantity.
8. A testing system for an image detection algorithm, configured to execute the testing method for an image detection algorithm according to any one of claims 1 to 7, characterized in that: It includes a data acquisition module: used to obtain the current image detection algorithm, the image sample to be tested, and the standard defect data file with standard results; Compilation module: used to compile the current image detection algorithm into a binary image detection program through a Shell script; Dynamic configuration generation module: used to dynamically generate and configure the configuration file required by the binary image detection program; Parsing and execution module: used to control the binary image detection program and associate its configuration file to perform defect detection on the image sample to be tested, and output the detection result; Verification module: Use the standard defect data file to verify the detection results through the Python program, output a performance evaluation report based on the current image detection algorithm and save it to the database.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the testing method of the image detection algorithm according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for testing the image detection algorithm according to any one of claims 1 to 7 is implemented.