WO2023000526A1 - Image interpolation model training method based on residual-guided policy - Google Patents

Image interpolation model training method based on residual-guided policy Download PDF

Info

Publication number
WO2023000526A1
WO2023000526A1 PCT/CN2021/125577 CN2021125577W WO2023000526A1 WO 2023000526 A1 WO2023000526 A1 WO 2023000526A1 CN 2021125577 W CN2021125577 W CN 2021125577W WO 2023000526 A1 WO2023000526 A1 WO 2023000526A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
residual
interpolation
random forest
level
Prior art date
Application number
PCT/CN2021/125577
Other languages
French (fr)
Chinese (zh)
Inventor
钟宝江
苏润
Original Assignee
苏州大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州大学 filed Critical 苏州大学
Publication of WO2023000526A1 publication Critical patent/WO2023000526A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20224Image subtraction

Definitions

  • the present application relates to the field of computer technology, in particular to an image interpolation model training method based on a residual guidance strategy, an image interpolation method based on a residual guidance strategy, computer equipment, and a readable storage medium.
  • Image interpolation is a method of restoring a low-resolution image to a high-resolution image and maintaining the details and structure of the original low-resolution image as much as possible.
  • the purpose of this application is to provide an image interpolation model training method based on a residual-guided strategy, an image interpolation method based on a residual-guided strategy, computer equipment, and a readable storage medium to solve the problem of poor interpolation effects of current image interpolation schemes Ideal question.
  • the specific plan is as follows:
  • the present application provides a method for training an image interpolation model based on a residual guidance strategy, including:
  • the random forest grows synchronously by layers, and the initial residual is used as the first-level residual, in the random forest
  • the random forest whose mapping relationship at each level is determined is output as an image interpolation model.
  • the random forest is divided into multiple groups of random forests, and the training of the random forest by using the pre-interpolation image and the initial residual includes:
  • the feature vectors are grouped, wherein the number of groups of the feature vectors is equal to the number of groups of the random forest;
  • a group of random forests are trained for each set of feature vectors and corresponding residual vectors in the initial residual.
  • the generating the feature vector of the pre-interpolation image includes:
  • the sampling method of the four feature images is specifically: sampling at intervals with a step size of 1;
  • the image interpolation model specifically includes the K-level random forest;
  • the pre-interpolation image of the first-level random forest is an image generated using a preset interpolation algorithm, and for any k ⁇ [2,K], the k-th level
  • the pre-interpolation image of the random forest is the image obtained by sequential interpolation of the previous k-1 random forest.
  • the high-resolution images of random forests at different levels are different.
  • the random forest grows synchronously by layers, including:
  • the target residual vector is a residual vector that intersects with the target node
  • the target node belongs to a leaf node, and the second linear transformation of the target node is recorded, and finally the second linear transformation of all leaf nodes is the difference between the pre-interpolation image and the sum of the residuals of each level Mapping relations;
  • the present application provides an image interpolation method based on a residual guidance strategy, including:
  • An interpolated image of the low-resolution image is generated according to the estimated residual of each level and the pre-interpolated image.
  • the present application provides a computer device, which is characterized in that it includes:
  • memory used to store computer programs
  • Processor configured to execute the computer program to implement the above-mentioned method for training an image interpolation model based on a residual-guided strategy, and/or the above-mentioned image interpolation method based on a residual-guided strategy.
  • the present application provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, it is used to implement the image based on the residual guidance strategy as described above An interpolation model training method, and/or, an image interpolation method based on a residual guidance strategy as described above.
  • this application provides an image interpolation model training method based on the residual guidance strategy, including: obtaining a high-resolution image; downsampling the high-resolution image to obtain a low-resolution image; generating Pre-interpolation image; make a difference between the high-resolution image and the pre-interpolation image to obtain the initial residual; use the pre-interpolation image and the initial residual to train the random forest; during the training process, the random forest grows synchronously by layer, and the initial residual As the residual of the first level, at any level of the random forest, learn the mapping relationship between the pre-interpolated image and the residual of the current level to generate an estimated residual, and make a difference between the residual of the current level and the estimated residual to obtain the next level Residual error; when the training termination condition is reached, output a random forest with determined mapping relationships at each level as an image interpolation model.
  • this method is based on the characteristics of the random forest hierarchy, and uses the residual guide strategy to build and train the image interpolation model.
  • the random forest is trained using the pre-interpolated image as the feature data and the residual as the label data.
  • the initial residual is the difference between the high-resolution image and the pre-interpolated image.
  • the residual of the latter level is the difference between the residual of the previous level and the estimated residual of the previous level. Since the residual can be updated in iterations, the estimated residual of each level is an optimization of the residual of the previous level.
  • the image residual converges to zero, and finally an image interpolation model with definite mapping relationship at each level is obtained. Using it to interpolate low-resolution images can significantly improve the interpolation effect.
  • the present application also provides an image interpolation method based on a residual guidance strategy, a computer device and a readable storage medium, the technical effects of which are corresponding to those of the above method, and will not be repeated here.
  • FIG. 1 is an overall flow chart of Embodiment 1 of the image interpolation model training method based on the residual guidance strategy provided by the present application;
  • Embodiment 2 is a schematic diagram of the data preprocessing process in Embodiment 1 of the image interpolation model training method based on the residual guidance strategy provided by the present application;
  • Fig. 3 is a schematic diagram of the random forest layer-by-layer training process provided by the application.
  • FIG. 4 is a flowchart of Embodiment 1 of an image interpolation method based on a residual guidance strategy provided by the present application;
  • FIG. 5 is a schematic diagram of an image interpolation process according to a training result provided by the present application.
  • the goal of image interpolation is to transform a low-resolution image into a high-resolution image while maintaining as much detail and structure as possible in the original low-resolution image.
  • This application implements image interpolation through machine learning models.
  • training a model is to let it learn the mapping relationship between the feature data X and the label data Y, but the model M we choose may have limitations in its learning ability, resulting in a bottleneck in its predictive ability, and Using the residual bootstrap strategy can help the model break through the limitations.
  • the residual as the difference between the true value and the predicted value, reflects the insufficient prediction of the model for the data, and also provides a basis for revising the model.
  • Using the residual instead of the true value as the label to participate in the training is no different from directly using the true value as the label, but the residual has a remarkable feature, that is, it can be updated in iterations. Therefore, this application allows the model to be expanded under the guidance of residuals, and the new model refines the previous residuals, and the final model obtained after repeated iterations will produce better prediction results. According to this strategy, the estimated value of the model output will continue to approach the true value.
  • the first-level model M (1) cannot make perfect predictions, a new residual error must be generated, which is represented by ⁇ , and then the second model M (2) is used to learn this part of the residual error.
  • M (2) make up for the deficiency of M (1) , and a new residual error will be generated at this time, but ideally, each component of this residual error will be smaller than before. And so on.
  • the strength of each component of the remaining residual ⁇ is almost 0 at this time, that is to say, after each iteration is perfected, the predicted value of the model approaches the true value. This is the overall idea of the residual guidance strategy.
  • the core of the present application is to provide an image interpolation model training method based on a residual guidance strategy, an image interpolation method based on a residual guidance strategy, computer equipment and a readable storage medium.
  • a residual bootstrap strategy is applied to build and train the model. Theoretically, as the training level increases, the image residual converges to zero, so that the interpolation effect can be improved.
  • each level saves the corresponding regression function, that is, the mapping relationship between the low-resolution image block and the residual image block at the current stage. In the interpolation stage, the residuals are predicted by using the mapping relationship of each level.
  • the estimated residuals of each level are the optimization of the residuals of the previous level.
  • the reconstruction of the image guarantees the quality of the reconstruction.
  • Embodiment 1 of the method for training an image interpolation model based on a residual guidance strategy provided by this application is introduced below.
  • embodiment one comprises the following steps:
  • the above-mentioned pre-interpolated image and the initial residual are preprocessed before being used as training data.
  • the preprocessing process includes but is not limited to: sampling the pre-interpolation image to obtain a feature vector for training; sampling the initial residual to obtain a residual vector for training.
  • the training data can be grouped according to certain rules.
  • the entire random forest is also divided into multiple groups of random forests to ensure that the number of groups of training data is equal to the number of groups of the random forest.
  • a set of training data trains a set of random forests.
  • the fixed point distribution pattern contained in the sampling result is mainly affected by the sampling rules. Assuming that the sampling method is: sampling with a step size of 1 interval, then there are four fixed point distribution patterns contained in the sampling result. At this time, the number of groups of the feature vector is 4, and the number of groups of the random forest is also 4.
  • the image interpolation model can be allowed to include a multi-level random forest, that is, the structure of the image interpolation model is a cascaded random forest.
  • Each level of random forest is trained as described above.
  • the pre-interpolation image of the first level of random forest is an image generated by using a preset interpolation algorithm. This embodiment does not limit the selection of What kind of image interpolation algorithm; for any k ⁇ [2,K], the pre-interpolation image of the k-th random forest is the image obtained by sequential interpolation of the previous k-1 random forest.
  • this embodiment provides an image interpolation model training method based on the residual guidance strategy.
  • the initial residual generated by the difference between the pre-interpolation image, the high-resolution image and the pre-interpolation image is used as the input of the random forest.
  • the random forest grows layer by layer, and after the growth of each layer is completed, the residual is refined, that is, a new residual is generated, and the new residual will guide the growth of the next layer of the random forest.
  • the initial residual is the difference between the high-resolution image and the pre-interpolated image, and the residual at the next level is the difference between the residual of the previous level and the estimated residual of the previous level.
  • this embodiment constructs an image interpolation model based on random forest, and trains it based on the residual guidance strategy.
  • the trained model can significantly improve the quality of image interpolation.
  • the preprocessing process of the pre-interpolation image and the initial residual will be introduced in detail below. This is only provided as a feasible preprocessing manner, and this embodiment does not limit the preprocessing manners of the two.
  • the preprocessing process of the pre-interpolated image includes the following steps:
  • the above-mentioned filtering and sampling process can be specifically as follows: filter the pre-interpolation image with a one-dimensional first-order gradient operator and second-order gradient operator to generate four corresponding feature images; sample the four feature images to obtain A feature vector for each sampling location.
  • Figure 2 illustrates the generation process of the first-level residual, that is, the difference between the high-resolution image and the pre-interpolated image is obtained to obtain the initial residual.
  • Figure 2 also illustrates the preprocessing process of the initial residual, including the following steps:
  • a set of training data is used to train a set of random forests, that is, a set of feature vectors and their corresponding residual vectors are used to train a set of random forests.
  • the training process is as follows: For any h ⁇ [1, H], the h-th set of random forests is trained using the h-th set of feature vectors of the pre-interpolated image and the h-th set of residual vectors of the initial residuals.
  • a specific sampling rule may be: sampling at intervals with a step size of 1.
  • the number of groups of feature vectors is 4, that is, the value of H above is 4.
  • the random forest is divided into 4 groups.
  • the training process of the random forest is introduced in detail below. This is only provided as a feasible training method, and this embodiment does not limit what kind of training method is adopted.
  • the random forest grows synchronously by layers.
  • the pre-interpolation image X and the first level residual R (1) are used as training data, and the nodes of the first level of random forest learn the mapping relationship between them, according to the mapping relationship
  • the estimated residual for the first-level residual R (1) can be obtained
  • the pre-interpolated image X and the second-level residual R (2) are used as training data, and so on.
  • the process of learning the mapping relationship between the pre-interpolation image and the residual of the current level and then generating the estimated residual specifically includes the following steps:
  • S45 Determine that the target node belongs to an internal node, and enter the next level through node splitting; during the node splitting process, randomly select splitting parameters and split the target node, determine the optimal splitting parameter according to the amount of error reduction before and after splitting, and record the target node optimal splitting parameters.
  • the node not only calculates the linear transformation between the feature vector contained in itself and the residual vector contained in itself, but also superimposes the linear transformation of all its ancestor nodes, and further calculates the feature vector contained in itself
  • the linear transformation between the vector and the target residual vector, the target residual vector is the residual vector that intersects with this node among all the residual vectors. Therefore, in this embodiment, only leaf nodes need to record linear transformations, and internal nodes do not need to record their linear transformations. It can be understood that since the leaf nodes do not need to continue splitting, the leaf nodes do not need to record the optimal splitting parameters, only the internal nodes need to record the optimal splitting parameters.
  • the linear transformation calculated at each level will be superimposed on the linear transformation of its child nodes (that is, the above-mentioned process of generating the second linear transformation based on the first linear transformation).
  • the linear transformation calculated by the child nodes can be used for The refinement of the linear transformation of the parent node is based on the fact that the residual is additive, and the linear transformation calculated from the residual can also be superimposed.
  • the image interpolation model is a K-level cascaded random forest, and each level of random forest is divided into four groups of random forests.
  • the input and output of embodiment two are as follows:
  • Input training image dataset, maximum height/level L of random forest, number N of decision trees contained in random forest, maximum number of stages K of cascaded random forest.
  • the whole training process is divided into three stages: the data preparation stage, the first-level random forest training stage, and the remaining random forest training stages. Each stage is described below.
  • S403 use the Bicubic algorithm to pre-interpolate the low-resolution image so that it has the same size as the original image, and use the pre-interpolation image Instead of low-resolution images as feature data to participate in training.
  • the forms of the first-order gradient operator and the second-order gradient operator are as follows:
  • the form of the residual matrix is as follows:
  • edge image blocks filter out the feature vectors whose intensity values of the edge pixels are greater than 0, and keep the corresponding feature vectors and residual image blocks.
  • Each level of random forest contains 4 groups of random forests, and the 4 groups of random forests correspond to four different fixed point patterns.
  • all the feature vectors X are trained together in the first-level random forest, but in detail, all the feature vectors X are divided into four groups according to the pattern X 1 , X 2 , X 3 , and X 4 respectively train four groups in the same level of random forest random forest.
  • x i is the i-th eigenvector in X ⁇ , and all Flatten into a matrix by column
  • the node splitting process is as follows:
  • Node ⁇ contains data By solving the following formula to get from X ⁇ to The linear transformation of , that is, the first linear transformation mentioned above:
  • the ancestor nodes of node ⁇ have completed the training, and obtained corresponding linear transformations, and combined these linear transformations with accumulated That is, X ⁇ to The linear transformation of , that is, the second linear transformation mentioned above, where Refers to The residual vector that intersects with node ⁇ .
  • ⁇ (i) refers to the ancestor node of node ⁇
  • ⁇ (0) is the root node of node ⁇
  • ⁇ (l-1) is the parent node of node ⁇
  • ⁇ (l) is node ⁇ .
  • node ⁇ is marked as a leaf node, and W ⁇ is stored for use in the interpolation stage.
  • represents a gray value threshold. In practical applications, the gray value is normalized to [0,1], so ⁇ [0,1].
  • the training results are different. That is to say, the training results of different decision trees in the same random forest are different.
  • the training results specifically refer to: the optimal splitting parameters stored in the root node and internal nodes and the mapping relationship stored in the leaf nodes.
  • the residual refinement mentioned in this embodiment refers to the process of determining the residual of the next level according to the residual of the current level.
  • K the image interpolation model whose mapping relations at all levels are determined.
  • K may take a value of 4.
  • this embodiment provides an image interpolation model training method based on the residual guidance strategy.
  • the purpose is to obtain a high-resolution image from a low-resolution image, and to ensure that the interpolated image has both objective indicators and subjective perception. greatly improved.
  • This embodiment mainly describes the implementation process of the offline training phase. During the construction of each decision tree, a series of node splitting and data refining steps are iteratively executed. The data refining phase includes data division and residual update. The updated residual will be for training at the next level.
  • a cascading strategy is also introduced to further improve the quality of image interpolation, and the cascading strategy is analyzed from a high scale. It also uses image residuals to guide the training of the model.
  • this embodiment includes the following steps:
  • the given low-resolution images will be sequentially passed through the trained cascade random forest and the interpolation will be completed.
  • the image is divided from top to bottom in each decision tree in the form of feature vectors, and each feature vector is passed to the leaf node, and then the linear transformation stored in it is used to generate an estimated residual value. Difference, the estimated residual after recombination is superimposed on the pre-interpolation image, and the interpolation result of the current level of random forest is obtained.
  • the entire interpolation process is divided into two stages: a data preparation stage and an image interpolation stage.
  • the two stages are described below.
  • each decision tree Finally, an estimated residual matrix is output In order to distinguish the prediction results of different decision trees, the residual matrix estimated by the nth decision tree is recorded as by random forest The estimate for the residual is
  • the specific method is to use the Bicubic algorithm to interpolate the Cb channel and Cr channel images of the low-resolution image, and then combine the three-channel images and convert them to the RGB color space.
  • the present application also provides a computer device, including:
  • memory used to store computer programs
  • Processor configured to execute the computer program to implement the above-mentioned method for training an image interpolation model based on a residual-guided strategy, and/or, the above-mentioned method for image interpolation based on a residual-guided strategy.
  • the present application provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is used to realize the image interpolation based on the residual guidance strategy as described above
  • each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other.
  • the description is relatively simple, and for the related information, please refer to the description of the method part.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other Any other known storage medium.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

An image interpolation model training method based on a residual-guided policy, an image interpolation method based on a residual-guided policy, a computer device, and a readable storage medium. On the basis of characteristics of a random forest level structure, the residual-guided policy is used to construct and train the image interpolation model. A pre-interpolated image is used as feature data, and a residual is used as label data to train a random forest; the random forest grows synchronously according to levels in the training process; an initial residual is a difference between a high-resolution image and the pre-interpolated image, and a later residual is a difference between an upper-level residual and an estimated residual; because the residual can be updated in iteration, the estimated residual of each level is the optimization of the previous-level residual; an image residual is converged to zero along with the increase of a training level; and finally, the image interpolation model with the determined mapping relationship of each level is obtained. A good interpolation effect can be obtained by using the image interpolation model to interpolate the low-resolution image.

Description

一种基于残差引导策略的图像插值模型训练方法A Training Method of Image Interpolation Model Based on Residual Guidance Strategy
本申请要求于2021年07月22日提交至中国专利局、申请号为202110830807.8、发明名称为“一种基于残差引导策略的图像插值模型训练方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110830807.8 and the title of the invention "A Method for Training Image Interpolation Model Based on Residual Guidance Strategy" submitted to the China Patent Office on July 22, 2021, the entire content of which Incorporated in this application by reference.
技术领域technical field
本申请涉及计算机技术领域,特别涉及一种基于残差引导策略的图像插值模型训练方法、基于残差引导策略的图像插值方法、计算机设备及可读存储介质。The present application relates to the field of computer technology, in particular to an image interpolation model training method based on a residual guidance strategy, an image interpolation method based on a residual guidance strategy, computer equipment, and a readable storage medium.
背景技术Background technique
图像采集设备由于在硬件设计和造价方面的限制,所获取的数字图像中的一些感兴趣区域的分辨率可能较低。图像插值是将低分辨率图像复原成高分辨率图像且尽可能保持原低分辨率图像的细节和结构的方法。Due to limitations in hardware design and cost of image acquisition equipment, the resolution of some regions of interest in the acquired digital images may be low. Image interpolation is a method of restoring a low-resolution image to a high-resolution image and maintaining the details and structure of the original low-resolution image as much as possible.
尽管传统的双线性和双三次插值(Bicubic)方法能够实现图像插值,但是其插值结果在图像边缘处将出现明显的人工痕迹,并且有较多的含噪声和模糊的区域。为了提高插值表现,需要考虑更多的先验信息,比如有基于边缘引导的插值方法,也有基于局部或非局部的像素或图像块的图像插值方法。然而,根据对比标准图像和各种方法插值结果做差的残差图像分析可知,近些年提出的插值方法在平滑区域有较好的插值结果,但在边缘区域插值结果不佳。Although the traditional bilinear and bicubic interpolation (Bicubic) methods can realize image interpolation, the interpolation results will have obvious artificial traces at the edge of the image, and there are many areas containing noise and blur. In order to improve interpolation performance, more prior information needs to be considered, such as edge-guided interpolation methods, and image interpolation methods based on local or non-local pixels or image blocks. However, according to the residual image analysis comparing the standard image and the poor interpolation results of various methods, it can be seen that the interpolation methods proposed in recent years have better interpolation results in smooth areas, but poor interpolation results in edge areas.
综上,当前的图像插值方法的效果不理想,如何提升图像插值效果,是亟待本领域技术人员解决的问题。To sum up, the effect of the current image interpolation method is not ideal, and how to improve the image interpolation effect is an urgent problem to be solved by those skilled in the art.
发明内容Contents of the invention
本申请的目的是提供一种基于残差引导策略的图像插值模型训练方法、基于残差引导策略的图像插值方法、计算机设备及可读存储介质,用以解决当前的图像插值方案的插值效果不理想的问题。其具体方案如下:The purpose of this application is to provide an image interpolation model training method based on a residual-guided strategy, an image interpolation method based on a residual-guided strategy, computer equipment, and a readable storage medium to solve the problem of poor interpolation effects of current image interpolation schemes Ideal question. The specific plan is as follows:
第一方面,本申请提供了一种基于残差引导策略的图像插值模型训练方法,包括:In the first aspect, the present application provides a method for training an image interpolation model based on a residual guidance strategy, including:
获取高分辨率图像;对所述高分辨率图像进行降采样,得到低分辨率 图像;根据所述低分辨率图像,生成预插值图像;Obtaining a high-resolution image; down-sampling the high-resolution image to obtain a low-resolution image; generating a pre-interpolation image according to the low-resolution image;
对所述高分辨率图像和所述预插值图像做差,得到初始残差;Making a difference between the high-resolution image and the pre-interpolation image to obtain an initial residual;
利用所述预插值图像和所述初始残差对随机森林进行训练;在训练过程中,所述随机森林按层同步生长,所述初始残差作为第一层级残差,在所述随机森林的任意层级,学习所述预插值图像与当前层级残差之间的映射关系进而生成估计残差,对所述当前层级残差与所述估计残差做差,得到下一层级残差;Use the pre-interpolation image and the initial residual to train the random forest; during the training process, the random forest grows synchronously by layers, and the initial residual is used as the first-level residual, in the random forest At any level, learn the mapping relationship between the pre-interpolation image and the residual of the current level to generate an estimated residual, and make a difference between the residual of the current level and the estimated residual to obtain the residual of the next level;
在达到训练终止条件时,输出各层级映射关系均确定的随机森林,以作为图像插值模型。When the training termination condition is reached, the random forest whose mapping relationship at each level is determined is output as an image interpolation model.
可选的,所述随机森林被划分为多组随机森林,所述利用所述预插值图像和所述初始残差对随机森林进行训练,包括:Optionally, the random forest is divided into multiple groups of random forests, and the training of the random forest by using the pre-interpolation image and the initial residual includes:
生成所述预插值图像的特征向量;generating a feature vector of the pre-interpolated image;
按照不动点分布模式,对所述特征向量进行分组,其中所述特征向量的分组数量等于所述随机森林的分组数量;According to the fixed point distribution mode, the feature vectors are grouped, wherein the number of groups of the feature vectors is equal to the number of groups of the random forest;
在训练所述随机森林时,每组所述特征向量和所述初始残差中相应的残差向量训练一组随机森林。When training the random forest, a group of random forests are trained for each set of feature vectors and corresponding residual vectors in the initial residual.
可选的,所述生成所述预插值图像的特征向量,包括:Optionally, the generating the feature vector of the pre-interpolation image includes:
利用一维的一阶梯度算子和二阶梯度算子对所述预插值图像进行滤波,生成对应的四幅特征图像;对所述四幅特征图像进行采样,得到每个采样位置的特征向量。Filtering the pre-interpolation image by using a one-dimensional first-order gradient operator and a second-order gradient operator to generate four corresponding feature images; sampling the four feature images to obtain a feature vector of each sampling position.
可选的,所述四幅特征图像的采样方式具体为:以步长为1间隔地进行采样;Optionally, the sampling method of the four feature images is specifically: sampling at intervals with a step size of 1;
相应的,所述不动点分布模式有4种,所述特征向量的分组数量和所述随机森林的分组数量均为4。Correspondingly, there are four fixed point distribution patterns, and the number of groups of the feature vector and the number of groups of the random forest are both 4.
可选的,所述图像插值模型具体包括K级所述随机森林;第一级随机森林的预插值图像为利用预设插值算法生成的图像,对于任意k∈[2,K],第k级随机森林的预插值图像为经过前k-1级随机森林依次进行插值得到的图像。Optionally, the image interpolation model specifically includes the K-level random forest; the pre-interpolation image of the first-level random forest is an image generated using a preset interpolation algorithm, and for any k∈[2,K], the k-th level The pre-interpolation image of the random forest is the image obtained by sequential interpolation of the previous k-1 random forest.
可选的,所述图像插值模型中,不同级随机森林的高分辨率图像不同。Optionally, in the image interpolation model, the high-resolution images of random forests at different levels are different.
可选的,所述随机森林按层同步生长,包括:Optionally, the random forest grows synchronously by layers, including:
在所述随机森林的任意层级,判断是否存在未被处理的目标节点;At any level of the random forest, judging whether there is an unprocessed target node;
若存在,生成从所述目标节点包含的特征向量到所述目标节点包含的残差向量的第一线性变换,进而生成从所述目标节点包含的特征向量到目标残差向量的第二线性变换,其中所述目标残差向量为与所述目标节点有交集的残差向量;If it exists, generate the first linear transformation from the feature vector contained in the target node to the residual vector contained in the target node, and then generate the second linear transformation from the feature vector contained in the target node to the target residual vector , wherein the target residual vector is a residual vector that intersects with the target node;
若不存在,则判断是否达到分裂终止条件;If it does not exist, it is judged whether the split termination condition is reached;
若达到,则确定所述目标节点属于叶子节点,并记录所述目标节点的第二线性变换,最终全部叶子节点的第二线性变换即所述预插值图像与各层级残差之和之间的映射关系;If it is reached, it is determined that the target node belongs to a leaf node, and the second linear transformation of the target node is recorded, and finally the second linear transformation of all leaf nodes is the difference between the pre-interpolation image and the sum of the residuals of each level Mapping relations;
若未达到,则确定所述目标节点属于内部节点,并通过节点分裂进入下一层级;在节点分裂过程中,随机选取分裂参数并对所述目标节点进行分裂,根据分裂前后误差减少量确定最优分裂参数,记录所述目标节点的最优分裂参数。If not, determine that the target node belongs to an internal node, and enter the next level through node splitting; in the process of node splitting, randomly select the splitting parameters and split the target node, and determine the optimal node according to the amount of error reduction before and after splitting optimal splitting parameter, record the optimal splitting parameter of the target node.
第二方面,本申请提供了一种基于残差引导策略的图像插值方法,包括:In the second aspect, the present application provides an image interpolation method based on a residual guidance strategy, including:
获取待插值的低分辨率图像;Obtain the low-resolution image to be interpolated;
根据所述低分辨率图像,生成预插值图像;generating a pre-interpolated image according to the low-resolution image;
将所述预插值图像输入训练好的随机森林;在所述随机森林的任意层级,根据训练过程中学习到的预插值图像与当前层级残差之间的映射关系生成估计残差;Input the pre-interpolated image into the trained random forest; at any level of the random forest, generate an estimated residual according to the mapping relationship between the pre-interpolated image learned in the training process and the residual of the current level;
根据各层级的所述估计残差和所述预插值图像,生成所述低分辨率图像的插值图像。An interpolated image of the low-resolution image is generated according to the estimated residual of each level and the pre-interpolated image.
第三方面,本申请提供了一种计算机设备,其特征在于,包括:In a third aspect, the present application provides a computer device, which is characterized in that it includes:
存储器:用于存储计算机程序;memory: used to store computer programs;
处理器:用于执行所述计算机程序,以实现如上所述的基于残差引导策略的图像插值模型训练方法,和/或,如上所述的基于残差引导策略的图像插值方法。Processor: configured to execute the computer program to implement the above-mentioned method for training an image interpolation model based on a residual-guided strategy, and/or the above-mentioned image interpolation method based on a residual-guided strategy.
第四方面,本申请提供了一种可读存储介质,所述可读存储介质上存 储有计算机程序,所述计算机程序被处理器执行时用于实现如上所述的基于残差引导策略的图像插值模型训练方法,和/或,如上所述的基于残差引导策略的图像插值方法。In a fourth aspect, the present application provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, it is used to implement the image based on the residual guidance strategy as described above An interpolation model training method, and/or, an image interpolation method based on a residual guidance strategy as described above.
综上,本申请提供一种基于残差引导策略的图像插值模型训练方法,包括:获取高分辨率图像;对高分辨率图像进行降采样,得到低分辨率图像;根据低分辨率图像,生成预插值图像;对高分辨率图像和预插值图像做差,得到初始残差;利用预插值图像和初始残差对随机森林进行训练;在训练过程中,随机森林按层同步生长,初始残差作为第一层级残差,在随机森林的任意层级,学习预插值图像与当前层级残差之间的映射关系进而生成估计残差,对当前层级残差与估计残差做差,得到下一层级残差;在达到训练终止条件时,输出各层级映射关系均确定的随机森林,以作为图像插值模型。To sum up, this application provides an image interpolation model training method based on the residual guidance strategy, including: obtaining a high-resolution image; downsampling the high-resolution image to obtain a low-resolution image; generating Pre-interpolation image; make a difference between the high-resolution image and the pre-interpolation image to obtain the initial residual; use the pre-interpolation image and the initial residual to train the random forest; during the training process, the random forest grows synchronously by layer, and the initial residual As the residual of the first level, at any level of the random forest, learn the mapping relationship between the pre-interpolated image and the residual of the current level to generate an estimated residual, and make a difference between the residual of the current level and the estimated residual to obtain the next level Residual error; when the training termination condition is reached, output a random forest with determined mapping relationships at each level as an image interpolation model.
可见,该方法基于随机森林层级结构的特点,利用残差引导策略来构建并训练图像插值模型。具体的,使用预插值图像作为特征数据并使用残差作为标签数据对随机森林进行训练,训练过程中随机森林按层同步生长,初始残差为高分辨率图像与预插值图像的差值,往后层级的残差则是上一级残差与上一级估计残差的差值,由于残差能够在迭代中更新,每一级的估计残差均是对前一级残差的优化,随着训练层级的增加,图像残差收敛于零,最终得到各层级映射关系均确定的图像插值模型,利用其对低分辨率图像进行插值,能够显著提升插值效果。It can be seen that this method is based on the characteristics of the random forest hierarchy, and uses the residual guide strategy to build and train the image interpolation model. Specifically, the random forest is trained using the pre-interpolated image as the feature data and the residual as the label data. During the training process, the random forest grows synchronously by layer. The initial residual is the difference between the high-resolution image and the pre-interpolated image. The residual of the latter level is the difference between the residual of the previous level and the estimated residual of the previous level. Since the residual can be updated in iterations, the estimated residual of each level is an optimization of the residual of the previous level. With the increase of the training level, the image residual converges to zero, and finally an image interpolation model with definite mapping relationship at each level is obtained. Using it to interpolate low-resolution images can significantly improve the interpolation effect.
此外,本申请还提供了一种基于残差引导策略的图像插值方法、计算机设备及可读存储介质,其技术效果与上述方法的技术效果相对应,这里不再赘述。In addition, the present application also provides an image interpolation method based on a residual guidance strategy, a computer device and a readable storage medium, the technical effects of which are corresponding to those of the above method, and will not be repeated here.
附图说明Description of drawings
为了更清楚的说明本申请实施例或现有技术的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are only For some embodiments of the present application, those of ordinary skill in the art can also obtain other drawings based on these drawings without creative effort.
图1为本申请提供的基于残差引导策略的图像插值模型训练方法实施例一的整体流程图;FIG. 1 is an overall flow chart of Embodiment 1 of the image interpolation model training method based on the residual guidance strategy provided by the present application;
图2为本申请提供的基于残差引导策略的图像插值模型训练方法实施例一中数据预处理过程的示意图;2 is a schematic diagram of the data preprocessing process in Embodiment 1 of the image interpolation model training method based on the residual guidance strategy provided by the present application;
图3为本申请提供的随机森林逐层训练过程示意图;Fig. 3 is a schematic diagram of the random forest layer-by-layer training process provided by the application;
图4为本申请提供的基于残差引导策略的图像插值方法实施例一的流程图;FIG. 4 is a flowchart of Embodiment 1 of an image interpolation method based on a residual guidance strategy provided by the present application;
图5为本申请提供的根据训练结果对图像进行插值的过程示意图。FIG. 5 is a schematic diagram of an image interpolation process according to a training result provided by the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请方案,下面结合附图和具体实施方式对本申请作进一步的详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the drawings and specific implementation methods. Apparently, the described embodiments are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
概括地说,图像插值的目标是将低分辨率图像转变成高分辨率图像且尽可能保持原低分辨率图像中的细节和结构。本申请通过机器学习模型来实现图像插值。通常,训练一个模型,就是让它从特征数据X和标签数据Y学习二者之间的映射关系,但是我们所选的模型M,其学习能力可能存在局限性,导致其预测能力存在瓶颈,而运用残差引导策略则可以帮助模型突破限制。In a nutshell, the goal of image interpolation is to transform a low-resolution image into a high-resolution image while maintaining as much detail and structure as possible in the original low-resolution image. This application implements image interpolation through machine learning models. Usually, training a model is to let it learn the mapping relationship between the feature data X and the label data Y, but the model M we choose may have limitations in its learning ability, resulting in a bottleneck in its predictive ability, and Using the residual bootstrap strategy can help the model break through the limitations.
残差作为真值与预测值之间的差值,反映了模型对于数据预测不足的地方,也提供了修正模型的依据。使用残差代替真值作为标签参与训练与直接使用真值作为标签无异,但残差具备一个显著的特点,即能够在迭代中更新。所以,本申请让模型在残差引导下进行拓展,新的模型再对之前的残差进行精炼,反复迭代后得到的最终模型将产出更优的预测结果。按照该策略,模型输出的估计值将会不断逼近真值。如果第一级模型M (1)不能完美的做出预测,那么必然产生新的残差,这里用ε表示,对此再利用第二模型M (2)针对这一部分残差进行学习。让M (2)能够弥补M (1)的不足, 此时又会产生新的残差,但理想情况下该残差各分量将会比之前要小。如此进行下去。直至第n级模型,此时剩余的残差ε各分量的强度已经几乎为0,也就是说在一次次迭代完善后,模型的预测值逼近了真值。这就是残差引导策略的整体思路。 The residual, as the difference between the true value and the predicted value, reflects the insufficient prediction of the model for the data, and also provides a basis for revising the model. Using the residual instead of the true value as the label to participate in the training is no different from directly using the true value as the label, but the residual has a remarkable feature, that is, it can be updated in iterations. Therefore, this application allows the model to be expanded under the guidance of residuals, and the new model refines the previous residuals, and the final model obtained after repeated iterations will produce better prediction results. According to this strategy, the estimated value of the model output will continue to approach the true value. If the first-level model M (1) cannot make perfect predictions, a new residual error must be generated, which is represented by ε, and then the second model M (2) is used to learn this part of the residual error. Let M (2) make up for the deficiency of M (1) , and a new residual error will be generated at this time, but ideally, each component of this residual error will be smaller than before. And so on. Up to the nth-level model, the strength of each component of the remaining residual ε is almost 0 at this time, that is to say, after each iteration is perfected, the predicted value of the model approaches the true value. This is the overall idea of the residual guidance strategy.
本申请的核心是提供一种基于残差引导策略的图像插值模型训练方法、基于残差引导策略的图像插值方法、计算机设备及可读存储介质。利用随机森林层级结构的特点,应用残差引导策略来构建并训练模型。理论上,随着训练层级的增加,图像残差收敛于零,从而可以实现对插值效果的改善。训练过程中各层级均保存了对应的回归函数,即低分辨率图像块与当前阶段残差图像块的映射关系。在插值阶段,利用各层级映射关系来预测残差,鉴于模型训练的收敛性质,每一层级的估计残差均是对前一层级残差的优化,通过融合各层级的估计残差,完成对图像的重建并保证了重建的质量。大量的实验结果表明本申请能够提供高精度且主观感觉良好的插值图像。The core of the present application is to provide an image interpolation model training method based on a residual guidance strategy, an image interpolation method based on a residual guidance strategy, computer equipment and a readable storage medium. Utilizing the characteristics of the random forest hierarchy, a residual bootstrap strategy is applied to build and train the model. Theoretically, as the training level increases, the image residual converges to zero, so that the interpolation effect can be improved. During the training process, each level saves the corresponding regression function, that is, the mapping relationship between the low-resolution image block and the residual image block at the current stage. In the interpolation stage, the residuals are predicted by using the mapping relationship of each level. In view of the convergence nature of model training, the estimated residuals of each level are the optimization of the residuals of the previous level. The reconstruction of the image guarantees the quality of the reconstruction. A large number of experimental results show that this application can provide interpolation images with high precision and good subjective feeling.
下面对本申请提供的基于残差引导策略的图像插值模型训练方法实施例一进行介绍。 Embodiment 1 of the method for training an image interpolation model based on a residual guidance strategy provided by this application is introduced below.
参见图1,实施例一包括以下步骤:Referring to Fig. 1, embodiment one comprises the following steps:
S11、获取高分辨率图像;对高分辨率图像进行降采样,得到低分辨率图像;根据低分辨率图像,生成预插值图像;S11. Obtain a high-resolution image; down-sample the high-resolution image to obtain a low-resolution image; generate a pre-interpolation image based on the low-resolution image;
S12、对高分辨率图像和预插值图像做差,得到初始残差;S12. Perform a difference between the high-resolution image and the pre-interpolation image to obtain an initial residual error;
S13、利用预插值图像和初始残差对随机森林进行训练;在训练过程中,随机森林按层同步生长,初始残差作为第一层级残差,在随机森林的任意层级,学习预插值图像与当前层级残差之间的映射关系进而生成估计残差,对当前层级残差与估计残差做差,得到下一层级残差;S13. Use the pre-interpolation image and the initial residual to train the random forest; during the training process, the random forest grows synchronously by layer, the initial residual is used as the first-level residual, and at any level of the random forest, learn the pre-interpolation image and The mapping relationship between the residuals of the current level and then generate the estimated residuals, and make a difference between the residuals of the current level and the estimated residuals to obtain the residuals of the next level;
S14、在达到训练终止条件时,输出各层级映射关系均确定的随机森林,以作为图像插值模型。S14. When the training termination condition is reached, output a random forest with determined mapping relationships at each level as an image interpolation model.
具体的,为提升效率,上述预插值图像和初始残差经过预处理之后,才作为训练数据。该预处理过程包括但不限于:对预插值图像进行采样, 得到用于训练的特征向量;对初始残差进行采样,得到用于训练的残差向量。Specifically, in order to improve efficiency, the above-mentioned pre-interpolated image and the initial residual are preprocessed before being used as training data. The preprocessing process includes but is not limited to: sampling the pre-interpolation image to obtain a feature vector for training; sampling the initial residual to obtain a residual vector for training.
为进一步提升插值效果,可以按照某种规则对训练数据进行分组,相应的,将全部随机森林也划分为多组随机森林,保证训练数据的分组数量等于随机森林的分组数量,在训练过程中,一组训练数据训练一组随机森林。作为一种具体的实施方式,考虑到图像插值必须保持不动点位置的像素在插值前后数值不发生改变,即插值后图像不动点位置像素的值与低分辨率图像中的值一一对应,所以可以根据预插值图像块的采样结果中包含的不动点分布模式,对特征向量进行分组。此处,采样结果包含的不动点分布模式主要受采样规则影响,假设采样方式为:以步长为1间隔地进行采样,那么,采样结果所包含的不动点分布模式就有4种,此时特征向量的分组数量为4,随机森林的分组数量也为4。In order to further improve the interpolation effect, the training data can be grouped according to certain rules. Correspondingly, the entire random forest is also divided into multiple groups of random forests to ensure that the number of groups of training data is equal to the number of groups of the random forest. During the training process, A set of training data trains a set of random forests. As a specific implementation method, considering that image interpolation must keep the value of the pixel at the fixed point position unchanged before and after interpolation, that is, the value of the pixel at the fixed point position of the image after interpolation corresponds to the value in the low-resolution image one-to-one , so the feature vectors can be grouped according to the fixed point distribution patterns contained in the sampling results of the pre-interpolated image blocks. Here, the fixed point distribution pattern contained in the sampling result is mainly affected by the sampling rules. Assuming that the sampling method is: sampling with a step size of 1 interval, then there are four fixed point distribution patterns contained in the sampling result. At this time, the number of groups of the feature vector is 4, and the number of groups of the random forest is also 4.
上面提及了一种提升插值效果的方式,即将训练数据和随机森林划分为多个分组。下面,再提供另一种提升插值效果的方式,实际应用中,这两种方式可以结合,也可以单独使用。A way to improve the interpolation effect is mentioned above, which is to divide the training data and random forest into multiple groups. Next, another method to improve the interpolation effect is provided. In practical applications, these two methods can be combined or used alone.
为提升插值效果,可以允许图像插值模型包括多级随机森林,即图像插值模型的结构为级联随机森林。每一级随机森林均按照如上所述的方式进行训练,需要说明的是,在训练过程中,第一级随机森林的预插值图像为利用预设插值算法生成的图像,本实施例不限定选用何种图像插值算法;对于任意k∈[2,K],第k级随机森林的预插值图像为经过前k-1级随机森林依次进行插值得到的图像。In order to improve the interpolation effect, the image interpolation model can be allowed to include a multi-level random forest, that is, the structure of the image interpolation model is a cascaded random forest. Each level of random forest is trained as described above. It should be noted that during the training process, the pre-interpolation image of the first level of random forest is an image generated by using a preset interpolation algorithm. This embodiment does not limit the selection of What kind of image interpolation algorithm; for any k∈[2,K], the pre-interpolation image of the k-th random forest is the image obtained by sequential interpolation of the previous k-1 random forest.
在此基础之上,为避免过拟合,不同级的随机森林选用不同的高分辨率图像。On this basis, in order to avoid overfitting, different levels of random forests use different high-resolution images.
综上,本实施例提供的一种基于残差引导策略的图像插值模型训练方法,将预插值图像、高分辨率图像与预插值图像做差生成的初始残差作为随机森林的输入,在训练过程中随机森林逐层生长,在每层生长完成后进行残差精炼,即生成新的残差,新的残差将引导随机森林下一层的生长。初始残差是高分辨率图像与预插值图像的差值,往后层级的残差则是上一级残差与上一级估计残差的差值。根据这种残差引导的思路,本实施例构 建出基于随机森林的图像插值模型,基于残差引导策略对其进行训练,训练好的模型能够显著图像插值品质。To sum up, this embodiment provides an image interpolation model training method based on the residual guidance strategy. The initial residual generated by the difference between the pre-interpolation image, the high-resolution image and the pre-interpolation image is used as the input of the random forest. During the process, the random forest grows layer by layer, and after the growth of each layer is completed, the residual is refined, that is, a new residual is generated, and the new residual will guide the growth of the next layer of the random forest. The initial residual is the difference between the high-resolution image and the pre-interpolated image, and the residual at the next level is the difference between the residual of the previous level and the estimated residual of the previous level. According to this idea of residual guidance, this embodiment constructs an image interpolation model based on random forest, and trains it based on the residual guidance strategy. The trained model can significantly improve the quality of image interpolation.
在上述实施例一的基础上,下面详细介绍预插值图像和初始残差的预处理过程。这里只作为一种可行的预处理方式提供,本实施例并不限定二者的预处理方式。On the basis of the first embodiment above, the preprocessing process of the pre-interpolation image and the initial residual will be introduced in detail below. This is only provided as a feasible preprocessing manner, and this embodiment does not limit the preprocessing manners of the two.
如图2所示,预插值图像的预处理过程包括以下步骤:As shown in Figure 2, the preprocessing process of the pre-interpolated image includes the following steps:
S21、对预插值图像进行滤波和采样,得到每个采样位置的特征向量;S21. Filter and sample the pre-interpolation image to obtain a feature vector of each sampling position;
具体的,上述滤波和采样的过程具体可以为:利用一维的一阶梯度算子和二阶梯度算子对预插值图像进行滤波,生成对应的四幅特征图像;对四幅特征图像进行采样,得到每个采样位置的特征向量。Specifically, the above-mentioned filtering and sampling process can be specifically as follows: filter the pre-interpolation image with a one-dimensional first-order gradient operator and second-order gradient operator to generate four corresponding feature images; sample the four feature images to obtain A feature vector for each sampling location.
S22、对预插值图像进行边缘检测,得到边缘图像;对边缘图像进行采样,得到边缘图像块;S22. Perform edge detection on the pre-interpolation image to obtain an edge image; sample the edge image to obtain an edge image block;
S23、对预插值图像进行采样,得到预插值图像块;S23. Sampling the pre-interpolation image to obtain a pre-interpolation image block;
S24、根据每个采样位置的边缘图像块对全部采样位置的特征向量进行筛选,筛选出边缘像素强度值大于0的特征向量;S24. Filter the feature vectors of all sampling positions according to the edge image block at each sampling position, and filter out feature vectors whose edge pixel intensity values are greater than 0;
S25、根据全部预插值图像块所包含的不动点分布模式,对筛选后的特征向量进行分组;将特征向量的分组数量记为H,则随机森林也被划分为H组随机森林;S25. Group the filtered feature vectors according to the fixed point distribution patterns included in all pre-interpolated image blocks; record the number of groups of feature vectors as H, and the random forest is also divided into H groups of random forests;
S26、对于任意h∈[1,H],对第h组特征向量进行降维,得到用于训练的预插值图像的特征向量。S26. For any h∈[1,H], perform dimensionality reduction on the hth group of feature vectors to obtain feature vectors of pre-interpolation images used for training.
图2示意了第一层级残差的生成过程,即对高分辨率图像和预插值图像做差,得到初始残差。图2还示意了初始残差的预处理过程,包括以下步骤:Figure 2 illustrates the generation process of the first-level residual, that is, the difference between the high-resolution image and the pre-interpolated image is obtained to obtain the initial residual. Figure 2 also illustrates the preprocessing process of the initial residual, including the following steps:
S31、对初始残差进行采样,得到每个采样位置的残差图像块;S31. Sampling the initial residual to obtain a residual image block at each sampling position;
S32、对于任意h∈[1,H],确定与预插值图像的第h组特征向量相对应的残差图像块,得到初始残差的第h组残差向量。也就是说,依据采样位置将残差向量与降维后的特征向量进行组合,将S26处理后的特征向量与残差向量一一关联起来。S32. For any h∈[1,H], determine the residual image block corresponding to the hth group of feature vectors of the pre-interpolation image, and obtain the hth group of residual vectors of the initial residual. That is to say, the residual vector and the dimension-reduced feature vector are combined according to the sampling position, and the feature vector processed in S26 is associated with the residual vector one by one.
如前文所述,一组训练数据用于训练一组随机森林,即一组特征向量及其相应的残差向量用于训练一组随机森林。所以,详细地讲,训练过程如下:对于任意h∈[1,H],利用预插值图像的第h组特征向量和初始残差的第h组残差向量对第h组随机森林进行训练。As mentioned above, a set of training data is used to train a set of random forests, that is, a set of feature vectors and their corresponding residual vectors are used to train a set of random forests. So, in detail, the training process is as follows: For any h ∈ [1, H], the h-th set of random forests is trained using the h-th set of feature vectors of the pre-interpolated image and the h-th set of residual vectors of the initial residuals.
需要说明的是,图2中,预插值图像、边缘图像和残差图像的采样方式相同。作为一种具体的实施方式,具体的采样规则可以为:以步长为1间隔地进行采样。此时,预插值图像采样结果所包含的不动点分布模式有4种,特征向量的分组数量为4,即上述H取值为4,相应的,随机森林被划分为4组。It should be noted that, in FIG. 2 , the sampling methods of the pre-interpolation image, the edge image and the residual image are the same. As a specific implementation manner, a specific sampling rule may be: sampling at intervals with a step size of 1. At this time, there are 4 fixed point distribution patterns contained in the pre-interpolation image sampling results, and the number of groups of feature vectors is 4, that is, the value of H above is 4. Correspondingly, the random forest is divided into 4 groups.
在上述实施例一的基础上,下面详细介绍随机森林的训练过程。这里只作为一种可行的训练方式提供,本实施例并不限定采取何种训练方式。On the basis of the first embodiment above, the training process of the random forest is introduced in detail below. This is only provided as a feasible training method, and this embodiment does not limit what kind of training method is adopted.
如S13所述,本实施例的训练过程中,随机森林按层同步生长。如图3所示,在第一层级中,预插值图像X和第一层级残差R (1)作为训练数据,随机森林第一层级的节点学习二者之间的映射关系,根据该映射关系可以得到对第一层级残差R (1)的估计残差
Figure PCTCN2021125577-appb-000001
对第一层级残差R (1)和估计残差
Figure PCTCN2021125577-appb-000002
做差,得到精炼残差F以作为第二层级残差R (2)。在第二级随机森林中,预插值图像X和第二级残差R (2)作为训练数据,依次类推。
As described in S13, during the training process of this embodiment, the random forest grows synchronously by layers. As shown in Figure 3, in the first level, the pre-interpolation image X and the first level residual R (1) are used as training data, and the nodes of the first level of random forest learn the mapping relationship between them, according to the mapping relationship The estimated residual for the first-level residual R (1) can be obtained
Figure PCTCN2021125577-appb-000001
For the first-level residual R (1) and the estimated residual
Figure PCTCN2021125577-appb-000002
Do the difference to obtain the refined residual F as the second level residual R (2) . In the second-level random forest, the pre-interpolated image X and the second-level residual R (2) are used as training data, and so on.
上述S13中,在随机森林的任意层级,学习预插值图像与当前层级残差之间的映射关系进而生成估计残差的过程,具体包括以下步骤:In the above S13, at any level of the random forest, the process of learning the mapping relationship between the pre-interpolation image and the residual of the current level and then generating the estimated residual, specifically includes the following steps:
S40、对于任意h∈[1,H],利用预插值图像的第h组特征向量和初始残差的第h组残差向量,初始化第h组随机森林全部决策树的根节点;S40. For any h∈[1, H], initialize the root nodes of all decision trees of the random forest of the hth group by using the hth group of feature vectors of the pre-interpolation image and the hth group of residual vectors of the initial residual;
S41、控制全部决策树按层同步生长,在随机森林的任意层级,判断是否存在未被处理的目标节点,若存在,进入S42,否则进入S43;S41. Control all the decision trees to grow synchronously by layers. At any level of the random forest, judge whether there is an unprocessed target node. If there is, go to S42, otherwise go to S43;
S42、生成从目标节点包含的特征向量到目标节点包含的残差向量的第一线性变换,进而生成从目标节点包含的特征向量到目标残差向量的第二线性变换,其中目标残差向量为在根节点包含的残差向量中与目标节点有交集的残差向量;S42. Generate a first linear transformation from the feature vector contained in the target node to a residual vector contained in the target node, and then generate a second linear transformation from the feature vector contained in the target node to the target residual vector, wherein the target residual vector is The residual vector that intersects with the target node among the residual vectors contained in the root node;
S43、判断是否达到分裂终止条件,若达到,进入S44,否则进入S45;S43, judging whether the split termination condition is met, if so, proceed to S44, otherwise proceed to S45;
S44、确定目标节点属于叶子节点,并记录目标节点的第二线性变换,最终全部叶子节点的第二线性变换即预插值图像与各层级残差之和之间的映射关系;S44. Determine that the target node belongs to a leaf node, and record the second linear transformation of the target node, and finally the second linear transformation of all leaf nodes is the mapping relationship between the pre-interpolation image and the sum of the residuals of each level;
S45、确定目标节点属于内部节点,并通过节点分裂进入下一层级;在节点分裂过程中,随机选取分裂参数并对目标节点进行分裂,根据分裂前后误差减少量确定最优分裂参数,记录目标节点的最优分裂参数。S45. Determine that the target node belongs to an internal node, and enter the next level through node splitting; during the node splitting process, randomly select splitting parameters and split the target node, determine the optimal splitting parameter according to the amount of error reduction before and after splitting, and record the target node optimal splitting parameters.
可以看出,本实施例中,节点不仅仅计算出自身包含的特征向量与自身包含的残差向量之间的线性变换,还会叠加其全部祖先节点的线性变换,进一步计算出自身包含的特征向量与目标残差向量之间的线性变换,目标残差向量即全部残差向量中与该节点存在交集的残差向量。所以,本实施例中,只需要叶子节点记录线性变换,而内部节点无需记录其线性变换。可以理解的是,由于叶子节点不需要继续分裂,所以叶子节点无需记录最优分裂参数,只需要内部节点记录最优分裂参数即可。It can be seen that in this embodiment, the node not only calculates the linear transformation between the feature vector contained in itself and the residual vector contained in itself, but also superimposes the linear transformation of all its ancestor nodes, and further calculates the feature vector contained in itself The linear transformation between the vector and the target residual vector, the target residual vector is the residual vector that intersects with this node among all the residual vectors. Therefore, in this embodiment, only leaf nodes need to record linear transformations, and internal nodes do not need to record their linear transformations. It can be understood that since the leaf nodes do not need to continue splitting, the leaf nodes do not need to record the optimal splitting parameters, only the internal nodes need to record the optimal splitting parameters.
总之,每一层级计算的线性变换都会被叠加到其子节点的线性变换中(即上述根据第一线性变换生成第二线性变换的过程),换个角度可以认为,子节点计算的线性变换可用于对父节点的线性变换的精炼,其根据在于残差具有可加性,由残差计算出的线性变换同样可以叠加。In short, the linear transformation calculated at each level will be superimposed on the linear transformation of its child nodes (that is, the above-mentioned process of generating the second linear transformation based on the first linear transformation). From another perspective, the linear transformation calculated by the child nodes can be used for The refinement of the linear transformation of the parent node is based on the fact that the residual is additive, and the linear transformation calculated from the residual can also be superimposed.
下面开始详细介绍本申请提供的基于残差引导策略的图像插值模型训练方法实施例二。The second embodiment of the image interpolation model training method based on the residual guidance strategy provided by the present application will be introduced in detail below.
实施例二中,图像插值模型为K级级联随机森林,每一级随机森林划分为四组随机森林。实施例二的输入和输出如下:In the second embodiment, the image interpolation model is a K-level cascaded random forest, and each level of random forest is divided into four groups of random forests. The input and output of embodiment two are as follows:
输入:训练图像数据集、随机森林的最大高度/最大层级L、随机森林中包含的决策树的个数N、级联随机森林的最大级数K。Input: training image dataset, maximum height/level L of random forest, number N of decision trees contained in random forest, maximum number of stages K of cascaded random forest.
输出:训练好的级联随机森林
Figure PCTCN2021125577-appb-000003
其中每个随机森林包含N个决策树,即
Figure PCTCN2021125577-appb-000004
Output: Trained Cascaded Random Forest
Figure PCTCN2021125577-appb-000003
where each random forest contains N decision trees, namely
Figure PCTCN2021125577-appb-000004
本实施例将整个训练过程分为三个阶段:数据准备阶段,第一级随机森林训练阶段,其余级随机森林训练阶段。下面分别对各个阶段进行介绍。In this embodiment, the whole training process is divided into three stages: the data preparation stage, the first-level random forest training stage, and the remaining random forest training stages. Each stage is described below.
第一,数据准备阶段First, the data preparation phase
S401、将高分辨率图像从RGB色彩空间转换到YCbCr色彩空间,之后只针对Y通道图像进行训练。S401. Convert the high-resolution image from the RGB color space to the YCbCr color space, and then perform training only on the Y channel image.
S402、对高分辨率图像{I Y}间隔一个像素降采样来模拟现实条件下获取的低分辨率图像。 S402. Down-sample the high-resolution image {I Y } at intervals of one pixel to simulate a low-resolution image acquired under realistic conditions.
S403、使用Bicubic算法对低分辨率图像进行预插值,使它与原图像具有同等大小,用预插值图像
Figure PCTCN2021125577-appb-000005
代替低分辨率图像作为特征数据参与训练。
S403, use the Bicubic algorithm to pre-interpolate the low-resolution image so that it has the same size as the original image, and use the pre-interpolation image
Figure PCTCN2021125577-appb-000005
Instead of low-resolution images as feature data to participate in training.
S404、通过将对应的高分辨率图像{I Y}与预插值图像
Figure PCTCN2021125577-appb-000006
做差得到残差图像{I R},用它替代高分辨率图像{I Y}作为标签数据参与训练。
S404, by combining the corresponding high-resolution image {I Y } with the pre-interpolation image
Figure PCTCN2021125577-appb-000006
Do the difference to get the residual image {I R }, and use it to replace the high-resolution image {I Y } as the label data to participate in the training.
S405、使用Matlab中的Canny边缘检测函数检测预插值图像边缘,得到边缘图像{I E}。 S405. Use the Canny edge detection function in Matlab to detect the edge of the pre-interpolation image to obtain the edge image {I E }.
S406、根据一维的一阶梯度算子、二阶梯度算子对预插值图像进行滤波,生成对应的四幅特征图像
Figure PCTCN2021125577-appb-000007
在四幅特征图像上以步长为1间隔地采集图像块,每个位置都会生成四个大小为5×5的图像块
Figure PCTCN2021125577-appb-000008
将这些图像块向量化(从5×5转换为25×1),并进行拼接(从4个25×1拼接为100×1),进而得到拼合后的向量
Figure PCTCN2021125577-appb-000009
作为用于训练的特征向量。
S406. Filter the pre-interpolation image according to the one-dimensional first-order gradient operator and second-order gradient operator to generate four corresponding feature images
Figure PCTCN2021125577-appb-000007
Collect image blocks with a step size of 1 on the four feature images, and each position will generate four image blocks of size 5×5
Figure PCTCN2021125577-appb-000008
These image blocks are vectorized (converted from 5×5 to 25×1), and stitched (from 4 25×1 to 100×1), and then the stitched vector is obtained
Figure PCTCN2021125577-appb-000009
as feature vectors for training.
其中,一阶梯度算子、二阶梯度算子的形式如下:Among them, the forms of the first-order gradient operator and the second-order gradient operator are as follows:
Figure PCTCN2021125577-appb-000010
Figure PCTCN2021125577-appb-000010
S407、对预插值图像
Figure PCTCN2021125577-appb-000011
残差图像{I R}和边缘图像{I E}以同样的方式进行采样,得到预插值图像块、残差图像块和边缘图像块。
S407, for the pre-interpolation image
Figure PCTCN2021125577-appb-000011
The residual image {I R } and the edge image {I E } are sampled in the same way to obtain pre-interpolation image blocks, residual image blocks and edge image blocks.
S408、每一个特征向量x i都有对应的残差图像块r i,将特征向量拼合为矩阵X=[x 1,x 2,...,x D],将残差图像块拼合为矩阵,二者构成一组{X,R (1)}共同参与随机森林的训练,其中D为图像块数量,上标0表示处于决策树中的层数,即执行迭代的次数。残差矩阵形式如下: S408. Each eigenvector x i has a corresponding residual image block r i , merge the eigenvectors into a matrix X=[x 1 , x 2 , . . . , x D ], and merge the residual image blocks into a matrix , the two constitute a group of {X, R (1) } to participate in random forest training, where D is the number of image blocks, and the superscript 0 indicates the number of layers in the decision tree, that is, the number of iterations performed. The form of the residual matrix is as follows:
Figure PCTCN2021125577-appb-000012
Figure PCTCN2021125577-appb-000012
S409、根据边缘图像块,筛选出边缘像素的强度值大于0的特征向量,保留对应的特征向量和残差图像块。S409. According to the edge image blocks, filter out the feature vectors whose intensity values of the edge pixels are greater than 0, and keep the corresponding feature vectors and residual image blocks.
S410、根据预插值图像块的采样结果中包含的不动点分布模式,对特 征向量进行分组。这里只有四种分布模式,故将特征向量分为四组。S410. Group the feature vectors according to the fixed point distribution pattern included in the sampling result of the pre-interpolation image block. There are only four distribution modes here, so the eigenvectors are divided into four groups.
S411、使用PCA对不同的组的特征向量分别进行降维,保存下四个PCA矩阵P j(j=1,2,3,4)和降维后的特征矩阵
Figure PCTCN2021125577-appb-000013
S411. Use PCA to reduce the dimensionality of the eigenvectors of different groups, and save the next four PCA matrices P j (j=1, 2, 3, 4) and the dimensionality-reduced feature matrix
Figure PCTCN2021125577-appb-000013
S412、最终得到训练数据,分别用于训练每一级中的四组随机森林,训练数据形式如下:S412, finally obtain the training data, which are respectively used to train four groups of random forests in each level, and the form of the training data is as follows:
Figure PCTCN2021125577-appb-000014
Figure PCTCN2021125577-appb-000014
可以理解的是,本实施例按不动点模式将特征向量分成了四组,所以就有了四组训练数据矩阵,每组都包含了降维后的特征向量拼合的矩阵
Figure PCTCN2021125577-appb-000015
和残差矩阵
Figure PCTCN2021125577-appb-000016
j=1,2,3,4。每一级随机森林包含4组随机森林,4组随机森林分别对应四种不同的不动点模式。整体上,全部特征向量X共同训练一级随机森林,但细节上,是将全部特征向量X按模式分成4组X 1,X 2,X 3,X 4分别训练同一级随机森林中的四组随机森林。
It can be understood that this embodiment divides the eigenvectors into four groups according to the fixed point mode, so there are four groups of training data matrices, and each group contains the matrix of the reduced eigenvectors
Figure PCTCN2021125577-appb-000015
and the residual matrix
Figure PCTCN2021125577-appb-000016
j = 1, 2, 3, 4. Each level of random forest contains 4 groups of random forests, and the 4 groups of random forests correspond to four different fixed point patterns. On the whole, all the feature vectors X are trained together in the first-level random forest, but in detail, all the feature vectors X are divided into four groups according to the pattern X 1 , X 2 , X 3 , and X 4 respectively train four groups in the same level of random forest random forest.
第二,第一级随机森林的训练阶段Second, the training phase of the first level random forest
根据残差引导策略训练第一级随机森林
Figure PCTCN2021125577-appb-000017
包括以下步骤:
Train the first level random forest according to the residual bootstrapping strategy
Figure PCTCN2021125577-appb-000017
Include the following steps:
S51、待训练的第一级随机森林
Figure PCTCN2021125577-appb-000018
其中
Figure PCTCN2021125577-appb-000019
对于第j组随机森林中的全体决策树,用数据
Figure PCTCN2021125577-appb-000020
初始化根节点。
S51, the first-level random forest to be trained
Figure PCTCN2021125577-appb-000018
in
Figure PCTCN2021125577-appb-000019
For all decision trees in the random forest of the jth group, use the data
Figure PCTCN2021125577-appb-000020
Initialize the root node.
S52、第j组中N个决策树按层同步生长,当随机森林中全体决策树训练第l(l=1,2,...,L-1)层时,对于第n个决策树
Figure PCTCN2021125577-appb-000021
如果还存在未被处理节点α,则对其进行节点分裂。
S52, N decision trees in the jth group grow synchronously by layers, when all the decision trees in the random forest train the l (l=1, 2,..., L-1) layer, for the nth decision tree
Figure PCTCN2021125577-appb-000021
If there is still an unprocessed node α, it will be split.
S53、在当前层级l<L-1时则需要精炼残差,对于第n个决策树
Figure PCTCN2021125577-appb-000022
如果还存在未精炼残差的节点
Figure PCTCN2021125577-appb-000023
则按如下步骤进行精炼残差:根据
Figure PCTCN2021125577-appb-000024
对节点β中的X β估计残差
Figure PCTCN2021125577-appb-000025
其中每个残差向量可由下式估计:
S53. When the current level l<L-1, the residual needs to be refined. For the nth decision tree
Figure PCTCN2021125577-appb-000022
If there are also nodes with unrefined residuals
Figure PCTCN2021125577-appb-000023
Then follow the steps below to refine the residual: According to
Figure PCTCN2021125577-appb-000024
Estimation residuals for X β in node β
Figure PCTCN2021125577-appb-000025
Each of the residual vectors can be estimated by the following formula:
Figure PCTCN2021125577-appb-000026
Figure PCTCN2021125577-appb-000026
之后,根据下式完成对节点β中残差的精炼:Afterwards, the refinement of the residuals in node β is completed according to the following formula:
Figure PCTCN2021125577-appb-000027
Figure PCTCN2021125577-appb-000027
其中,x i是X β中第i个特征向量,全体
Figure PCTCN2021125577-appb-000028
按列拼合成矩阵
Figure PCTCN2021125577-appb-000029
Among them, x i is the i-th eigenvector in X β , and all
Figure PCTCN2021125577-appb-000028
Flatten into a matrix by column
Figure PCTCN2021125577-appb-000029
S54、最终,保存训练好的随机森林
Figure PCTCN2021125577-appb-000030
S54, finally, save the trained random forest
Figure PCTCN2021125577-appb-000030
上述S52中,节点分裂过程具体如下:In the above S52, the node splitting process is as follows:
S521、节点α中包含数据
Figure PCTCN2021125577-appb-000031
通过求解下式得到由X α
Figure PCTCN2021125577-appb-000032
的线性变换,即前文中提及的第一线性变换:
S521. Node α contains data
Figure PCTCN2021125577-appb-000031
By solving the following formula to get from X α to
Figure PCTCN2021125577-appb-000032
The linear transformation of , that is, the first linear transformation mentioned above:
Figure PCTCN2021125577-appb-000033
Figure PCTCN2021125577-appb-000033
X α
Figure PCTCN2021125577-appb-000034
的线性变换形式如下:
X α to
Figure PCTCN2021125577-appb-000034
The linear transformation form of is as follows:
Figure PCTCN2021125577-appb-000035
Figure PCTCN2021125577-appb-000035
S522、节点α的祖先节点已经完成训练,并得出相应的线性变换,将这些线性变换与
Figure PCTCN2021125577-appb-000036
累加得到
Figure PCTCN2021125577-appb-000037
也就是X α
Figure PCTCN2021125577-appb-000038
的线性变换,即前文提及的第二线性变换,其中
Figure PCTCN2021125577-appb-000039
是指
Figure PCTCN2021125577-appb-000040
中与节点α有交集的残差向量。这里α (i)指的是节点α的祖先节点,α (0)就是节点α的根节点,α (l-1)就是节点α的父节点,α (l)就是节点α。
S522. The ancestor nodes of node α have completed the training, and obtained corresponding linear transformations, and combined these linear transformations with
Figure PCTCN2021125577-appb-000036
accumulated
Figure PCTCN2021125577-appb-000037
That is, X α to
Figure PCTCN2021125577-appb-000038
The linear transformation of , that is, the second linear transformation mentioned above, where
Figure PCTCN2021125577-appb-000039
Refers to
Figure PCTCN2021125577-appb-000040
The residual vector that intersects with node α. Here α (i) refers to the ancestor node of node α, α (0) is the root node of node α, α (l-1) is the parent node of node α, and α (l) is node α.
S523、如果节点α中包含的特征向量数量不足200或者当前层级l=L-1时,则不再继续分裂,并将节点α标记为叶子节点,存储W α以备插值阶段使用。 S523. If the number of eigenvectors contained in node α is less than 200 or the current level l=L-1, no further splitting is performed, and node α is marked as a leaf node, and W α is stored for use in the interpolation stage.
S524、随机挑选一系列分裂参数{Θ 1,Θ 2,...,Θ p},其中Θ p={θ 1,Θ 2,τ},θ j(j=1,2)表示X α中的第θ j行,根据分裂函数S(x i,Θ p)=x i1]-x i2]-τ的结果对第i个特征向量进行分类,如果S(x i,Θ p)≥0就将它分类到子节点β中,否则分类到子节点γ中。 S524. Randomly select a series of splitting parameters {Θ 1 , Θ 2 , ..., Θ p }, where Θ p = {θ 1 , Θ 2 , τ}, θ j (j=1, 2) means that in X α In line θ j of , classify the i-th feature vector according to the result of the split function S( xi , Θ p )= xi1 ] -xi2 ]-τ, if S( xi , Θ p )≥0, it will be classified into child node β, otherwise it will be classified into child node γ.
其中,p=1,2,...,P,作为一种具体的实施方式,取值如下:P=6。τ表示一个灰度值阈值,实际应用中灰度值被归一化到[0,1],所以τ∈[0,1]。Wherein, p=1, 2, . . . , P, as a specific implementation manner, the value is as follows: P=6. τ represents a gray value threshold. In practical applications, the gray value is normalized to [0,1], so τ∈[0,1].
S525、使用分裂前后误差减少量来挑选最优分裂参数Θ p,最终挑选误差减少量G α最大的参数Θ p对节点α进行分裂。误差计算方式为: S525. Use the error reduction before and after splitting to select the optimal splitting parameter Θ p , and finally select the parameter Θ p with the largest error reduction G α to split the node α. The error calculation method is:
Figure PCTCN2021125577-appb-000041
Figure PCTCN2021125577-appb-000041
其中,
Figure PCTCN2021125577-appb-000042
为利用节点δ中保存的线性变换
Figure PCTCN2021125577-appb-000043
对残差R δ的估计误差,D δ为节点δ中特征向量的数量。
in,
Figure PCTCN2021125577-appb-000042
To use the linear transformation stored in node δ
Figure PCTCN2021125577-appb-000043
The estimation error for the residual R δ , D δ is the number of eigenvectors in the node δ.
当第j组随机森林中的第n个决策树
Figure PCTCN2021125577-appb-000044
完成第l层分裂后,则更新
Figure PCTCN2021125577-appb-000045
中的随机森林
Figure PCTCN2021125577-appb-000046
When the nth decision tree in the jth random forest group
Figure PCTCN2021125577-appb-000044
After the l-layer split is completed, update
Figure PCTCN2021125577-appb-000045
random forest in
Figure PCTCN2021125577-appb-000046
同一组随机森林中,因为决策树在节点分裂过程中的分裂参数是随机选择的,所以,即使不同决策树的输入相同,但训练结果也是不同的。也就是说,同一随机森林中不同决策树的训练结果是不同的,训练结果具体是指:根节点和内部节点中保存的最优分裂参数以及叶子节点中保存的映射关系。In the same group of random forests, because the split parameters of the decision tree in the process of node splitting are randomly selected, even if the inputs of different decision trees are the same, the training results are different. That is to say, the training results of different decision trees in the same random forest are different. The training results specifically refer to: the optimal splitting parameters stored in the root node and internal nodes and the mapping relationship stored in the leaf nodes.
另外,同一组随机森林中,各个决策树中得到的映射关系的维度都是相同的,所以具有可加性。假如一组随机森林包含两个决策树,特征向量x输入随机森林后,会分到决策树1中的某个叶子节点,也会分到决策树2中的某个叶子节点,这样特征向量x就对应了两个映射关系W 1,W 2,这两个映射关系可以分别完成对特征向量x的映射
Figure PCTCN2021125577-appb-000047
可以把他们加起来得到
Figure PCTCN2021125577-appb-000048
也可以先将映射关系加起来得到W=W 1+W 2,然后直接得到
Figure PCTCN2021125577-appb-000049
In addition, in the same group of random forests, the dimensions of the mapping relationship obtained in each decision tree are the same, so they are additive. If a set of random forests contains two decision trees, after the feature vector x is input into the random forest, it will be assigned to a leaf node in decision tree 1, and will also be assigned to a leaf node in decision tree 2, so that the feature vector x It corresponds to two mapping relationships W 1 and W 2 , and these two mapping relationships can respectively complete the mapping of the feature vector x
Figure PCTCN2021125577-appb-000047
can add them up to get
Figure PCTCN2021125577-appb-000048
It is also possible to add up the mapping relations first to obtain W=W 1 +W 2 , and then directly obtain
Figure PCTCN2021125577-appb-000049
值得一提的是,本实施例所提及的残差精炼,即根据当前层级残差确定下一层级残差的过程。It is worth mentioning that the residual refinement mentioned in this embodiment refers to the process of determining the residual of the next level according to the residual of the current level.
第三,其余级随机森林的训练阶段Third, the training phase of the random forest of the remaining levels
根据残差引导策略训练级联随机森林
Figure PCTCN2021125577-appb-000050
(k=2,3,...,K)。
Training Cascaded Random Forests with Residual Bootstrapping Strategies
Figure PCTCN2021125577-appb-000050
(k=2, 3, . . . , K).
需要说明的是,用于训练第k(k>1)级随机森林
Figure PCTCN2021125577-appb-000051
的高分辨率图像需不同于训练随机森林
Figure PCTCN2021125577-appb-000052
时所用的训练数据,且预插值图像则是使用
Figure PCTCN2021125577-appb-000053
依次插值后产生的。其余训练步骤与第一级随机森林训练过程相同,这里不再展开介绍。
It should be noted that for training the kth (k>1) level random forest
Figure PCTCN2021125577-appb-000051
The high-resolution images need to be different from the training random forest
Figure PCTCN2021125577-appb-000052
The training data used when, and the pre-interpolated image is used
Figure PCTCN2021125577-appb-000053
generated after sequential interpolation. The remaining training steps are the same as the first-level random forest training process, and will not be introduced here.
最终,输出K级级联的随机森林
Figure PCTCN2021125577-appb-000054
即各级映射关系均确定的图像插值模型。实际应用中,K可以取值4。
Finally, the output K-level cascaded random forest
Figure PCTCN2021125577-appb-000054
That is, the image interpolation model whose mapping relations at all levels are determined. In practical applications, K may take a value of 4.
综上,本实施例提供的一种基于残差引导策略的图像插值模型训练方法,目的是由低分辨率图像获得高分辨率图像,且保证插值后的图像在客观指标和主观观感上均有很大程度的提高。本实施例主要描述离线训练阶段的实施过程,在每个决策树构建过程中迭代执行一系列节点分裂、数据精炼的步骤,其中数据精炼阶段包含数据划分、残差更新,更新后的残差将用于下一层级的训练。除此之外,还引入级联策略进一步提升图像插值的品质,从高尺度分析级联策略,它同样是利用图像残差引导模型的训练。To sum up, this embodiment provides an image interpolation model training method based on the residual guidance strategy. The purpose is to obtain a high-resolution image from a low-resolution image, and to ensure that the interpolated image has both objective indicators and subjective perception. greatly improved. This embodiment mainly describes the implementation process of the offline training phase. During the construction of each decision tree, a series of node splitting and data refining steps are iteratively executed. The data refining phase includes data division and residual update. The updated residual will be for training at the next level. In addition, a cascading strategy is also introduced to further improve the quality of image interpolation, and the cascading strategy is analyzed from a high scale. It also uses image residuals to guide the training of the model.
上述两个实施例对图像插值模型的训练过程进行了介绍,下面介绍通过上述方式训练好的图像插值模型的图像插值过程。The above two embodiments have introduced the training process of the image interpolation model, and the image interpolation process of the image interpolation model trained in the above manner will be introduced below.
首先对本申请提供的基于残差引导策略的图像插值方法实施例一进行介绍,如图4所示,该实施例包括以下步骤:First, the first embodiment of the image interpolation method based on the residual guidance strategy provided by the present application is introduced, as shown in FIG. 4 , this embodiment includes the following steps:
S61、获取待插值的低分辨率图像;S61. Obtain a low-resolution image to be interpolated;
S62、根据低分辨率图像,生成预插值图像;S62. Generate a pre-interpolation image according to the low-resolution image;
S63、将预插值图像输入训练好的随机森林;在随机森林的任意层级,根据训练过程中学习到的预插值图像与当前层级残差之间的映射关系生成估计残差;S63. Input the pre-interpolation image into the trained random forest; at any level of the random forest, generate an estimated residual according to the mapping relationship between the pre-interpolation image learned during the training process and the residual of the current level;
S64、根据各层级的估计残差和预插值图像,生成低分辨率图像的插值图像。S64. Generate an interpolated image of the low-resolution image according to the estimated residuals of each level and the pre-interpolated image.
总之,对于在线图像插值阶段,将给定的低分辨率图像将依次通过训练好的级联随机森林并完成插值。如图5所示,在每一级随机森林中,图像以特征向量的形式在每个决策树中自顶向下地划分,每个特征向量传递直至叶子节点后使用其中保存的线性变换生成估计残差,重新组合后的估计残差叠加到预插值图像上,就得到了当前一级随机森林的插值结果。In short, for the online image interpolation stage, the given low-resolution images will be sequentially passed through the trained cascade random forest and the interpolation will be completed. As shown in Figure 5, in each level of random forest, the image is divided from top to bottom in each decision tree in the form of feature vectors, and each feature vector is passed to the leaf node, and then the linear transformation stored in it is used to generate an estimated residual value. Difference, the estimated residual after recombination is superimposed on the pre-interpolation image, and the interpolation result of the current level of random forest is obtained.
下面对本申请提供的基于残差引导策略的图像插值方法实施例二进行介绍。The second embodiment of the image interpolation method based on the residual guidance strategy provided by the present application will be introduced below.
实施例二的输入和输出如下:The input and output of embodiment two are as follows:
输入:低分辨率图像、训练好的级联随机森林
Figure PCTCN2021125577-appb-000055
Input: low-resolution image, trained cascaded random forest
Figure PCTCN2021125577-appb-000055
输出:插值图像。Output: Interpolated image.
本实施例将整个插值过程分为两个阶段:数据准备阶段,图像插值阶段。下面分别对这两个阶段进行介绍。In this embodiment, the entire interpolation process is divided into two stages: a data preparation stage and an image interpolation stage. The two stages are described below.
第一,数据准备阶段First, the data preparation stage
S71、将低分辨率图像从RGB色彩空间转换到YCbCr色彩空间。S71. Convert the low-resolution image from the RGB color space to the YCbCr color space.
S72、由Y通道图像I Y生成预插值图像
Figure PCTCN2021125577-appb-000056
具体的,当使用第一级随机森林
Figure PCTCN2021125577-appb-000057
插值时,使用Bicubic算法对低分辨率图像预插值,得到预插值图像;而当使用其他级随机森林时,则是直接使用由上一级随机森林的插值结果作为预插值图像。
S72, generate a pre-interpolation image from the Y channel image I Y
Figure PCTCN2021125577-appb-000056
Specifically, when using the first level random forest
Figure PCTCN2021125577-appb-000057
When interpolating, the Bicubic algorithm is used to pre-interpolate the low-resolution image to obtain a pre-interpolated image; when using other random forests, the interpolation result from the previous random forest is directly used as the pre-interpolated image.
S73、使用Matlab中的Canny边缘检测函数检测预插值图像边缘,得到边缘图像{I E}。 S73. Use the Canny edge detection function in Matlab to detect the edge of the pre-interpolation image to obtain the edge image {I E }.
S74、根据一维的一阶梯度算子、二阶梯度算子对预插值图像
Figure PCTCN2021125577-appb-000058
进行滤波,生成对应的四幅特征图像
Figure PCTCN2021125577-appb-000059
在四幅特征图像上以步长为1间隔地采集图像块,每个位置都会生成四个大小为5×5的图像块
Figure PCTCN2021125577-appb-000060
将这些图像块向量化,并进行拼接,进而得到拼合后的向量
Figure PCTCN2021125577-appb-000061
S74, pre-interpolating the image according to the one-dimensional first-order gradient operator and the second-order gradient operator
Figure PCTCN2021125577-appb-000058
Perform filtering to generate the corresponding four feature images
Figure PCTCN2021125577-appb-000059
Collect image blocks with a step size of 1 on the four feature images, and each position will generate four image blocks of size 5×5
Figure PCTCN2021125577-appb-000060
Vectorize these image blocks and stitch them together to get the stitched vector
Figure PCTCN2021125577-appb-000061
S75、对预插值图像
Figure PCTCN2021125577-appb-000062
和边缘图像{I E}以同样的方式采样图像块,得到预插值图像块、残差图像块和边缘图像块。
S75, for the pre-interpolation image
Figure PCTCN2021125577-appb-000062
Sample image blocks in the same way as the edge image {I E } to obtain pre-interpolation image blocks, residual image blocks and edge image blocks.
S76、将特征向量拼合为矩阵X=[x 1,x 2,...,x D],其中D为图像块数量。 S76. Combine the feature vectors into a matrix X=[x 1 , x 2 , . . . , x D ], where D is the number of image blocks.
S77、根据边缘图像块,筛选出边缘像素的强度值大于0的特征向量,保留对应的特征向量。S77. According to the edge image block, filter out the feature vectors whose intensity values of the edge pixels are greater than 0, and keep the corresponding feature vectors.
S78、根据预插值图像块的采样结果中包含的不动点分布模式,对特征向量进行分组。这里只有四种分布模式,故将特征向量分为四组。S78. Group the feature vectors according to the fixed point distribution pattern contained in the sampling result of the pre-interpolation image block. There are only four distribution modes here, so the eigenvectors are divided into four groups.
S79、使用训练阶段PCA对不同的组的特征向量分别进行降维,保存降维后的特征矩阵
Figure PCTCN2021125577-appb-000063
S79. Using PCA in the training phase to reduce the dimensionality of the feature vectors of different groups, and save the dimensionality-reduced feature matrix
Figure PCTCN2021125577-appb-000063
第二,图像插值阶段Second, the image interpolation stage
第k级随机森林
Figure PCTCN2021125577-appb-000064
根据处理后的特征矩阵进行图像插值,包括以下步骤:
random forest at level k
Figure PCTCN2021125577-appb-000064
Perform image interpolation according to the processed feature matrix, including the following steps:
S81、随机森林
Figure PCTCN2021125577-appb-000065
其中
Figure PCTCN2021125577-appb-000066
对于第j组随机森林中的全体决策树,用特征矩阵
Figure PCTCN2021125577-appb-000067
初始化根节点;
S81. Random forest
Figure PCTCN2021125577-appb-000065
in
Figure PCTCN2021125577-appb-000066
For all the decision trees in the random forest of group j, the feature matrix is used
Figure PCTCN2021125577-appb-000067
Initialize the root node;
S82、特征矩阵
Figure PCTCN2021125577-appb-000068
自上而下地传递,直至叶子节点,具体的,如果抵达内部节点α的特征矩阵
Figure PCTCN2021125577-appb-000069
还未向下传递,则根据节点α记录的最优分裂参数Θ对
Figure PCTCN2021125577-appb-000070
进行划分;
S82. Feature matrix
Figure PCTCN2021125577-appb-000068
Transfer from top to bottom until the leaf node, specifically, if it reaches the feature matrix of the internal node α
Figure PCTCN2021125577-appb-000069
has not been passed down yet, according to the optimal split parameter Θ pair recorded by node α
Figure PCTCN2021125577-appb-000070
to divide;
S83、当特征矩阵传递到叶子节点ρ,则使用保存在该叶子节点中的线性变换W p生成估计残差
Figure PCTCN2021125577-appb-000071
S83. When the feature matrix is passed to the leaf node ρ, use the linear transformation W p stored in the leaf node to generate an estimated residual
Figure PCTCN2021125577-appb-000071
S84、每个决策树
Figure PCTCN2021125577-appb-000072
最终都输出一个估计残差矩阵
Figure PCTCN2021125577-appb-000073
为了区分不同决策树的预测结果,将第n个决策树估计的残差矩阵记为
Figure PCTCN2021125577-appb-000074
由随机森林
Figure PCTCN2021125577-appb-000075
对残差的估计为
Figure PCTCN2021125577-appb-000076
S84, each decision tree
Figure PCTCN2021125577-appb-000072
Finally, an estimated residual matrix is output
Figure PCTCN2021125577-appb-000073
In order to distinguish the prediction results of different decision trees, the residual matrix estimated by the nth decision tree is recorded as
Figure PCTCN2021125577-appb-000074
by random forest
Figure PCTCN2021125577-appb-000075
The estimate for the residual is
Figure PCTCN2021125577-appb-000076
S85、将预测出的残差向量重组为残差图像并处理重叠区域,具体做法为:准备两个与插值后图像同样大小的零矩阵,其中一个保存残差图像
Figure PCTCN2021125577-appb-000077
另一个保存对各位置重叠情况计数,当所有图像块都放入
Figure PCTCN2021125577-appb-000078
后,通过取平均的方式求得最终的残差图像
Figure PCTCN2021125577-appb-000079
S85. Reorganize the predicted residual vector into a residual image and process the overlapping area. The specific method is: prepare two zero matrices with the same size as the interpolated image, and one of them saves the residual image
Figure PCTCN2021125577-appb-000077
The other saves the count of overlaps at each position, when all image blocks are placed in
Figure PCTCN2021125577-appb-000078
After that, the final residual image is obtained by taking the average
Figure PCTCN2021125577-appb-000079
S86、将
Figure PCTCN2021125577-appb-000080
与预插值图像I X叠加后,得到由第k级随机森林
Figure PCTCN2021125577-appb-000081
插值的图像
Figure PCTCN2021125577-appb-000082
S86. Will
Figure PCTCN2021125577-appb-000080
After being superimposed with the pre-interpolated image I X , the k-th random forest is obtained
Figure PCTCN2021125577-appb-000081
interpolated image
Figure PCTCN2021125577-appb-000082
如果k<K,则将插值图像
Figure PCTCN2021125577-appb-000083
用做下一级随机森林
Figure PCTCN2021125577-appb-000084
的预插值图像,否则将插值图像
Figure PCTCN2021125577-appb-000085
还原为彩色图像,具体做法为对低分辨图像的Cb通道和Cr通道图像使用Bicubic算法插值,然后将三通道图像合并后转换到RGB色彩空间。
If k < K, the image will be interpolated
Figure PCTCN2021125577-appb-000083
Used as the next level of random forest
Figure PCTCN2021125577-appb-000084
pre-interpolated image, otherwise the image will be interpolated
Figure PCTCN2021125577-appb-000085
To restore a color image, the specific method is to use the Bicubic algorithm to interpolate the Cb channel and Cr channel images of the low-resolution image, and then combine the three-channel images and convert them to the RGB color space.
经实验证明,本实施例的基于残差引导策略的随机森林图像插值方法,相较于其它主流的图像插值算法,在图像插值结果的客观指标上有明显的提高。Experiments have proved that compared with other mainstream image interpolation algorithms, the random forest image interpolation method based on the residual guidance strategy in this embodiment has significantly improved the objective index of image interpolation results.
此外,本申请还提供了一种计算机设备,包括:In addition, the present application also provides a computer device, including:
存储器:用于存储计算机程序;memory: used to store computer programs;
处理器:用于执行所述计算机程序,以实现如上文所述的基于残差引导策略的图像插值模型训练方法,和/或,如上文所述的基于残差引导策略的图像插值方法。Processor: configured to execute the computer program to implement the above-mentioned method for training an image interpolation model based on a residual-guided strategy, and/or, the above-mentioned method for image interpolation based on a residual-guided strategy.
最后,本申请提供了一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时用于实现如上文所述的基于残差引导策略的图像插值模型训练方法,和/或,如上文所述的基于残差引导策略的图像插值方法。Finally, the present application provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is used to realize the image interpolation based on the residual guidance strategy as described above A model training method, and/or, an image interpolation method based on a residual-guided strategy as described above.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
以上对本申请所提供的方案进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The scheme provided by the present application has been introduced in detail above, and the principle and implementation mode of the present application have been explained by using specific examples in this paper. The description of the above embodiments is only used to help understand the method and core idea of the present application; at the same time , For those of ordinary skill in the art, based on the idea of this application, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be construed as limiting the application.

Claims (10)

  1. 一种基于残差引导策略的图像插值模型训练方法,其特征在于,包括:A method for training an image interpolation model based on a residual guidance strategy, characterized in that it includes:
    获取高分辨率图像;对所述高分辨率图像进行降采样,得到低分辨率图像;根据所述低分辨率图像,生成预插值图像;Acquiring a high-resolution image; downsampling the high-resolution image to obtain a low-resolution image; generating a pre-interpolation image according to the low-resolution image;
    对所述高分辨率图像和所述预插值图像做差,得到初始残差;Making a difference between the high-resolution image and the pre-interpolation image to obtain an initial residual;
    利用所述预插值图像和所述初始残差对随机森林进行训练;在训练过程中,所述随机森林按层同步生长,所述初始残差作为第一层级残差,在所述随机森林的任意层级,学习所述预插值图像与当前层级残差之间的映射关系进而生成估计残差,对所述当前层级残差与所述估计残差做差,得到下一层级残差;Use the pre-interpolation image and the initial residual to train the random forest; during the training process, the random forest grows synchronously by layers, and the initial residual is used as the first-level residual, in the random forest At any level, learn the mapping relationship between the pre-interpolation image and the residual of the current level to generate an estimated residual, and make a difference between the residual of the current level and the estimated residual to obtain the residual of the next level;
    在达到训练终止条件时,输出各层级映射关系均确定的随机森林,以作为图像插值模型。When the training termination condition is reached, the random forest whose mapping relationship at each level is determined is output as an image interpolation model.
  2. 如权利要求1所述的方法,其特征在于,所述随机森林被划分为多组随机森林,所述利用所述预插值图像和所述初始残差对随机森林进行训练,包括:The method according to claim 1, wherein the random forest is divided into multiple groups of random forests, and the random forest is trained using the pre-interpolation image and the initial residual, comprising:
    生成所述预插值图像的特征向量;generating a feature vector of the pre-interpolated image;
    按照不动点分布模式,对所述特征向量进行分组,其中所述特征向量的分组数量等于所述随机森林的分组数量;According to the fixed point distribution mode, the feature vectors are grouped, wherein the number of groups of the feature vectors is equal to the number of groups of the random forest;
    在训练所述随机森林时,每组所述特征向量和所述初始残差中相应的残差向量训练一组随机森林。When training the random forest, a group of random forests are trained for each set of feature vectors and corresponding residual vectors in the initial residual.
  3. 如权利要求2所述的方法,其特征在于,所述生成所述预插值图像的特征向量,包括:The method according to claim 2, wherein said generating the feature vector of said pre-interpolation image comprises:
    利用一维的一阶梯度算子和二阶梯度算子对所述预插值图像进行滤波,生成对应的四幅特征图像;对所述四幅特征图像进行采样,得到每个采样位置的特征向量。Filtering the pre-interpolation image by using a one-dimensional first-order gradient operator and a second-order gradient operator to generate four corresponding feature images; sampling the four feature images to obtain a feature vector of each sampling position.
  4. 如权利要求3所述的方法,其特征在于,所述四幅特征图像的采样方式具体为:以步长为1间隔地进行采样;The method according to claim 3, wherein the sampling method of the four feature images is specifically: sampling at intervals with a step size of 1;
    相应的,所述不动点分布模式有4种,所述特征向量的分组数量和所 述随机森林的分组数量均为4。Correspondingly, there are 4 kinds of fixed point distribution patterns, and the number of groups of the feature vector and the number of groups of the random forest are 4.
  5. 如权利要求1所述的方法,其特征在于,所述图像插值模型具体包括K级所述随机森林;第一级随机森林的预插值图像为利用预设插值算法生成的图像,对于任意k∈[2,K],第k级随机森林的预插值图像为经过前k-1级随机森林依次进行插值得到的图像。The method according to claim 1, wherein the image interpolation model specifically comprises K-level random forests; the pre-interpolation image of the first-level random forest is an image generated by a preset interpolation algorithm, for any k∈ [2,K], the pre-interpolation image of the k-th random forest is the image obtained by sequential interpolation of the previous k-1 random forest.
  6. 如权利要求5所述的方法,其特征在于,所述图像插值模型中,不同级随机森林的高分辨率图像不同。The method according to claim 5, characterized in that, in the image interpolation model, the high-resolution images of random forests at different levels are different.
  7. 如权利要求1至6任意一项所述的方法,其特征在于,所述随机森林按层同步生长,包括:The method according to any one of claims 1 to 6, wherein the random forest grows synchronously by layers, comprising:
    在所述随机森林的任意层级,判断是否存在未被处理的目标节点;At any level of the random forest, judging whether there is an unprocessed target node;
    若存在,生成从所述目标节点包含的特征向量到所述目标节点包含的残差向量的第一线性变换,进而生成从所述目标节点包含的特征向量到目标残差向量的第二线性变换,其中所述目标残差向量为与所述目标节点有交集的残差向量;If it exists, generate the first linear transformation from the feature vector contained in the target node to the residual vector contained in the target node, and then generate the second linear transformation from the feature vector contained in the target node to the target residual vector , wherein the target residual vector is a residual vector that intersects with the target node;
    若不存在,则判断是否达到分裂终止条件;If it does not exist, it is judged whether the split termination condition is reached;
    若达到,则确定所述目标节点属于叶子节点,并记录所述目标节点的第二线性变换,最终全部叶子节点的第二线性变换即所述预插值图像与各层级残差之和之间的映射关系;If it is reached, it is determined that the target node belongs to a leaf node, and the second linear transformation of the target node is recorded, and finally the second linear transformation of all leaf nodes is the difference between the pre-interpolation image and the sum of the residuals of each level Mapping relations;
    若未达到,则确定所述目标节点属于内部节点,并通过节点分裂进入下一层级;在节点分裂过程中,随机选取分裂参数并对所述目标节点进行分裂,根据分裂前后误差减少量确定最优分裂参数,记录所述目标节点的最优分裂参数。If not, determine that the target node belongs to an internal node, and enter the next level through node splitting; in the process of node splitting, randomly select the splitting parameters and split the target node, and determine the optimal node according to the amount of error reduction before and after splitting optimal splitting parameter, record the optimal splitting parameter of the target node.
  8. 一种基于残差引导策略的图像插值方法,其特征在于,包括:An image interpolation method based on a residual guidance strategy, characterized in that it comprises:
    获取待插值的低分辨率图像;Obtain the low-resolution image to be interpolated;
    根据所述低分辨率图像,生成预插值图像;generating a pre-interpolated image according to the low-resolution image;
    将所述预插值图像输入训练好的随机森林;在所述随机森林的任意层级,根据训练过程中学习到的预插值图像与当前层级残差之间的映射关系生成估计残差;Input the pre-interpolated image into the trained random forest; at any level of the random forest, generate an estimated residual according to the mapping relationship between the pre-interpolated image learned in the training process and the residual of the current level;
    根据各层级的所述估计残差和所述预插值图像,生成所述低分辨率图 像的插值图像。An interpolated image of the low-resolution image is generated according to the estimated residual of each level and the pre-interpolated image.
  9. 一种计算机设备,其特征在于,包括:A computer device, characterized in that it includes:
    存储器:用于存储计算机程序;memory: used to store computer programs;
    处理器:用于执行所述计算机程序,以实现如权利要求1至7任意一项所述的基于残差引导策略的图像插值模型训练方法,和/或,如权利要求8所述的基于残差引导策略的图像插值方法。Processor: used to execute the computer program, so as to realize the image interpolation model training method based on the residual guidance strategy as claimed in any one of claims 1 to 7, and/or, as claimed in claim 8. Image Interpolation Method for Difference-Guided Strategies.
  10. 一种可读存储介质,其特征在于,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时用于实现如权利要求1至7任意一项所述的基于残差引导策略的图像插值模型训练方法,和/或,如权利要求8所述的基于残差引导策略的图像插值方法。A readable storage medium, characterized in that a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, it is used to implement the residual-based An image interpolation model training method of a guidance strategy, and/or, an image interpolation method based on a residual guidance strategy as claimed in claim 8 .
PCT/CN2021/125577 2021-07-22 2021-10-22 Image interpolation model training method based on residual-guided policy WO2023000526A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110830807.8A CN113538242B (en) 2021-07-22 2021-07-22 Image interpolation model training method based on residual error guiding strategy
CN202110830807.8 2021-07-22

Publications (1)

Publication Number Publication Date
WO2023000526A1 true WO2023000526A1 (en) 2023-01-26

Family

ID=78120492

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/125577 WO2023000526A1 (en) 2021-07-22 2021-10-22 Image interpolation model training method based on residual-guided policy

Country Status (2)

Country Link
CN (1) CN113538242B (en)
WO (1) WO2023000526A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080239143A1 (en) * 2007-03-27 2008-10-02 Samsung Electronics Co., Ltd. Method and apparatus for adaptively converting frame rate based on motion vector, and display device with adaptive frame rate conversion function
CN108447020A (en) * 2018-03-12 2018-08-24 南京信息工程大学 A kind of face super-resolution reconstruction method based on profound convolutional neural networks
CN109564677A (en) * 2018-11-09 2019-04-02 香港应用科技研究院有限公司 Super-resolution synthesis system and method based on random forest grader weighted results
CN109741255A (en) * 2018-12-12 2019-05-10 深圳先进技术研究院 PET image super-resolution reconstruction method, device, equipment and medium based on decision tree

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106910161B (en) * 2017-01-24 2020-06-19 华南理工大学 Single image super-resolution reconstruction method based on deep convolutional neural network
US10685428B2 (en) * 2018-11-09 2020-06-16 Hong Kong Applied Science And Technology Research Institute Co., Ltd. Systems and methods for super-resolution synthesis based on weighted results from a random forest classifier

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080239143A1 (en) * 2007-03-27 2008-10-02 Samsung Electronics Co., Ltd. Method and apparatus for adaptively converting frame rate based on motion vector, and display device with adaptive frame rate conversion function
CN108447020A (en) * 2018-03-12 2018-08-24 南京信息工程大学 A kind of face super-resolution reconstruction method based on profound convolutional neural networks
CN109564677A (en) * 2018-11-09 2019-04-02 香港应用科技研究院有限公司 Super-resolution synthesis system and method based on random forest grader weighted results
CN109741255A (en) * 2018-12-12 2019-05-10 深圳先进技术研究院 PET image super-resolution reconstruction method, device, equipment and medium based on decision tree

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU ZHEN-PENG, SU NAN;QIN YI-WEN;LU JIA-HUAN;LI XIAO-FEI: "FS-CRF:Outlier Detection Model Based on Feature Segmentation and Cascaded Random Forest", COMPUTER SCIENCE, vol. 47, no. 8, 2 July 2020 (2020-07-02), CN , pages 185 - 188, XP093027367, ISSN: 1002-137X, DOI: 10.11896/jsjkx.190600162 *

Also Published As

Publication number Publication date
CN113538242B (en) 2024-06-21
CN113538242A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
Van den Oord et al. Conditional image generation with pixelcnn decoders
CN108090443B (en) Scene text detection method and system based on deep reinforcement learning
CN111046939A (en) CNN (CNN) class activation graph generation method based on attention
CN109872374A (en) A kind of optimization method, device, storage medium and the terminal of image, semantic segmentation
CN104899830B (en) A kind of image super-resolution method
JP6646234B2 (en) Program generation device, program generation method, and generation program
Li et al. Dual-stage approach toward hyperspectral image super-resolution
CN113807176B (en) Small sample video behavior recognition method based on multi-knowledge fusion
CN112115967A (en) Image increment learning method based on data protection
CN114548265A (en) Crop leaf disease image generation model training method, crop leaf disease identification method, electronic device and storage medium
CN104992407B (en) A kind of image super-resolution method
Du et al. Redesigning multi-scale neural network for crowd counting
CN112508181A (en) Graph pooling method based on multi-channel mechanism
CN111178543B (en) Probability domain generalization learning method based on meta learning
CN116091823A (en) Single-feature anchor-frame-free target detection method based on fast grouping residual error module
CN112669238B (en) Method for accurately restoring original image of digital image after color correction
WO2023000526A1 (en) Image interpolation model training method based on residual-guided policy
CN114581470B (en) Image edge detection method based on plant community behaviors
CN112131403A (en) Knowledge graph representation learning method in dynamic environment
WO2023035986A1 (en) Image processing method, electronic device and computer storage medium
CN116823782A (en) Reference-free image quality evaluation method based on graph convolution and multi-scale features
CN112529025A (en) Data processing method and device
CN112906763B (en) Automatic digital image labeling method utilizing cross-task information
CN112766412B (en) Multi-view clustering method based on self-adaptive sparse graph learning
CN115661612A (en) General climate data downscaling method based on element migration learning

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21950764

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE