A Terahertz Image Quality Assessment Method Based on ResNet Network
The image quality assessment method using ResNet network solves the problems of resource waste and analysis redundancy caused by low-quality images in terahertz images, and achieves fast and accurate image quality assessment, supporting the processing of multiple images.
Patent Information
- Application Number
- CN202310775434.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-06-28
AI Technical Summary
Existing terahertz image quality assessment methods cannot effectively screen low-quality images, resulting in wasted resources and poor subsequent analysis results.
Image quality assessment is performed using ResNet network. Through dataset annotation, preprocessing, and model training, combined with the analysis of target region proportion, height, and width, an objective evaluation mechanism is established, and subjective factors are introduced to improve the model's generalization ability.
It enables fast and accurate image quality assessment, reduces resource waste, meets real-time requirements, and the assessment results are reproducible, supporting the processing of multiple images.
Smart Images

Figure CN116758044B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of deep learning technology, specifically relating to a terahertz image quality evaluation method based on ResNet network. Background Technology
[0002] Currently, in the field of terahertz intelligent security inspection, selecting high-quality image data is crucial for achieving faster and more accurate security checks. Existing image quality assessment methods mostly focus on the degree of image distortion. However, in practical terahertz image applications, visual effect is only one aspect; quality assessment is also necessary to filter out low-quality terahertz images to improve subsequent image analysis and storage functions. However, processing low-quality terahertz images (such as pure background images) is not only resource-intensive but may also yield meaningless results. Therefore, it is necessary to propose a new terahertz image quality assessment method. Summary of the Invention
[0003] To address the technical problems existing in the prior art, the purpose of this invention is to provide a terahertz image quality evaluation method based on ResNet network.
[0004] To achieve the above objectives and technical effects, the technical solution adopted by this invention is as follows:
[0005] In a first aspect, this invention discloses a terahertz image quality assessment method based on a ResNet network, comprising the following steps:
[0006] S101. Prepare terahertz image dataset;
[0007] The terahertz image dataset includes a training dataset and a test dataset;
[0008] S102. Preprocess the training dataset;
[0009] S103. Obtain the training model;
[0010] S104. Evaluate the performance of the trained model in step S103 using the test dataset, determine the final evaluation model, and save it.
[0011] S105. Input the test image, load the evaluation model from step S104, and then obtain the model output, which is the objective evaluation score of the test image, score0.
[0012] S106. Preprocess the input test image to obtain a binary image;
[0013] S107. Introduce the target region proportion. Perform contour search on the binary image generated in step S106. Based on the preset target area threshold, exclude some background interference areas. Take the contour with the largest area among the remaining contours as the target contour. Then, use the proportion of the target region in the whole image as the target region proportion score1.
[0014] S108. Analyze the height and width of the target to obtain the target area location score2;
[0015] S109. Add all the scores together and output the final score of the image: score = score0 + score1 + score2.
[0016] In the first aspect, preferably, step S102, the step of preprocessing the training dataset includes:
[0017] First, there is the labeling of the dataset, the quality of which directly affects the accuracy and performance of the algorithm;
[0018] Second, the dataset labeling is used to describe the actual features of the image in data form.
[0019] In the first aspect, preferably, the annotation work of the dataset includes:
[0020] The raw data in the dataset is manually processed. To accurately describe the features, key points of the human body and the rectangular region where the human body is located are labeled for each training image.
[0021] In the first aspect, preferably, the labeling of the dataset includes:
[0022] An objective scoring mechanism is established based on the marked human body key points and rectangular areas. The main scoring steps include:
[0023] First, the key point score is determined by the number of key points marked.
[0024] Second, the score for the center point of the target area is determined by the location of the center point of the marked rectangular area;
[0025] Thirdly, the height percentage score is determined by the height of the marked rectangular area and the overall height of the image;
[0026] Finally, the result of multiplying the scores of the three items is used as the score, or label, for the image.
[0027] In the first aspect, preferably, step S103, the step of obtaining the training model includes:
[0028] Select the ResNet18 network model to be used for training, and repeatedly train it on the training dataset to learn the features, and finally obtain the trained model.
[0029] In the first aspect, preferably, step S106, the step of preprocessing the input test image, includes:
[0030] First, the color mode is converted, changing the image from RGB color mode to grayscale color mode;
[0031] Second, Gaussian denoising is performed to remove some noise points from the image.
[0032] Third, image binarization processing is performed, using the Otsu thresholding method to convert the image into a binary image.
[0033] In the first aspect, preferably, the analysis of the height and width of the target in step S108 includes: the height of the target, the ratio of the height to the width of the target, the position of the center point coordinates of the target in the image, and the position of the starting point coordinates of the target in the image.
[0034] Secondly, this invention also discloses a terahertz image quality assessment device based on a ResNet network, comprising:
[0035] Memory, used to store computer programs;
[0036] A processor is configured to execute the computer program to implement the steps of a terahertz image quality assessment method based on a ResNet network as described above.
[0037] Thirdly, the present invention also discloses a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the terahertz image quality evaluation method based on a ResNet network as described above.
[0038] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0039] 1) Based on the expression and distribution characteristics of pedestrian targets in terahertz images, an objective scoring mechanism was formulated and used as the label for training data, which greatly improved the model's ability to extract features of pedestrian targets in images.
[0040] 2) To ensure that the quantized values of the computational model are consistent with human subjective observations, subjective evaluation factors such as the proportion of the target area were introduced based on the imaging environment and application details of terahertz, thereby improving the generalization ability of the model.
[0041] 3) The model is stable, achieving batch processing while ensuring fast and accurate output, and retaining the reproducibility of evaluation results; it supports multiple consecutive inputs. For example, a single terahertz image with a resolution of 400*800 takes only about 1.4ms to process, which can meet real-time requirements. Attached Figure Description
[0042] Figure 1 These are 12 consecutive passive terahertz images from Embodiment 1 of the present invention;
[0043] Figure 2 The running time and score of a single image in Embodiment 1 of the present invention;
[0044] Figure 3 This is a passive terahertz image after evaluation, arranged in descending order of score according to Embodiment 1 of the present invention. Detailed Implementation
[0045] The present invention will now be described in detail so that its advantages and features can be more easily understood by those skilled in the art, thereby providing a clearer and more explicit definition of the scope of protection of the present invention.
[0046] The following provides a brief overview of one or more aspects to offer a basic understanding of them. This overview is not an exhaustive summary of all conceived aspects, nor is it intended to identify key or decisive elements of all aspects, nor to define the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form to prepare for the more detailed descriptions that follow.
[0047] Example 1
[0048] like Figure 1-3 As shown, a terahertz image quality assessment method based on ResNet network solves the problems of resource waste, analysis redundancy, and ineffective effect display caused by low quality of terahertz images in security inspection applications. The method proposed in this invention is based on objective evaluation methods, and uses a typical ResNet deep learning network to train the evaluation model. To make the evaluation results more accurate, multiple subjective factors are subsequently introduced for comprehensive analysis.
[0049] Assuming the input is a single terahertz image and the output is the quality evaluation score of that input image, the main implementation process of the evaluation method of this invention is as follows:
[0050] Preparation of S101 terahertz image dataset, including training dataset and test dataset.
[0051] S102. Preprocessing of the training dataset includes two parts: first, the annotation of the dataset, the quality of which directly affects the accuracy and performance of the algorithm; second, the labeling of the dataset, which uses data to describe the actual features of the images.
[0052] S102-1. Manually process the raw data in the dataset. In order to accurately describe the features, annotate the human body key points and the rectangular region where the human body is located in each training image.
[0053] S102-2. An objective scoring mechanism was established based on the marked human body key points and rectangular areas. The main scoring steps are as follows: First, the key point score is determined by the number of marked key points; second, the target area center point score is determined by the location of the center point of the marked rectangular area; third, the height ratio score is determined by the height of the marked rectangular area and the overall height of the image; finally, the result of multiplying the above three scores is used as the score of the image, i.e., the label.
[0054] S103. Select the network model to be used for training. This invention adopts the ResNet18 network model, and repeatedly trains and learns features on the training set to finally obtain the trained model.
[0055] ResNet18 is a deep convolutional neural network architecture. The basic architecture of the network is ResNet, with 18 layers in depth. It is composed entirely of convolutional layers and fully connected layers. A typical feature of the network is the inclusion of multiple residual modules, which can preserve the original features, making the network learning smoother and more stable, and further improving the model's accuracy and generalization ability.
[0056] S104. Evaluate the model performance in step S103 using the test dataset, determine the final evaluation model, and save it.
[0057] The test dataset is not used in the training process. It is mainly used to test the accuracy of the trained model, but it cannot be used as a basis for algorithm-related choices such as parameter tuning and feature selection. It is only used to evaluate the performance of the model.
[0058] Saving a model involves saving its structure and weights, storing the trained model, and then reloading it when needed.
[0059] S105. Input a test image, load the evaluation model from step S104, and then obtain the model output, which is the objective evaluation score of the input image, score0.
[0060] S106. First, the input test image is preprocessed, which includes three parts: First, color mode conversion, converting the image from RGB color mode to grayscale color mode; second, Gaussian denoising, removing some noise interference points in the image; and third, image binarization, using Otsu's thresholding method to convert the image into a binary image.
[0061] S107. Introduce the target (i.e. human body) region proportion, perform contour search on the binary image generated in step S106, exclude some background interference areas according to the preset target area threshold, take the contour with the largest area among the remaining contours as the target contour, and then use the proportion of the target region in the whole image as the target region proportion score1.
[0062] S108. Analyze the height and width of the target, including the target's height, the ratio of the target's height to its width, the position of the target's center point coordinates in the image, and the position of the target's starting point coordinates in the image. Judge according to the preset conditions in sequence to obtain the target area position score score2.
[0063] S109. Add all the scores together and output the final score of the image: score = score0 + score1 + score2.
[0064] This invention also discloses a terahertz image quality assessment device based on a ResNet network, comprising:
[0065] Memory, used to store computer programs;
[0066] A processor is configured to execute the computer program to implement the steps of a terahertz image quality assessment method based on a ResNet network as described above.
[0067] The present invention also discloses a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of a terahertz image quality assessment method based on a ResNet network as described above.
[0068] The training dataset, test dataset, and test images selected in this invention were all acquired using a passive terahertz imaging device. The evaluation model was determined through steps S101-S104. To verify the effectiveness of the algorithm, 12 terahertz images of a pedestrian traveling from the entrance to the exit of the passive terahertz imaging device were randomly selected (see...). Figure 1 The specific steps for testing the effectiveness of the method proposed in this invention are as follows:
[0069] First, Figure 1 The 12 images shown are used as input;
[0070] Then, for each of the above images, steps S105-S109 are executed sequentially to obtain the time and score corresponding to that image (see...). Figure 2 );
[0071] Finally, the 12 images were sorted in descending order of their scores, and the images corresponding to the sorting results are shown below. Figure 3As shown, the method disclosed in this invention is effective and relatively accurate.
[0072] Any parts or structures not specifically described in this invention can be made using existing technologies or products, and will not be elaborated upon here.
[0073] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A terahertz image quality assessment method based on ResNet network, characterized in that, Includes the following steps: S101. Prepare terahertz image dataset; The terahertz image dataset includes a training dataset and a test dataset; S102. Preprocess the training dataset; S103. Obtain the training model, including the following steps: Select the ResNet18 network model to be used for training, and repeatedly train it on the training dataset to learn features, and finally obtain the trained model; S104. Evaluate the performance of the trained model in step S103 using the test dataset, determine the final evaluation model, and save it. S105. Input the test image, load the evaluation model from step S104, and then obtain the model output, which is the objective evaluation score of the test image, score0. S106. Preprocess the input test image to obtain a binary image; S107. Introduce the target region proportion. Perform contour search on the binary image generated in step S106. Based on the preset target area threshold, exclude some background interference areas. Take the contour with the largest area among the remaining contours as the target contour. Then, use the proportion of the target region in the whole image as the target region proportion score1. S108. Analyze the height and width of the target to obtain the target area location score2; S109. Add all the scores together and output the final score of the image: score = score0 + score1 + score2.
2. The terahertz image quality assessment method based on ResNet network according to claim 1, characterized in that, Step S102, the preprocessing steps for the training dataset include: First, there is the labeling of the dataset, the quality of which directly affects the accuracy and performance of the algorithm; Second, the dataset labeling is used to describe the actual features of the image in data form.
3. The terahertz image quality assessment method based on ResNet network according to claim 2, characterized in that, The annotation work for the dataset includes: The raw data in the dataset is manually processed. To accurately describe the features, key points of the human body and the rectangular region where the human body is located are labeled for each training image.
4. The terahertz image quality assessment method based on ResNet network according to claim 2, characterized in that, The label settings for the dataset include: An objective scoring mechanism is established based on the marked human body key points and rectangular areas. The main scoring steps include: First, the key point score is determined by the number of key points marked. Second, the score for the center point of the target area is determined by the location of the center point of the marked rectangular area; Thirdly, the height percentage score is determined by the height of the marked rectangular area and the overall height of the image; Finally, the result of multiplying the scores of the three items is used as the score, or label, for the image.
5. The terahertz image quality assessment method based on ResNet network according to claim 1, characterized in that, Step S106, the preprocessing steps for the input test image, include: First, the color mode is converted, changing the image from RGB color mode to grayscale color mode; Second, Gaussian denoising is performed to remove some noise points from the image. Third, image binarization processing is performed, using the Otsu thresholding method to convert the image into a binary image.
6. The terahertz image quality assessment method based on ResNet network according to claim 1, characterized in that, In step S108, the analysis of the target's height and width includes: the target's height, the ratio of the target's height to its width, the position of the target's center point coordinates in the image, and the position of the target's starting point coordinates in the image.
7. A terahertz image quality assessment device based on a ResNet network, characterized in that, include: memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the terahertz image quality assessment method based on a ResNet network as described in any one of claims 1 to 6.
8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the terahertz image quality assessment method based on a ResNet network as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Terahertz image super-resolution reconstruction method, system and related device
CN109785237A
Attention mechanism-based image aesthetics quality evaluation method
CN110473164A