{'fraction_non_alphanumeric': 0.03329563127385834, 'fraction_numerical': 0.009472642443093454, 'mean_word_length': 4.412012241775058, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Pixel-Level Self-Paced Learning for Super-Resolution

Recently, lots of deep networks are proposed to improve the quality of predicted super-resolution (SR) images, due to its widespread use in several image-based fields. However, with these networks being constructed deeper and deeper, they also cost much longer time for training, which may guide the learners to local optimization. To tackle this problem, this paper designs a training strategy named Pixel-level Self-Paced Learning (PSPL) to accelerate the convergence velocity of SISR models. PSPL imitating self-paced learning gives each pixel in the predicted SR image and its corresponding pixel in ground truth an attention weight, to guide the model to a better region in parameter space. Extensive experiments proved that PSPL could speed up the training of SISR models, and prompt several existing models to obtain new better results. Furthermore, the source code is available at https://github.com/Elin24/PSPL.


INTRODUCTION
The main aim of single image super-resolution (SISR) is to reconstruct a new high-resolution (HR) image with excellent quality from a low-resolution (LR) image. It is widely applied in processing medical images [1], satellite images [2], renovating old pictures and so on [3,4,5]. As a classical task in computer vision, SISR is a challenging problem since it is a one-to-many mapping, which means an LR image could correspond to multiple HR image [3].
To obtain HR image with more delicate details, plenty of algorithms [6,7,8,9,10,11,12,13,14] are proposed and achieve promising results. Especially in the last half decade, the development of deep neural networks leads to a tremendous leap in this field. The pioneering deep-learning-based work is SRCNN [8], which only contains three convolutional layers, but establishes advanced HR image compared with traditional interpolation-based and example-based methods [15]. * Qi Wang is the corresponding author.  Different from it, VDSR [10] adopts a very deep structure with 20 layers, and experiments illustrate it can achieve better performance. However, the repetitive architecture in VDSR is too plain to construct a far deeper network. A representative solution for this problem is residual learning. A typical algorithm adopting it is SRResNet [16], which takes 16 residual units as backbone. Based on the success of SRResNet, Lim et al. proposes EDSR [12] to further increase the depth of networks and achieve state-of-the-art results. EDSR firstly removes all batch normalization (BN) layer in its residual units and then increases both its depth and width. For the former, it contains 32 residual units that are twice of SRResNet; for the latter, each residual unit in EDSR outputs 256 channels, which is only 64 in SRResNet.
These deep models indeed get outstanding performance, but they are too large and intricate to be trained efficiently. To specifically explain this point, Fig. 1 demonstrates a survey of some popular deep networks. As shown in it, even the record is refreshed continuously, the computation complexity also keeps growing. Half of them calculate more than 2,000 times to output a regular SR image, which indicates that they may consume much more time on training. A typical example is that Lim et al. costs 7 days to train EDSR [12]. Moreover, even though a model takes longer training time, it still does not produce better results (DBPN and DRRN). So the problem is, how to design a training strategy that could accelerate the training speed of these models, and further enhance their performance?
To remedy the above problem, this paper proposes a training strategy named Pixel-level Self-Paced Learning (PSPL). It is inspired by traditional sample-level self-paced learning (SPL), in which each sample is given a learning weight, and leads the learner to learn more efficient characteristics for quicker convergence and better generalization. However, sample-level SPL is not suitable for SISR, since SISR focus more on local pixel value. This is also the reason why this paper explores the feasibility of pixel-level SPL. Fig. 2 illustrates how data flow is cut off and rearranged by PSPL. To make it easier to follow, each training epoch is divided into following four steps to be introduced. Given a pair of LR image and HR image, firstly an SR image is predicted by a model when inputting the LR one. After that, a similarity map is produced according to the SR and HR image. Thirdly, based on the similarity map, an attention map is generated, and the attention map give more attention to these pairs of pixels with larger difference. At last, new SR(HR) image is obtained by doing element-wise multiplication between the attention map and original SR(HR) image, and the optimization of the SISR model is impacted by replacing original SR(HR) image with new SR(HR) image when calculating loss. Moreover, in the entire training process, all values in the attention map are going to be close to a constant as the training step increased, which means that the utility of PSPL is gradually diminished in the entire training process.
The name of PSPL comes from two aspects. One is that all attention weights gradually decay with training time goes on, which is similar to the process that self-paced learning increases the difficult of learned objects; the other one is that PSPL allocates attention weight to each pixel in images, which is different from assigning weight for sample in traditional sample-level self-paced learning.

PROPOSED METHOD
As described in Sec. 1, the whole strategy are devided into four parts, which are given shorthand terms as (a) superresolution image generation, (b) similarity map production, (c) attention map calculation, and (d) loss function.

Super-resolution Image Generation
In SISR, given a super resolution scale s, a typical model F s works like below: in which I lr is the input LR image, I sr is the predicted SR image. During training, the HR image corresponding to I lr is denoted as I hr , and the parameters in F s is optimized by:  in which L is loss function that will be described in Sec. 2.4. I sr and I hr have the same size, and their width and height is s times longer than I lr .

Similarity Map Production
After I sr is figured out, a similarity map M s is produced. It is used to measure the similarity of each corresponding local region in I sr and I hr . The production can be formulated by: and M s has the same size as I sr or I hr . PSPL adopts structural similarity (SSIM) index [17] as S. To be specific, M s is obtained through performing SSIM index on a series of patches, and these patches are obtained by using a local window with fixed size to scan the entire image pixel-by-pixel. Given the i th pair of patches (p i s , p i h ), which belong to I sr and I hr respectively, SSIM consists of following two steps to deal with them and then produce their similarity m i s . For convenience, the following part omits the superscript i.
(1) Apply a weighting function to p s and p h respectively to emphasize their center pixel and avoid blocking artifacts: in which p ∈ {p s , p h }, G is a circular-symmetric Gaussian weighting matrix, with the same size as p and normalized to unit sum; means element-wise multiplication. After this step, new patches (p s ,p h ) are obtained.
(2) Calculate each individual SSIM value through: where µp s and σ 2 ps are the average and variance ofp s respectively, and the same goes for µp h and σ 2p h . σp sph is the covariance ofp s andp h . C 1 and C 2 are two variables determined  Fig. 3. An illustration of how m a changes during training process. The lines in the left chart display the distribution of m a in different step; these four blocks in the right exhibit an attention map example in different step.
for stabilization. The former equals to (k 1 L) 2 , and the latter is (k 2 L) 2 . L denotes the dynamic range of values in I sr and I hr . k 1 and k 2 are two constants that are set as 0.01 and 0.03 respectively.
After all m i s is computed, M s is produced through arranging all m i s in a matrix according to their index. There are two benefits to measuring the similarity by similarity structure (SSIM). Firstly, SSIM is a perception-based criterion, and it is spatially stationary [17]. Secondly, SSIM is able to utilize its neighboring pixel values, which makes it more stable compared with absolute differences.

Attention Map Calculation
Attention map is the key point of PSPL. Given similarity map M s produced through the algorithm introduced in Sec. 2.2, its corresponding attention map M a is generated by a Gaussian function: M a = G γ,µ,δ (M s ).
To be specific, for a value m s in M s , its corresponding attention value m a is calculated by: The distribution of Eq (7) illustrates a bell curve with γ as its peak, µ as the position of the peak, and δ controlling its width. These three parameters determine various properties of M a . Firstly, γ is a nonnegative constant, which represents the maximal value that could obtained by Eq (7). Secondly, µ is a constant too, but it could be negative. According to Eq (7), if a similarity value m s is close to µ, m a would be close to γ. In PSPL, G gives more attention to these pairs of pixels having smaller similarity. So µ equals the lower bound of the range of m s , which is −1 because each m s is derived by SSIM Index. Different from the above two, δ is a variable that changes linearly depending on the training steps: in which α is growth rate, and β is its initial value. Both of them are nonnegative constant. Obviously, δ is increased gradually during training process, which prompts all values in M a to approach δ. Fig.3 demonstrates how the relationship between m a and step changes in different training stage. In experiments, we set γ = 2, α = 1 and β = 0. Actually, the increase of δ leads to the decay of PSPL. In the beginning, the maximum and the minimum in M a have great difference, but all pixels would get the same attention after a certain growth. This degradation is inspired by selfpaced learning [18], in which only easy samples are learned by learner in early, but all samples will be learned finally. However, PSPL is a pixel level self-paced learning. The attention value it generated determines which pixels should be learn first.

Loss Function
PSPL influences the optimization of models by affecting the loss function. For previous SISR models, their loss function can be formulated by: in which Θ denotes the parameters in the trained model; L represents L1 or L2. The data flow of Eq (9) is shown by orange dash arrows in Fig. 2. While applying PSPL training strategy, the loss function is rewritten as: where M a is the attention map generated in Sec. 2.3, and represents element-wise multiplication. In Fig. 2, how data flows in PSPL is displayed by green arrows. The green solid arrows represent the data flow when computing loss, and the green dash arrows represent how data flows when generating attention map. Notably, the generation of M a is not a part of the network F s , which means both of M s and M a do not participate the backpropagation and can be seen as a constant matrix in each training step. In a sense, PSPL works like a teacher. Based on the local similarity between I sr and I hr , it guides L to learn more from those pixels that differ widely. However, it only works during training, but does not appear in the test phase.

EXPERIMENTS
The following contents are mainly divided into two parts. Firstly, some ablation experiments are conducted to exhibit the effect of PSPL. Secondly, the results of adopting PSPL on several existing outstanding models are compared with its original results.

Ablation Experiments
This part introduces an ablation experiment we have conducted. In the experiment, a lightweight EDSR [12] network  [19], which consists of 800 training images and 100 validation images. As shown in Fig. 4, both of them are trained and validated in 300 epochs. However, EDSR+PSPL always performs better than the vanilla EDSR. Besides, the red plotlines also display how many epochs these two models need to train when they first achieve the PSNR of 34.4 dB respectively. EDSR+PSPL model reaches it in about 70 epochs, but the vanilla EDSR needs around 125 epochs. This simple experiment fully displays the superiority of PSPL.

Comparison with Some Outstanding Methods
Besides the ablation experiments, we also apply PSPL on several existing outstanding deep models in SISR. And This part discusses how they perform with and without PSPL. To be specific, we evaluate PSPL with SRCNN, VDSR, DRRN, LapSRN, and EDSR. All models in experiments are trained on DIV2K dataset and tested on Set5, Set14, B100, and Ur-ban100. Detailed super parameters for a specific model still follow its original setting without any change. On account of the limitation of this paper, We only display the results on ×4 super-resolution. Fig. 5 displays some visual results, and Table. 1 lists the quantitative results of experimental models. From the table we can see, PSPL could improve their all performance to new heights. This illustrates that PSPL not only accelerates the training process, but also guide the parameters of trained models to a better parameter space and enhance their generalization. Even EDSR+PSPL does not perform better in Urban100 under PSNR, but it still produces better results under SSIM metric.

CONCLUSION
In this paper, we propose a training strategy to accelerate the training process and enhance the performance of SISR models called Pixel-level Self-Paced Learning (PSPL). It firstly generates an attention map according to the similarity between SR and HR image, and then grafts it onto loss function to impact the optimization of the trained SISR model. Moreover, all values in attention map is going to be close to the preset maximum value gradually during the training process, which is similar to the principle of self-paced learning. In the future, we would attempt to adopt PSPL on another pixel-wise regression task like depth estimation or deblurring, to further explore the ability of PSPL.