Bad pixel detection method, bad pixel correction method, and bad pixel processing system
By establishing a bad pixel detection model through neural network deep learning, the problem of low detection accuracy in existing technologies is solved, and efficient and accurate bad pixel detection and correction are achieved.
Patent Information
- Application Number
- CN202210177241.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-02-25
AI Technical Summary
Existing methods for detecting defective pixels are affected by subjective factors, resulting in low accuracy. Furthermore, different defective pixels do not differ significantly in grayscale values in images with fixed exposure parameters, leading to a high rate of missed detections.
By employing neural network deep learning, a bad spot detection model is generated through training. Training, validation, and test sets are established using image data from before the detector leaves the factory and during use. A neural network is then built to detect bright spots, dark spots, or colored spots in the image.
It improves the efficiency and accuracy of defect detection, avoids the complexity and subjectivity of manual parameter adjustment, enhances the universality and robustness of the system, and reduces the human burden.
Smart Images

Figure CN114679580B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and in particular to a method for detecting bad pixels, a method for correcting bad pixels, and a system for processing bad pixels. Background Technology
[0002] Current methods for detecting defective pixels primarily rely on manual inspection. However, manual visual inspection, which involves manually adjusting detection thresholds, is susceptible to subjective limitations, affecting accuracy. Furthermore, different defective pixels respond differently to X-rays. In images with fixed exposure parameters, defective pixels may have grayscale values that are not significantly different from normal pixels, leading to missed detections and consequently low efficiency and accuracy.
[0003] Therefore, how to solve the problem of low accuracy in existing defect detection systems has become one of the urgent problems to be solved by those skilled in the art. Summary of the Invention
[0004] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a defective pixel detection method, a defective pixel correction method, and a defective pixel processing system to solve the problem of low accuracy in defective pixel detection in the prior art.
[0005] To achieve the above and other related objectives, the present invention provides a defective pixel detection method, which includes at least the following steps:
[0006] S0: Collect data from the detector before it leaves the factory and create a database; wherein, the data includes at least pixel values or grayscale values from image data;
[0007] S1: Based on the database, a neural network is built, and then trained to generate the first bad pixel detection model;
[0008] S2: When the detector acquires images after leaving the factory, the first bad pixel detection model is used to detect bad pixels in the acquired images. If the pixel value or grayscale value of a pixel in the image is abnormal, it is judged as a bad pixel. The abnormality refers to the appearance of bright spots, dark spots or colored spots.
[0009] Optionally, step S1 includes:
[0010] S11: Based on the data in the database, create the training set, validation set, and test set required for the neural network;
[0011] S12: Build a neural network to generate the first bad pixel detection model, and train the first bad pixel detection model to continuously verify and iterate; when the first bad pixel detection model meets the first condition, output the first bad pixel detection model; wherein, the first condition is that the accuracy of bad pixel detection is within a first preset range.
[0012] Alternatively, step S11 includes: uniformly and randomly sampling the data in the database into a training set, a validation set, and a test set, wherein the three sets cannot overlap.
[0013] Alternatively, step S12 includes:
[0014] S121: Based on the neural network, the training set is used to train the model, and then the learning parameters of the trained model are determined;
[0015] S122: Based on neural networks, select the hyperparameter with the minimum error rate using the validation set;
[0016] S123: Based on the neural network, the trained model is used to evaluate the accuracy of the test set;
[0017] S124: Repeat steps S121 to S123; when the accuracy of the test set is within the first preset range, output the training model, which is the first bad pixel detection model.
[0018] Alternatively, step S2 can be replaced with:
[0019] S2-1: Add the image data collected after the detector leaves the factory to the database, build a neural network based on the new database, and then generate a second bad spot detection model;
[0020] S2-2: Use the second bad pixel detection model to detect bad pixels in the acquired image. If the pixel value or grayscale value of a pixel in the image is abnormal, it is judged as a bad pixel. The abnormality refers to the appearance of bright spots, dark spots or colored spots.
[0021] Alternatively, step S2-1 includes:
[0022] S2-11: Collect image data of the detector in use and add it to the database. Based on the new database, recreate the training set, validation set and test set.
[0023] S2-12: Build a neural network to generate the second bad pixel detection model, train the second bad pixel detection model, and continuously verify and iterate; when the second bad pixel model meets the second condition, output the second bad pixel detection model; wherein, the second condition is that the accuracy of bad pixel detection is within a second preset range, and the second preset range is smaller than the first preset range.
[0024] To achieve the above and other related objectives, the present invention also provides a method for defect correction:
[0025] The image is subjected to bad pixel detection based on the bad pixel detection method described above.
[0026] It also performs bad pixel correction and outputs a bad pixel corrected image.
[0027] To achieve the above and other related objectives, the present invention also provides a defective pixel processing system, comprising:
[0028] Detectors are used to acquire image data;
[0029] A computer is connected to the detector to acquire image data collected by the detector and perform dead pixel detection and correction.
[0030] Optionally, the computer includes a storage medium and a processor; the storage medium is used to store data, and the processor is used to configure neural network programs.
[0031] Optionally, the computer builds a neural network based on existing data to generate a bad pixel detection model, and the computer uses the detection model to detect and correct bad pixels in the image data.
[0032] As described above, the defect detection method, defect correction method, and defect processing system of the present invention have the following beneficial effects:
[0033] The defect detection method of this invention builds a neural network and uses deep learning to detect defective pixels, which is more efficient. It avoids manual parameter adjustment and solves the problems of existing defect detection methods, such as being subjective, having complex parameter tuning, poor universality, poor robustness, cumbersome process, and heavy manpower burden. Attached Figure Description
[0034] Figure 1 The diagram shown illustrates the principle of the defect detection method of the present invention. Detailed Implementation
[0035] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention.
[0036] Please see Figure 1 It should be noted that the illustrations provided in this embodiment are only schematic representations of the basic concept of the present invention. Therefore, the illustrations only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0037] Example 1
[0038] This embodiment provides a method for detecting defective pixels, which includes the following steps:
[0039] S0: Collect data from the detector before it leaves the factory and create a database; wherein the data includes at least pixel values or grayscale values from the image data. It should be noted that each detector undergoes extensive testing before leaving the factory to ensure stable performance. This testing primarily involves using an X-ray source; the source exposes the detector, which then captures images. Multiple exposures and image captures are performed, and the collected image data is then compiled into a database. The image data mainly includes pixel values or grayscale values; other image data, such as pixel brightness, is also applicable, but will not be elaborated upon here.
[0040] S1: Based on the database, a neural network is built, and then trained to generate the first bad pixel detection model. In this embodiment, deep learning of the neural network is used to make bad pixel detection more efficient, solving the problems of existing bad pixel detection methods that are subjective, have complex parameter tuning, poor universality, poor robustness, cumbersome process, and high manpower burden.
[0041] Specifically, step S1 includes:
[0042] S11: Based on the data in the database, create the training set, validation set, and test set required for the neural network.
[0043] More specifically, as an example, step S11 includes: uniformly and randomly sampling the data in the database into a training set, a validation set, and a test set, wherein the three sets cannot overlap. It should be noted that the ratio of the training set, the validation set, and the test set can be 8:1:1 or 7:1:2. This ratio is not limited to this embodiment; the specific choice can be based on the required precision. Higher precision results in a larger proportion of the training set, which will not be elaborated upon here. When uniformly and randomly sampling the data in the database, different types of data are sampled differently. For example, pixel values in image data can be sampled to form the training set, the validation set, and the test set; or grayscale values in image data can be sampled to form the training set, the validation set, and the test set. Uniform random sampling of other types of data in image data is consistent with the above method of uniform random sampling by pixel value or grayscale value, and will not be elaborated upon here.
[0044] S12: Construct a neural network to generate the first bad pixel detection model, and train and iterate the first bad pixel detection model. When the first bad pixel detection model meets the first condition, output the first bad pixel detection model. The first condition is that the accuracy of bad pixel detection is within a first preset range. It should be noted that the neural network is used to find patterns between the image data. Neural networks that can be used for classification and detection include, but are not limited to, R-CNN series, YOLO series, RetinaNet, SSD, AlexNet, VGGNet, and many other emerging neural networks, which are not limited here. R-CNN stands for Region-based Convolutional Neural Networks. R-CNN is based on algorithms such as Convolutional Neural Networks (CNN), linear regression, and Support Vector Machines (SVM) to achieve object detection technology. YOLO stands for You Only Look Once. YOLO redefines object detection as a regression problem, applying a single Convolutional Neural Network (CNN) to the entire image, dividing the image into grids and predicting the class probability and bounding box for each grid. RetinaNet, from the FAIR paper "Focal Loss for Dense Object Detection," briefly analyzes how an extremely imbalanced ratio of positive to negative (foreground and background) samples leads to lower accuracy for one-stage detectors compared to two-stage detectors. Based on this analysis, it proposes a simple yet highly practical Focal Loss function, and the loss design can be extended to other fields. Furthermore, for specific problems in object detection, the RetinaNet network was designed, combining Focal Loss to enable one-stage detectors to achieve accuracy comparable to or even surpassing that of two-stage detectors. SSD, short for Single Shot MultiBox Detector, is an algorithm based on a feedforward convolutional neural network. It generates a series of fixed-size bounding boxes and scores the presence of object instances within these boxes, followed by a non-maximum suppression algorithm to obtain the final prediction result. AlexNet, proposed by Alex Krizhevsky in 2012, won the 2012 ILSVRC competition. It uses the non-linear activation function ReLU, and methods to prevent overfitting such as Dropout and data augmentation.VGGNet is a deep convolutional neural network developed by researchers from the University of Oxford's Computer Vision Group and Google DeepMind. It explores the relationship between the depth of convolutional neural networks and their performance. By repeatedly stacking small 3*3 convolutional kernels and 2*2 max pooling layers, it successfully constructed convolutional neural networks with depths of 16 to 19 layers.
[0045] More specifically, as an example, step S12 includes:
[0046] S121: Based on a neural network, a model is trained using the training set to determine the learning parameters of the trained model. It should be noted that the trained model represents a pattern existing in the training set, which can be a function (multiple sets with a mapping relationship) and applies to all data in the training set. The pattern can be expressed using an algorithm or a functional expression, without limitation here. Different training methods are used for different data types, such as training on pixel value data and training on grayscale value data. The learning parameters represent parameters that satisfy the pattern of the trained model, such as weights and biases. These parameters vary depending on the training model and are selected as needed in practice; details are not elaborated here.
[0047] S122: Based on the neural network, select the hyperparameter with the smallest error rate using the validation set. After the training model is determined (the learning parameters of the training model are determined), substitute the parameters of the validation set into the training model to determine the goodness of fit of the validation set data; the error rate is the goodness of fit, and select the hyperparameter with a high goodness of fit (small error rate). It should be noted that the hyperparameter can be the number of network layers, the number of network nodes, the number of iterations, or the learning rate. Other hyperparameters are also included and can be selected as needed, but they are not listed here.
[0048] S123: Based on a neural network, the trained model is used to evaluate the accuracy of the test set. Data from the test set is fed into the trained model, and the accuracy of the trained model is evaluated based on its fit to the data in the test set.
[0049] S124: Repeat steps S121 to S123; when the accuracy of the test set is within a first preset range, output the training model, which is the first bad pixel detection model. The first preset range can be set arbitrarily, and will not be elaborated here. It should be noted that other neural network application methods and data learning methods are also applicable to this invention, and are not limited here; the operator can choose according to actual needs.
[0050] S2: When acquiring images after the detector leaves the factory, the first bad pixel detection model is used to detect bad pixels in the acquired images. If the pixel value or grayscale value of a pixel in the image is abnormal, it is judged as a bad pixel; wherein, the abnormality refers to the appearance of bright spots, dark spots, or colored spots. The formation of bad pixels may be due to defects in the manufacturing process of the detector, or it may be due to errors in the process of converting light signals into electrical signals, thereby causing errors in the pixel information on the image. Bright spots represent pixels that cannot display normal primary colors under a black screen, dark spots represent pixels that cannot display normal colors under a white screen, and colored spots represent pixels that cannot display one or more colors.
[0051] As another implementation of this embodiment, as an example, step S2 can be replaced with:
[0052] S2-1: Add the image data collected after the detector leaves the factory to the database, build a neural network based on the new database, and then generate a second bad pixel detection model; wherein, the principle of generating the second bad pixel detection model is similar to the principle of generating the first bad pixel detection model, and will not be described in detail here.
[0053] Specifically, step S2-1 includes:
[0054] S2-11: Collect image data from the detector during use and add it to the database. Based on the new database, recreate the training set, validation set, and test set. The methods and steps for creating the training set, validation set, and test set are similar to those in S11, and will not be described in detail here.
[0055] S2-12: Construct a neural network to generate the second bad pixel detection model. Train the second bad pixel detection model and continuously verify and iterate. When the second bad pixel model meets the second condition, output the second bad pixel detection model. The second condition is that the accuracy of bad pixel detection is within a second preset range, which is smaller than the first preset range. The principle of generating the second bad pixel detection model and the principle of training and verifying the second bad pixel detection model are similar to those of the first bad pixel detection model, and will not be elaborated here.
[0056] S2-2: Use the second bad pixel detection model to detect bad pixels in the acquired image. If the pixel value or grayscale value of a pixel in the image is abnormal, it is judged as a bad pixel. The abnormality refers to the appearance of bright spots, dark spots or colored spots.
[0057] The defect detection method of this invention builds a neural network and uses deep learning to detect defective pixels, which is more efficient. It avoids manual parameter adjustment and solves the problems of existing defect detection methods, such as being subjective, having complex parameter tuning, poor universality, poor robustness, cumbersome process, and heavy manpower burden.
[0058] Example 2
[0059] This embodiment provides a defective pixel correction method, which is based on the defective pixel detection method described in Embodiment 1.
[0060] The image is subjected to bad pixel detection based on the bad pixel detection method described in Embodiment 1.
[0061] The image undergoes dead pixel correction, and the corrected image is output. The method for dead pixel correction is implemented using existing technology and will not be described in detail here; any method capable of dead pixel correction can be applied to this invention.
[0062] Example 3
[0063] This embodiment provides a defective pixel processing system for implementing the defective pixel detection method described in Embodiment 1. The defective pixel processing system includes a detector and a computer.
[0064] The detector is used to acquire image data, to acquire images when the X-ray source is exposed, and to transmit them to the computer; the detector is not limited, and any image sensor and device capable of acquiring images is applicable to this invention, and will not be described in detail here.
[0065] The computer is connected to the detector, acquires the image data collected by the detector, and performs dead pixel detection and correction. The dead pixel detection method is based on Embodiment 1; the dead pixel correction method is existing technology and will not be described in detail here.
[0066] Specifically, the computer includes a storage medium and a processor; the storage medium is used to store data, the processor is used to configure a neural network program, and the memory is used to store image data, bad pixel data, the bad pixel detection system, and the bad pixel correction method. Under the configuration of the processor, the bad pixel detection system and the bad pixel correction method can run to process bad pixels.
[0067] Specifically, the computer builds a neural network based on existing data to generate a bad pixel detection model, and then uses the detection model to detect and correct bad pixels in the image data.
[0068] In summary, this invention provides a defective pixel detection method, a defective pixel correction method, and a defective pixel processing system. The defective pixel detection method includes the following steps: S0: Collecting data from the detector before it leaves the factory and creating a database; wherein, the data includes at least pixel values or grayscale values from image data; S1: Building a neural network based on the database, and then training and generating a first defective pixel detection model; S2: When acquiring images after the detector leaves the factory, using the first defective pixel detection model to detect defective pixels in the acquired images. If the pixel values or grayscale values of pixels in the image are abnormal, they are judged as defective pixels; wherein, the abnormality refers to the appearance of bright spots, dark spots, or colored spots. The defective pixel detection method of this invention builds a neural network and detects defective pixels through deep learning, which is more efficient; it avoids manual parameter adjustment and solves the problems of existing defective pixel detection methods, such as being subjective, having complex parameter tuning, poor universality, poor robustness, cumbersome processes, and high manpower burden. Therefore, this invention effectively overcomes the various shortcomings of the prior art and has high industrial application value.
[0069] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for detecting defective pixels, characterized in that, The defect detection method includes at least the following steps: S0: Collect data from the detector before it leaves the factory and create a database; wherein, the data includes at least pixel values from image data; S1: Based on the database, a neural network is built, and then a first bad pixel detection model is trained and generated; when the first bad pixel detection model meets the first condition, the first bad pixel detection model is output; wherein, the first condition is that the accuracy of bad pixel detection is within a first preset range; S2: When the detector acquires images after leaving the factory, the first bad pixel detection model is used to detect bad pixels in the acquired images. If the pixel value of a pixel in the image is abnormal, it is judged as a bad pixel; wherein, the abnormality refers to the appearance of bright spots, dark spots or colored spots. It also includes: S2-1: Adding the image data collected after the detector leaves the factory to the database, building a neural network based on the new database, and then generating a second bad pixel detection model; S2-2: Using the second bad pixel detection model to perform bad pixel detection on the collected images, and if the pixel value of a pixel in the image is abnormal, it is judged as a bad pixel; wherein, the abnormality refers to the appearance of bright spots, dark spots or colored spots; Step S2-1 includes: S2-11: Collecting image data of the detector in use and adding it to the database; based on the new database, recreating the training set, validation set, and test set; S2-12: Building a neural network to generate the second bad pixel detection model; training the second bad pixel detection model and continuously verifying and iterating; when the second bad pixel detection model meets the second condition, outputting the second bad pixel detection model; wherein, the second condition is that the accuracy of bad pixel detection is within a second preset range, and the second preset range is smaller than the first preset range.
2. The defect detection method according to claim 1, characterized in that, Step S1 includes: S11: Based on the data in the database, create the training set, validation set, and test set required for the neural network; S12: Build a neural network to generate the first bad pixel detection model, and train the first bad pixel detection model to continuously verify and iterate.
3. The defect detection method according to claim 2, characterized in that, Step S11 includes: uniformly and randomly sampling the data in the database into a training set, a validation set, and a test set, and the three sets cannot overlap.
4. The defect detection method according to claim 2, characterized in that, Step S12 includes: S121: Based on the neural network, the training set is used to train the model, and then the learning parameters of the trained model are determined; S122: Based on neural networks, select the hyperparameter with the minimum error rate using the validation set; S123: Based on the neural network, the trained model is used to evaluate the accuracy of the test set; S124: Repeat steps S121 to S123; when the accuracy of the test set is within the first preset range, output the training model, which is the first bad pixel detection model.
5. A method for defective pixel correction, characterized in that: The image is subjected to bad pixel detection based on the bad pixel detection method as described in any one of claims 1-4; It also performs bad pixel correction and outputs a bad pixel corrected image.
6. A defective pixel processing system, used to implement the defective pixel detection method as described in any one of claims 1-4, characterized in that: The defective pixel processing system includes: Detectors are used to acquire image data; A computer is connected to the detector to acquire image data collected by the detector and perform dead pixel detection and correction.
7. The defective pixel processing system according to claim 6, characterized in that: The computer includes a storage medium and a processor; the storage medium is used to store data, and the processor is used to configure neural network programs.
8. The defective pixel processing system according to claim 6, characterized in that: The computer builds a neural network based on existing data, and then generates a bad pixel detection model. The computer uses the detection model to detect and correct bad pixels in the image data.
Citation Information
Patent Citations
Abnormal value no-reference image quality evaluation model and construction method thereof
CN108289221A
Method and device for detecting defective pixel in image
CN112384946A