Deep learning-based industrial dicom image defect semi-automatic labeling system and method
By proposing a semi-automatic defect annotation method for industrial DICOM images based on deep learning, this method utilizes convolutional neural networks and Faster-RCNN models for iterative training and combines the KN algorithm to parse DICOM files. This solves the problems of time-consuming and laborious manual annotation and insufficient accuracy of deep learning algorithms, and achieves efficient defect detection and annotation.
Patent Information
- Application Number
- CN202310480377.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-04-28
AI Technical Summary
In existing technologies, manually annotating defects in industrial DICOM images is time-consuming, labor-intensive, and costly, and deep learning algorithms struggle to achieve high-precision automatic annotation of complex casting parts.
A semi-automatic annotation method for defects in industrial DICOM images based on deep learning is adopted. Convolutional neural networks are used for image feature extraction and defect detection, combined with Faster-RCNN model for iterative training and transfer learning, and KN algorithm is integrated for DICOM file parsing. The semi-automatic annotation is implemented on the PyQt5 interface.
It improves the accuracy and efficiency of defect detection, reduces labor costs, simplifies the image processing workflow, and enables efficient defect analysis and annotation.
Smart Images

Figure CN116485772B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a deep learning-based industrial DICOM image defect semi-automatic labeling system and method, and belongs to the technical field of industrial image processing. BACKGROUND
[0002] A DCM file is a file complying with a DICOM (DICOM: Digital Imaging and Communications in Medicine) standard. The DICOM standard supports devices such as electrocardiogram, nuclear magnetic resonance imaging, angioscope and echocardiogram, and thus DICOM images are widely used in the medical industry. However, a DCM file is a digital image and is not limited to the medical field. It is only a special image file and can be used to store various image information. The image quality and definition are high. Therefore, in the industrial casting field, casting part images exported by a DR device are often saved in the DICOM format.
[0003] DCMTK (DICOM TOOLKIT) is an open source project provided by OFFIS Company in Germany, which provides a platform for implementing the DICOM protocol. DCMTK provides possible versions developed under various operating system platforms, so that users can compile according to their own development platforms. At present, hospital information systems and industrial equipment DICOM image export systems are usually built on the Windows platform. However, DICOM format files cannot be recognized by common software on the Windows system. Therefore, it is of practical significance to develop a software for processing industrial DICOM images based on the Windows platform.
[0004] Meanwhile, in the fields of design, manufacturing and detection of casting parts, accurate labeling of defects of the parts is very important. The traditional labeling method usually needs manual operation, which is time-consuming and laborious, easy to make mistakes and requires certain professional requirements for the labeling personnel, and the labeling cost is high. With the development of deep learning technology, using deep neural networks to automatically label casting parts has become a popular research direction. However, for some complex casting parts, due to the variety of shapes and sizes, the types and sizes of defects are different, so it is still difficult for deep learning algorithms to achieve high-precision automatic labeling. SUMMARY
[0005] The present application is designed in view of the problems in the prior art that manual annotation of a data set is time-consuming, laborious, costly, and requires a certain level of expertise of the annotators, and the shapes and sizes of cast parts are various, the types and sizes of defects are also quite different, and deep learning algorithms are still difficult to achieve high-precision annotation for some complex cast parts.
[0006] In one aspect, the present application provides a deep learning-based semi-automatic annotation method for industrial DICOM image defects.
[0007] The method comprises:
[0008] Step 1: import the industrial DICOM image into the convolutional neural network to generate the convolutional neural network:
[0009] The convolutional neural network comprises a candidate region generation network and an object detection network.
[0010] The candidate region generation network is in the first part of the convolutional neural network and is responsible for generating candidate regions, is composed of a group of convolutional layers and pooling layers, and is used to extract features from the original image. In the candidate region generation network, each convolutional layer generates a candidate region, and these candidate regions are aggregated through the pooling layer to generate the final object candidate region. The input of the candidate region generation network is the original input image, and its output is a tensor, wherein each element represents a candidate region.
[0011] The object detection network is in the second part of the convolutional neural network and is responsible for object detection. The object detection network uses CNN layers to extract features from the candidate regions and uses a classifier and a regressor to classify and regress the objects. The feature extraction layer of the object detection network is composed of a group of convolutional layers, which are used to extract features in the image.
[0012] Step 2: complete model training based on the convolutional neural network generated in step 1, comprising:
[0013] Step 21: image preprocessing: after binarization, perform smoothing operation using Gaussian filtering method, calculate Gaussian kernel through two-dimensional Gaussian function,
[0014] The Gaussian filtering of the image needs a discrete template. After sampling and quantization processing of the continuous Gaussian distribution, a discrete template can be obtained, and the template needs to be normalized. The dimension of the discrete Gaussian convolution kernel is H:(2k+1)*(2k+1).
[0015] Step 22: use the annotation software LabelImg to perform defect annotation, divide the data set pictures into training set A1 and test set A2 according to the training set:test set 9:1, and further perform Mixup image enhancement on the training set A2 to obtain the training set B.
[0016] Step 23: training set B is trained using the convolutional neural network optimization training of step one, and the weight file is saved;
[0017] Step 24: load the weight file and training set A1 at the same time, infer A1 and manually review, and iteratively train test set A2, optimize and adjust the threshold parameter, and modify the coordinate information;
[0018] Step 25: test the model effect on test set A2, obtain the optimal threshold and coordinate parameters after iterative training, save the weight file at this time, and complete the model training.
[0019] Further, in step 1, the industrial DICOM image is imported into the convolutional neural network, specifically:
[0020] For an industrial DICOM image of any size P x Q, first scale it to a fixed size M x N, then send the M x N image into the network, the Conv layers include 13 conv layers + 13 relu layers + 4 pooling layers, the RPN network first passes through 3 x 3 convolution, then generates positive anchors and corresponding bounding box regression offset, and then calculates the proposals; The Roi Pooling layer extracts the proposal feature from the feature map using the proposal and sends it to the subsequent full connection and softmax network for classification. After the feature extraction layer, there is a group of full connection layers for mapping the features to the object classification and regression categories.
[0021] Further, the method further comprises step 26, specifically:
[0022] The system performance of the model is evaluated, and the indicators include precision, recall rate, average precision, and the average value of the average precision of all categories of defects.
[0023] On the other hand, the present application also provides an industrial DICOM image defect semi-automatic labeling system based on deep learning.
[0024] The labeling system integrates the above-mentioned industrial DICOM image defect semi-automatic labeling method based on deep learning, and the labeling system also integrates the KN algorithm, which is used for DICOM file reading.
[0025] Further, the KN algorithm is specifically: a DICOM image file under a specified path is read through the pydicom library, and is converted into a numpy array a for image decoding, then the code writes the numpy array into a new DICOM image file.
[0026] Further, the KN algorithm implementation step includes:
[0027] Step 31: First, define a path variable "path" pointing to the DICOM image file to be read, then use the "read_file" function in the pydicom library to read the image file and store it as a numpy array "img";
[0028] Step 32: The algorithm uses the "PixelData" attribute to access the numpy array and converts it to a string format, then uses the "bytes.hex" function to convert the string to hexadecimal format;
[0029] Step 33: Next, the code creates a numpy array "l" with length (rows, cols) and fills it with zeros, creates an array "q" and initializes it to zero, then uses a for loop to read each pixel value from the numpy array and convert it to 16 hexadecimal format, and add it to the "l" array, the code then prints the type and length of the "l" array;
[0030] Step 34: The algorithm uses the first 4 bytes of the "data" array, i.e. the first 256 pixel values, to fill the numpy array "a", then converts it to the uint16 type of numpy array, then uses the "imwrite" function in the CV2 library to write the numpy array to a new DICOM image file, and uses the "imread" function in the CV2 library to read the DICOM image file and convert it to a numpy array;
[0031] Step 35: Finally, the code uses the "resize" function in the CV2 library to scale the numpy array image to adapt to the new size, then the code converts the numpy array to a hexadecimal string and saves it as a new DICOM image file.
[0032] Further, the KN algorithm and the deep learning-based industrial DICOM image defect semi-automatic labeling method are integrated on a Pyqt5-based interface.
[0033] The beneficial effects of the above technical solutions of the present application are as follows:
[0034] The present application has created a KN parsing method based on opencv DICOM picture parsing algorithm, and has imported the DCMTK library based on python language-pydicom and opencv library through pycharm to realize the parsing and display of DICOM files.
[0035] Based on the Faster-RCNN convolutional neural network deep learning framework, the model is trained to identify defects, and the main defect types include: porosity, inclusion, loose and the like. And through the semi-automatic labeling system, iterative learning and transfer learning are carried out, so that the precision and efficiency of defect detection are improved, finally, the KN algorithm and the semi-automatic labeling system are integrated on the interface based on Pyqt5, and the cross-platform advantage of Qt software is combined, so that the deployment is more convenient and fast in practical application.
[0036] The semi-automatic labeling of the casting parts is carried out by using the deep learning iterative algorithm, the trained target detection model makes up for the defects that the artificial detection cannot be quantified and is easy to fatigue, and the efficiency of labeling and the accuracy of defect analysis are improved.
[0037] The KN algorithm solves the problem that the general software on the Windows system cannot open the DCM format picture, and the DCM picture is processed by using the DCMTK library, so that the time for the user to parse the DCM picture is reduced, and the image processing efficiency is higher and more convenient.
[0038] The pyqt5 is used to integrate the functions in the interface, so that the visual operation is convenient, and the cross-platform advantage of Qt software is combined, so that the deployment and application are more convenient and fast in practical application. DETAILED DESCRIPTION
[0039] Figure 1 KN algorithm flow chart;
[0040] Figure 2 Interface function design flow chart;
[0041] Figure 3 Faster-RCNN network framework diagram
[0042] Figure 4 Convolutional neural network diagram
[0043] Figure 5 Semi-automatic labeling flow chart; DETAILED DESCRIPTION
[0044] In order to make the technical problems, technical schemes and advantages of the present application clearer, specific embodiments will be described in detail below with reference to the drawings.
[0045] The system mainly includes the following parts:
[0046] Part 1: Interface Functionality: This invention combines the powerful functionality, easy GUI programming features, and cross-platform compatibility of the Qt framework to develop a powerful Dicom software with a more universal software environment. The software and libraries used in this invention are PyQt5, PyDicom, PyTorch, OpenCV 3.4.3, and Python 3.8.
[0047] Using PyQt5, the interface is designed in Qt Designer. In PyCharm, the external tools PyUic and PyRcc are called to convert the resource files into .py files and write the functional programs. Finally, the connect function is used to connect the signals and slot functions to complete the implementation of the interface functions.
[0048] The first aspect of this invention is the design of an image processing interface based on the KN algorithm, PyQt5, PyDiCOM, OpenCV, and PyCharm, which implements the following functions:
[0049] (1) Read and save DICOM image files.
[0050] (2) Image adjustment, viewing and other related functions can realize basic image processing functions.
[0051] (3) Image flipping function, which can mirror flip and rotate clockwise / counterclockwise 90° on film images.
[0052] (4) Grayscale display function, which can display the average grayscale value of the image.
[0053] (5) Import the trained neural network model through the interface for automatic defect identification.
[0054] A second aspect of the present invention is to provide a semi-automatic annotation method for DICOM images based on deep learning, comprising: training a model based on a Faster-RCNN convolutional neural network; and a semi-automatic annotation defect iterative learning method.
[0055] PyQt5—PyQt5 is an extension package for Python, providing a GUI toolkit for creating desktop applications. PyQt5 is the fifth major version of PyQt and is one of the most popular GUI toolkits in the Python community. It supports multiple operating systems, including Windows, Linux, and macOS, offering cross-platform compatibility. PyQt5's three external tools are Qt Designer, PyUIC, and PyRcc. This design uses Qt Designer to create the final interface that runs in PyCharm as the front-end, and then uses Python to implement the back-end functionality within PyCharm.
[0056] The convolutional neural network selected in the application is Faster-RCNN, which combines the advantages of R-CNN and Fast R-CNN algorithms, has high detection speed and good detection precision for casting part defects. The network structure of Faster-RCNN is similar to that of Fast R-CNN, but it is faster. It is composed of two main components: a candidate region generation network RPN and an object detection network ODN.
[0057] The experimental software environment of the application is Windows 10, the hardware environment is AMD Ryzen 55600H with Radeon Graphics 3.30GHz processor, 16G memory, NVIDIA GeForce RTX 3050Ti Laptop GPU independent graphics card. The development environment is CUDA11.2, OPENCV3.4.2, pydicom2.3.1, and the model is trained and tested using the Pytorch deep learning framework.
[0058] The DICOM image is read by the KN algorithm created in the application and saved as JPG / BMP / PNG format. The overall UI interface of the semi-automatic labeling system is designed by Qtdesigner, and the code is written in pycharm. The signal and slot mechanism in pyqt5 is used to connect the front end and the back end, integrate the functions on the interface, and realize the visualization of the functions in the semi-automatic labeling system.
[0059] Referring to Figure 1 The embodiment provides an intelligent detection method for DICOM image based on image processing. When creating a custom class, select the base class provided by Qt, mainly including three base classes of QMainWindow, Qwidget and QDialog. The application objects communicate through signals and slots. Signals and slots are a high-level interface in Qt, which can be created according to requirements. The signal of the object can be connected with the slot function of the object to be communicated through the object connect() function, so as to realize the mutual communication between the two objects. In general, the overall process of the software interface development and design includes the creation of window and space, the layout of the overall interface, the setting of space label, the creation of signal and slot and the connection between them. The implementation steps are as follows:
[0060] One: KN algorithm is used for DICOM file reading, and DcmFileFormat class is mainly responsible for processing DICOM file format, which provides loadFile() function to read DICOM file. DcmDataset class implements DCMTK dataset processing function. Because the display on the general computer cannot reach this display range, it is necessary to dynamically adjust the window width and window level of the image data to convert the image data in the window area to the maximum display range of the display. In this way, the global information of the image can be observed. This transformation process is called mode LUT transformation in DICOM standard. The transformation process is implemented in the constructor of DicomImage class in DCMTK toolkit. The basic idea of KN algorithm is to read a DICOM image file in a specified path through pydicom library and convert it to a numpy array a for image decoding. Then, the code writes the numpy array to a new DICOM image file. The following will introduce the implementation steps of KN algorithm in detail:
[0061] Step1: First, define a path variable "path" pointing to the DICOM image file to be read. Then use the "read_file" function in pydicom library to read the image file and store it as numpy array "img".
[0062] Step2: The algorithm uses the "PixelData" attribute to access the numpy array and converts it to string format ("data"). Then use "bytes.hex" function to convert the string to hexadecimal format ("data").
[0063] Step3: Next, the code creates a numpy array "l" with length (rows, cols) and fills it with zeros. Create array "q" and initialize it to zero. Then use for loop to read each pixel value from numpy array and convert it to 16 hexadecimal format and add it to "l" array. The code then prints the type and length of "l" array.
[0064] Step4: The algorithm uses the first 4 bytes of "data" array (i.e. the first 256 pixel values) to fill the numpy array "a". Then convert it to uint16 type of numpy array. Then use "imwrite" function in CV2 library to write numpy array to new DICOM image file, and use "imread" function in CV2 library to read DICOM image file and convert it to numpy array.
[0065] Step5: Finally, the code uses the "resize" function from the CV2 library to scale the numpy array image to fit the new dimensions (800x500). Then, the code converts the numpy array to a hexadecimal string and saves it as a new DICOM image file.
[0066] Step 2: After reading the DICOM file using the KN algorithm mentioned above, design the overall UI interface of the semi-automatic annotation system using Qt designer. In pycharm, complete the code writing, use the signal and slot mechanism in pyqt5 to connect the front end and the back end, and finally integrate the functions on the interface. The detailed steps are as follows:
[0067] MainWindow is the main interface part of the software, which contains picture recognition and operation, and realizes the corresponding picture processing function button, etc. New Qt project, add pydicom, opencv link library in pycharm, configure language package path, need to use language package when recognizing text, so need to configure the environment variable of language package.
[0068] Step 1: Design the overall UI interface of the semi-automatic annotation system in Qt designer. The overall interface can be divided into menu bar, toolbar and core display window bar. After completing the interface UI design, save the file as a.ui file type.
[0069] Step 2: Import the.ui file in pycharm, use external tool PyUic to export it as demo1.py file, use external tool PyRcc to export the generated resource.qrc file as resource.py file (the content of this file is the button icons and vector pictures used in the UI interface and interactive resources), and modify the function definition file to a python recognizable header file. Create a Qapplication object as the entrance of the GUI program, use the show function to display the page and set app.exec(), so that the page enters the loop display to prevent crash.
[0070] Step 3: Import the necessary PyQt module, load the ui file from the __init__ method and create a window object, the uic.loadUi() method dynamically creates a window object from the UI definition file, and assigns the control object in the UI definition to the property of the window object.
[0071] Step 3: Create a QApplication object, instantiate the Stats class as a stats object, and display the window. Create a slot function and connect the signal and slot function through the connect function to realize the connection between the front end and the back end.
[0072] Software interface section reference Figure 2 As shown, the following introduces the convolutional neural network semi-automatic labeling module.
[0073] Based on the Faster-RCNN model of industrial DICOM image defect semi-automatic labeling system model construction and training and realize semi-automatic labeling.
[0074] The network structure of Faster-RCNN is composed of two main parts: candidate region generation network (Region Proposal Network, RPN) and object detection network (Object Detection Network, ODN). As shown in Figure 3 The RPN is responsible for generating candidate regions in the first part of the network. It is composed of a set of convolutional layers and pooling layers, which are used to extract features from the original image. In the RPN, each convolutional layer produces a candidate region, and these candidate regions are aggregated by the pooling layer to generate the final object candidate region. The input of the RPN is the original input image, and its output is a tensor, where each element represents a candidate region. The elements of this tensor are interrelated because they correspond to objects of different scales. The ODN is responsible for object detection in the second part of the network, using CNN layers to extract features from the candidate regions and using classifiers and regressors to classify and regress objects. The feature extraction layer of the ODN is composed of a set of convolutional layers, which are used to extract features from the image. For an arbitrary size P x Q industrial DICOM image, first scale it to a fixed size M x N, then send the M x N image into the network, and the Conv layers contain 13 conv layers + 13 relu layers + 4 pooling layers, the RPN network first passes through 3x3 convolution, then generates positive anchors and corresponding bounding box regression offset, then calculates the proposals; and the Roi Pooling layer uses the proposals to extract the proposal feature from the feature map and sends it to the subsequent fully connected and softmax network for classification. After the feature extraction layer, there is a set of fully connected layers, which are used to map the features to the categories of object classification and regression, and the specific structure of the convolutional neural network is as shown in Figure 4 The following introduces the specific steps of semi-automatic labeling, as shown in Figure 5
[0075] Step1: Image preprocessing: After binarization, use Gaussian filtering method for smoothing operation. The characteristics of the image, the edge contains high frequency, also has low frequency signal. And this feature shows that when filtering, the unwanted high frequency signal can be removed, leaving useful features. The key to calculating the Gaussian filter is to calculate the Gaussian kernel, and the calculation of the Gaussian kernel can be realized by two-dimensional Gaussian function:
[0076]
[0077] Gaussian filtering of the image needs to use a discrete template. After sampling and quantization of the continuous Gaussian distribution, a discrete template can be obtained, and the template needs to be normalized. The dimension of the discrete Gaussian convolution kernel is H: (2k+1)*(2k+1).
[0078] Step2: Use the labeling software LabelImg to label defects. Suppose you get a data set of 500 pictures, divide them into training set A1 and test set A2 according to the ratio of 9:1, and further do Mixup image enhancement on the training set A2 to get a training set B of 2000 pictures.
[0079] Step3: Use Faster-RCNN convolutional neural network to optimize the training of training set B, and save the weight file.
[0080] Step4: Load the weight file and training set A1 at the same time, infer A1 and manually review. If there are many missed detections, reduce the confidence, if there are many false detections, increase the confidence. At the same time, iterate the test set A2, optimize and adjust the threshold parameters, and modify the coordinate information.
[0081] Step5: Test the model effect on test set A2, get the optimal threshold and coordinate parameters after iterative training, save the weight file, and complete the model training.
[0082] After completing the training, the system performance of the model needs to be evaluated. Generally accepted indicators are used to evaluate the performance of this system, including precision (Precision), recall (Recall), average precision (AP), and the average value of the average precision of all classes (mAP), the calculation formula is:
[0083]
[0084] Precision represents the proportion of samples correctly predicted as positive out of the total number of samples predicted as positive. Precision (P) is equal to the proportion of true positives (TP) minus the proportion of false positives (FP), where TP represents true positive samples and FP represents false positive predictions. Precision is a key metric for evaluating system performance in classification problems, reflecting the accuracy of the classifier. A high precision system performs better when its predictions align with the true outcomes.
[0085]
[0086] Recall represents the proportion of samples that are actually positive out of the total number of samples predicted as positive. Recall (R) is equal to the proportion of true positives (TP) minus the proportion of false negatives (FN), where FN represents false negative predictions. Recall reflects the ability of the classifier to accurately identify true positive samples. A high recall means that the system can more accurately identify positive samples, improving the accuracy of the system.
[0087]
[0088] Average Precision (AP) is a metric for evaluating the overall performance of a system in a classification problem. It represents the proportion of samples predicted as positive that are actually positive. Average Precision (AP) is equal to the average of Precision (P) and Recall (R). Average Precision reflects the overall performance of the system across all classes.
[0089]
[0090] Mean Average Precision (mAP) is another useful metric for evaluating the performance of a system in a classification problem. It represents the proportion of samples predicted as positive that are actually positive, i.e., the accuracy of the predictions of true positive samples. mAP reflects the predictive ability of the system across all classes, providing a more comprehensive evaluation of the system's performance.
[0091] The above is the preferred embodiment of the present application, it should be pointed out that, for those skilled in the art, without departing from the principles of the present application, can make several improvements and refinements, these improvements and refinements should also be considered as the protection scope of the present application.
Claims
1. A semi-automatic defect annotation method for industrial DICOM images based on deep learning, characterized in that, The method includes: Step 1: Import the industrial DICOM image into a convolutional neural network to generate the convolutional neural network. Convolutional neural networks include candidate region generation networks and object detection networks; The candidate region generation network is the first part of the convolutional neural network, responsible for generating candidate regions. It consists of a set of convolutional layers and pooling layers, used to extract features from the original image. In the candidate region generation network, each convolutional layer generates a candidate region. These candidate regions are aggregated by the pooling layer to generate the final object candidate region. The input of the candidate region generation network is the original input image, and its output is a tensor, where each element represents a candidate region. The object detection network is the second part of the convolutional neural network, responsible for object detection. It uses CNN layers to extract features from candidate regions and uses classifiers and regressors to classify and regress objects. The feature extraction layer of the object detection network consists of a set of convolutional layers, which are used to extract features from the image. Step 2 involves training the model based on the convolutional neural network generated in Step 1, including: Step 21: Image preprocessing: After binarization, Gaussian filtering is used for smoothing. The Gaussian kernel is calculated using a two-dimensional Gaussian function. Gaussian filtering of images requires discrete templates. After sampling and quantization, a continuous Gaussian distribution can be obtained as a discrete template, which needs to be normalized. The dimension of the discrete Gaussian convolution kernel is H: (2k+1)*(2k+1). Step 22: Use the labeling software LabelImg to label defects. Divide the dataset images into training set A1 and test set A2 according to the training set: test set ratio of 9:
1. Then, perform Mixup image enhancement on training set A2 to obtain training set B. Step 23: Use the convolutional neural network from Step 1 to optimize and train training set B, and save the weight file; Step 24: Simultaneously load the weight file and training set A1, perform inference on A1 and manually review it, while iteratively training the test set A2, optimizing and adjusting the threshold parameters, and modifying the coordinate information; Step 25: Test the model performance on test set A2. After iterative training, obtain the optimal threshold and coordinate parameters. At this point, save the weight file to complete the model training.
2. The semi-automatic defect annotation method for industrial DICOM images based on deep learning as described in claim 1, characterized in that, Step 1 involves importing the industrial DICOM image into the convolutional neural network as follows: For an industrial DICOM image of arbitrary size P×Q, it is first scaled to a fixed size M×N, and then the M×N image is fed into the network. The Convlayers contain 13 conv layers + 13 relu layers + 4 pooling layers. The RPN network first undergoes 3x3 convolution, and then generates positive anchors and corresponding bounding box regression offsets, and then calculates proposals. The RoiPooling layer uses proposals to extract proposal features from feature maps and feeds them into subsequent fully connected and softmax networks for classification. After the feature extraction layer, there is a set of fully connected layers used to map the features to the categories of object classification and regression.
3. The semi-automatic defect annotation method for industrial DICOM images based on deep learning as described in claim 1, characterized in that, The method further includes step 26, which is as follows: The system performance of the model is evaluated using metrics including precision, recall, mean precision, and the average of the mean precision for all defect categories.
4. A semi-automatic defect annotation system for industrial DICOM images based on deep learning, wherein the annotation system integrates the semi-automatic defect annotation method for industrial DICOM images based on deep learning as described in any one of claims 1 to 3, characterized in that, The annotation system also integrates the KN algorithm, which is used for reading DICOM files.
5. The semi-automatic defect annotation system for industrial DICOM images based on deep learning as described in claim 4, characterized in that, The KN algorithm is as follows: a DICOM image file in a specified path is read using the pydicom library, and it is converted into a NumPy array 'a' for image decoding. Then, the code writes the NumPy array into a new DICOM image file.
6. The semi-automatic defect annotation system for industrial DICOM images based on deep learning as described in claim 5, characterized in that, The steps for implementing the KN algorithm include: Step 31: First, define a path variable "path" that points to the DICOM image file to be read. Then, use the "read_file" function in the pydicom library to read the image file and store it as a NumPy array "img". Step 32: The algorithm accesses the NumPy array using the "PixelData" property, converts it to a string format, and then uses the "bytes.hex" function to convert the string to hexadecimal format; Step 33: Next, the code creates a NumPy array "l" of length (rows, cols) and fills it with zeros. It creates an array "q" and initializes it with zeros. Then, it uses a for loop to read each pixel value from the NumPy array, converts it to hexadecimal format, and adds it to the "l" array. The code then prints the type and length of the "l" array. Step 34: The algorithm uses the first 4 bytes of the "data" array, i.e., the first 256 pixel values, to fill the NumPy array "a", then converts it to the uint16 type of the NumPy array, and then uses the "imwrite" function in the CV2 library to write the NumPy array to a new DICOM image file. The "imread" function in the CV2 library is used to read the DICOM image file and convert it to a NumPy array. Step 35: Finally, the code uses the "resize" function from the CV2 library to scale the NumPy array image to fit the new size. Then, the code converts the NumPy array to a hexadecimal string and saves it as a new DICOM image file.
7. The semi-automatic defect annotation system for industrial DICOM images based on deep learning as described in claim 6, characterized in that, The KN algorithm and the semi-automatic annotation method for defects in industrial DICOM images based on deep learning are integrated on a PyQt5-based interface.
Citation Information
Patent Citations
Method and system for automatically online learning and intelligently assisting in annotating medical images
CN111081353A
Electronic component quality detection method and system based on deep learning
CN111932511A