{'fraction_non_alphanumeric': 0.03291566832947091, 'fraction_numerical': 0.009426921717270905, 'mean_word_length': 4.822090098330666, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, '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-by-pixel Mean Opinion Score (pMOS) for No-Reference Image Quality Assessment

Deep-learning based techniques have contributed to the remarkable progress in the field of automatic image quality assessment (IQA). Existing IQA methods are designed to measure the quality of an image in terms of Mean Opinion Score (MOS) at the image-level (i.e. the whole image) or at the patch-level (dividing the image into multiple units and measuring quality of each patch). Some applications may require assessing the quality at the pixel-level (i.e. MOS value for each pixel), however, this is not possible in case of existing techniques as the spatial information is lost owing to their network structures. This paper proposes an IQA algorithm that can measure the MOS at the pixel-level, in addition to the image-level MOS. The proposed algorithm consists of three core parts, namely: i) Local IQA; ii) Region of Interest (ROI) prediction; iii) High-level feature embedding. The Local IQA part outputs the MOS at the pixel-level, or pixel-by-pixel MOS - we term it 'pMOS'. The ROI prediction part outputs weights that characterize the relative importance of region when calculating the image-level IQA. The high-level feature embedding part extracts high-level image features which are then embedded into the Local IQA part. In other words, the proposed algorithm yields three outputs: the pMOS which represents MOS for each pixel, the weights from the ROI indicating the relative importance of region, and finally the image-level MOS that is obtained by the weighted sum of pMOS and ROI values. The image-level MOS thus obtained by utilizing pMOS and ROI weights shows superior performance compared to the existing popular IQA techniques. In addition, visualization results indicate that predicted pMOS and ROI outputs are reasonably aligned with the general principles of the human visual system (HVS).


Introduction
Image Quality Assessment (IQA) finds application in various fields ranging from image compression to image restoration and image enhancement [1,12,13,18,39,42]. IQA may be classified into subjective and objective types. In case of subjective IQA, humans from the general public or domain experts assess the quality of the image and their collective ratings yield a Mean Opinion Score (MOS). However, owing to human involvement, subjective IQA is time-consuming and expensive, making it difficult to apply in real-life and real-time applications. On the other hand, objective or automatic IQA, also known as computational IQA, is performed using machines and is an important topic of interest among researchers. Recently, deep-learning based IQA has been receiving increasing attention [2,3,8,11,27,38] by the community. The objective IQA is further classified into two categories: i) Full-Reference IQA (FR-IQA)-e.g. SSIM [29], MS-SSIM [30]; ii) No-Reference IQA (NR-IQA)-e.g. BRISQUE [19], NIQE [20], CORNIA [36], PIQE [28].
Among them, NR-IQA, also known as Blind IQA (BIQA), is the most challenging because it involves measuring the quality of an image without depending on a corresponding reference image. In addition, low-level computer vision applications including image restoration and image enhancement (e.g. super resolution, de-blurring, de-noising) also often do not have reference images (i.e. original distortion free images) available, hence NR-IQA, among other IQA types, alone can be useful for assessing the image's quality to provide tailored restoration or enhancement as required.
Some low-level computer vision applications may require assessing the quality at the pixel-level, however, existing NR-IQA methods assess the quality at either the image-level (single MOS value for the whole image) or at the patch-level (dividing the image into multiple patches and assessing the quality for each patch), rendering their architecture unsuitable for pixel-level IQA.
To solve the aforementioned problem, we propose deep-learning based pixelby-pixel IQA, abbreviated as 'pIQA', comprising of three parts: i) Local IQA, that outputs MOS for each pixel; ii) Region of Interest (ROI) prediction, that outputs the weights representing relative importance of each region; iii) Highlevel feature embedding, that outputs high level features that are then embedded into the Local IQA part. The key differentiated features of proposed method are as follows: 1) The underlying neural network structure for the Local IQA part excludes any network layers that could lead to loss of information at the pixel-level such as pooling layers.
2) The ROI part, used for identifying perceptually important regions in the image, is learnt in a completed unsupervised manner without depending on complex visual attention mechanisms, eye-tracking apparatus or labelled datasets.
3) The overall image-level MOS is obtained by utilizing both pMOS and ROI (weights) values, and exceeds the performance of existing popular IQA methods.

Related Work
The fundamental goal of automatic IQA is designing a computational model that can objectively assess the quality of an image such that the objective score is as close as possible to the ground-truth IQA score obtained via subjective tests. Depending on the availability of the reference image (clean or distortion free original image) during assessment, it may be classified into FR-IQA and NR-IQA.
The FR-IQA methods focus on measuring similarity or dissimilarity between the original image and the distorted image. Classical methods include Peak Sig-nal to Noise Ratio (PSNR), Structural Similarity Index Measure (SSIM) [29] that measures similarity between underlying structures, Multi-Scale SSIM (MS-SSIM) [30] that measures SSIM at multiple scales, Feature Similarity Index Measure (FSIM) [40] that compares certain low-level features such as zero crossing or certain regions and the Gradient Similarity Metric (GSM) [15] that assesses the quality based on similarity of gradients between the distorted image and the reference image. As these methods involve the use of hand-crafted features, their performance deteriorates depending on the complexity of the characteristics of the image being assessed. Deep-learning based FR-IQA methods have emerged [10,41] and methods utilizing local normalized multi-scale Difference of Gaussian (DOG) [3] for extracting image features at various image scales in a more efficient manner have also been proposed.
NR-IQA methods, where reference image is unavailable during assessment, have also been developed. The traditional NR-IQA methods appear similar in structure to the traditional image processing and computer vision tasks wherein experts and engineers typically design hand-crated features to calculate the MOS for the image. Several NR-IQA methods involve the use of Natural Scene Statistics (NSS) [24] and are based on the premise that the statistical features of distorted image differ from those associated with natural or undistorted images. BIQI [21] is one such method that assesses the quality of an image based on Distorted Image Statistics (DIS). Other related methods include DIIVINE [22], SSEQ [16] and BLIINDS-II [23]. BRISQUE [19] is also an NSS-derived IQA method but differs in that it utilizes locally normalized features when measuring the deviation of image's statistics from the NSS. On the other hand, non-NSS based methods include CORNIA [36] and HOSA [32] which are dictionary-based methods trained through unsupervised feature learning.
However, the performance of NR-IQA methods was found to be limited, mainly due to the use of hand-crafted features, motivating the research community to try deep-learning based techniques. NR-IQA feature extraction based on deep-learning was designed by Ghadiyaram and Bovik [5]. Another method using two CNNs utilizing image and gradient map was proposed in [33]. In addition, a technique called RankIQA, which learns mutual rank orders between images for the same distribution type, was proposed in [17], and another method called BLINDER, which uses features derived from VGG-16 network, was proposed in [4]. Hallucinated-IQA [14] made an effort to integrate the human vision system into the pipeline. Research efforts were also made to generate dataset for NR-IQA using the General Adversary Network (GAN) [7]. Whereas Hy-perIQA proposes a multiscale feature fused hypernetwork architecture with a two-step quality prediction procedure involving a semantic feature learning step followed by content-based image quality prediction step [25], MetaIQA proposes a meta-learning approach that first learns meta-knowledge using various distortions which then serves as a prior model for quickly fine-tuning the quality model to unknown distortions [43]. TRIQ was the first technique to borrow the Transformer structure from the IQA [37]. In addition, TranSLA [44] improve the performance through reinforcing feature aggregation by adding a Boosting Inter-  action Part (comprising of saliency and gradient maps) to the model structure of TRIQ.
While various works have greatly contributed to the progress of IQA, no studies have been conducted to assess the image quality at the pixel-level. In this work, we proposed a deep-learning based NR-IQA technique called pixel-by-pixel IQA (pIQA) that is capable of assessing the image quality at the pixel-level in terms of proposed pixel-level MOS (pMOS), and the obtained pMOS values are then used in conjunction with the proposed ROI weights to derive the overall quality score at the image-level.

Proposed Method
This section describes the proposed pIQA. The overall architecture of proposed method is shown in Fig. 1. The proposed method consists of three parts: i) Local IQA; ii) ROI prediction; iii) High-level feature embedding. The Local IQA, is a neural network with a small receptive field and utilizes low-level features for outputting the MOS at the pixel-level i.e. MOS value for each pixel of the image (pMOS). The ROI prediction parts outputs the weights representing the relative importance of region, which are used when calculating the overall/imagelevel MOS. The High-level feature embedding part extracts high-level features that are used for both compensating the shortcomings of the Local IQA network when calculating the pMOS and as input to the ROI prediction part. The overall/image-level MOS is calculated as a weighted sum of pMOS values and ROI weights.

Local IQA
The Local IQA network is configured to utilize low-level image features and has a narrow receptive field in order to be able to measure the MOS at the pixel-level. As shown in Fig 1, it consists of two modules, namely: Local feature extractor module and MOS regression module. Only convolution layer, batch normalization and ReLU are utilized in their construction. Moreover, only 10 convolution layers are used and the feature dimension is also kept minimal. Any layers such as strided convolution or pooling layers that lead to reduction in feature resolution are omitted from the network design in order to output MOS values which have same dimension with input image. A total of seven 3×3 2-D convolution layers towards the front (part of the local feature extractor module) extract the local features, and a total of three 1×1 2D convolution layers towards the end (part of the MOS regression module) transform the extracted features into pMOS values. The regression module in the proposed structure plays a similar role as that of a fully connected layer present in the existing IQA networks.

ROI prediction
When a subjective evaluation is conducted, it is typical that not all regions of the image receive equal attention or consideration. For example, it is observed that during subjective evaluations, humans typically focus on the image regions rich in texture than flat regions and they focus more on the foreground than the background. Existing IQA methods make use of pooling layers and strided convolution layers to sample important regions while downsizing the image. However, in case of the proposed Local IQA part, since there is no such layer to sample important image regions, we design the proposed ROI prediction architecture that encapsulates the relative importance of image regions in terms of ROI weights. As shown in Fig. 1, the ROI prediction part receives the extracted high-level and low-level features as input and outputs the ROI weights through the ROI regression module; the ROI regression module has the same structure as that of the MOS regression module but with the dropout layer removed.
Linear normalization The proposed ROI prediction structure is similar to that of saliency prediction. Therefore, we added a normalization layer towards the end, as done in case of saliency prediction. We used linear normalization proposed in [34] instead of the commonly used softmax normalization since it has been shown that linear normalization tends to reflect the probability distribution of human fixation more accurately than softmax normalization. Softmax normalization and linear normalization are shown in Eq (1) and Eq (2) respectively.

High-level feature embedding
Since Local IQA has a narrow receptive field and a shallow network structure, adding high-level features can compensate for the shortcomings of the Local IQA. The high-level features used in our work are based on those used in [9] but differ in that we modify the underlying InceptionResNetV2 [26] used for extracting these features. In InceptionResNetV2, there is a layer with kernel-size of three but padding of 0. Since the spatial resolution is reduced in absence of padding, we add padding where it is missing in order to preserve the spatial information of the features. For example, the 2D convolution layer and max-pooling layer of the 'Reduction-A block' in InceptionResNetV2 have a kernel size of 3 and a padding size of 0. In this case, however, the resolution is reduced by 2 pixels horizontally and vertically. Hence, the padding of size 1 was added to prevent the loss of spatial information. The network body before the global average pooling of the our modified InceptionResNetV2 was then used as a backbone network. Since the feature resolution extracted by the modified backbone network is 1/32 times the image size, the nearest neighbor upscaling is performed 32 times to match the local feature resolution with the size of the image. In addition, since the number of channels of the extracted high-level features is very large, the channels were compressed using a 1×1 convolution layer before embedding the features to the local IQA. The features extracted from the Local feature extraction module and the High-level feature embedding are then concatenated inside the Local IQA part and passed through the MOS regression module to output the pMOS.
Dilated inception module(DIM) DIM is a low-complexity method designed for predicting saliency utilizing a very wide receptive field [34]. The DIM is added before the high-level feature are provided as input to the ROI regression module. In this case, the receptive field almost covers the entire image, so if there is a  center-bias, it has the effect of being learnt implicitly. The high-level features after passing through the DIM are up-scaled and then concatenated with the local features before being provided as input to the ROI regression module.

Loss fuction
The proposed network makes use of L1 loss during training.
P and G represent the predicted MOS and ground-truth MOS at the imagelevel, respectively, and p = (p 1,1 , ..., p M,N ) represents the set of predicted pMOS. Through this equation, ROI is learned in an unsupervised manner without depending on any ROI ground-truth.
MOS mean shifted loss When the ROI network is learned via the Eq. (3), the p i,j (=pMOS) acts as the learning weight. As a result, when the MOS value is high, the ROI network inadvertently has high learning weight, and when the MOS value is low, it has a low learning weight. For example, when the MOS range is between 1 and 5, the learning speed of the ROI network can vary as much as 5 times. However, since this is not what we intended, we need to correct the learning weight.
Looking at the MOS distribution in Fig. 2, the probability is highest towards the center and the lowest at both ends of the MOS range. Therefore, from an entropy perspective, both ends have more information than the distribution at the center of the MOS. If the mean value of p i,j is moved to 0 during the learning phase, the learning weight can be lowered towards the center of the MOS whereas a higher learning weight can be assigned towards the both ends, as a result a higher learning weight is assigned to the part of the distribution containing more important information. The final loss after MOS mean-shift is as follows: 4 Experimental Results

Dataset
IQA datasets can be largely divided into two types [35]. The first type is the synthetic dataset which is created by applying various types of distortions to a small number of reference images. The second type is called authentic or realistic dataset that contains images having authentic distortions. However, synthetic dataset lacks the diversity of images required to learn our ROI prediction part as the number of reference images is too small to be meaningful. Therefore, we conduct experiments utilizing KonIQ-10k [9] and LIVE Challenge [6] dataset (LIVEC), two popular large-scale public datasets containing diverse images. The KonIQ-10K consists of a total of 10,073 images, each having a dimension of 1024×768. These images were sampled from YFCC100m considering the distribution of contrast, color and sharpness. LIVEC consists of a total of 1,162 images each having a dimension of 500×500. The images were captured in-the-wild by different photographers with a variety of camera devices and were evaluated by more than 8,100 subjects.

Implementation details
We use the Nvidia Tesla V100 GPU and the Pytorch library for our experimental environment. We make use of Adam optimizer and a total of 90 epoch trains, dividing them into three epoch trains of 30 each, with respective learning rates of 10 −4 , 5×10 −4 and 10 −5 . A batch size of 48 is used for KonIQ and 36 for LIVEC, and KonIQ is downsized by 1 2 to conduct the experiment on images having size of 512× 384 each. In addition, random 180 degree rotations and random image flips are performed for data augmentation purpose. Like other state-of-the-art methods [25,31,43,44], we split the dataset randomly-80% is used for training and the remaining 20% is used for testing purposes. The parametric values for DIM (Fig. 1b)   LIVEC were shifted and scaled such that the the overall mean and variance of LIVEC become the same as that of KonIQ.

Evaluation results and discussion
We evaluate the performance of our proposed method based on Pearson's Linear Correlation Coefficient (PLCC) and Spearman's Rank Order Correlation Coefficient (SRCC), which are commonly used metrics for performance evaluation of IQA. Whereas PLCC measures the accuracy of the prediction, SRCC measures the monotonicity of the prediction. The values for both PLCC and SRCC range between -1 and 1 (higher value represents better the performance). Addidionaly, Root Mean Square Error (RMSE) results are also presented in Table 1.
A. Comparison with the State-of-the-art We compared the performance of our method with other popular IQA methods. The comparative results are summarized in Table 1, with the best-performance indicated in bold. As can be seen from Table 1, our method achieves the highest PLCC and SRCC values on both KonIQ and LIVEC datasets. In particular, while RMSE shows a significant decrease of 7.3% compared to existing techniques for KonIQ, we cannot provide the comparison for LIVEC as information on the MOS scale used by the previous works is unavailable.
B. Ablation study An ablation study was conducted to investigate the efficacy of the individual parts of the proposed method. Table 2 shows the results obtained as each part is added one after the other. The network, when consisting of Local IQA alone, shows poor performance as it has learned to predict the MOS by assigning the same weights to all regions in an image. However, when the ROI prediction part is added, it can be seen that the performance is dramatically improved as the MOS is calculated through a weighted sum wherein more weight is assigned to perceptually more important regions of the image. Finally, when High-level feature embedding part is also added, the performance is again improved owing to the inclusion of high-level features which could not be captured by the Local IQA network alone. Fig. 3 shows the visualization results of the proposed method. The resultant image is displayed for two cases: when the network includes the high-level features (i.e. both local features and high-level features are used) and when the excludes the high-level features (i.e. only local features are used). In Fig 3, (a) (o) show the respective ROI prediction results when using the local-features alone. As we can see from Fig. 3, the network including both high-level and local features appear to calculate pMOS and ROI by considering high-level concepts such as objects (for example people and flowers), in addition to low-level features such as edges. Especially for images such as Fig. 3 (a) that contain a distinct foreground object and a background, we can see that pMOS values tend to be higher for the foreground pixels than the background pixels. Similarly, ROI shows higher weight values for the in-focus pixels compared to the out-of-focus pixels. On the other hand, the network relying upon local feature alone appears to calculate pMOS and ROI mainly by analyzing the low-level features such as edges and texture. However, the pMOS values calculated using only the local-features shown a better pixel-level alignment due to the associated low-receptive field.

Conclusion
We propose a new IQA method called the pixel-by-pixel IQA (pIQA) that can calculate MOS values at the pixel-level (pMOS) in addition to the image-level, unlike existing IQA techniques that can calculate MOS value at the image-level alone. Moreover, our image-level MOS predicted through a weighted sum of pMOS and ROI achieves superior results (in terms of PLCC, SRCC and RMSE) when compared with existing popular methods. In addition, visualization results indicate that ROI output is reasonable and largely aligned with our general expectations in that the weights are found to be typically high for pixels containing objects, foregrounds and edges. Moreover, the nature of pMOS values resmbles that of MOS values in that both tend to have relatively higher values for in-focus or sharp regions than out-of-focus or flat regions. In the future, we would like to focus on designing a lighter and more accurate network architecture in order to further improve its potential applicability to other low-level vision applications.    Table 3 shows the learning results obtained for the case when MS loss is excluded ('without MS Loss'). These results are obtained when learning is performed based on Eq. (3) instead of Eq. (4). As can be seen from these results, the performance decreases significantly when MS loss is not used; RMSE values are especially high indicating that learning has not been done properly. Visualizations shown in Fig. 5 indicate that the ROI prediction for 'without MS loss' case is not as accurate when compared to that for the 'with MS loss' case.

Effect of Dilated inception module (DIM)
In order to test the effectiveness of DIM, we re-performed the experiment by replacing DIM's dilated 2D convolution layer with a normal 2D convolution layer instead. Fig. 5 shows the visual results which are obtained by averaging the ROI prediction for all the test images. (a) and (b) are the results of 'with DIM' and 'without DIM' cases for the KonIQ dataset, respectively, and (c) and (d) are the results of 'with DIM' and 'without DIM' cases for the LIVEC dataset, respectively. We observe that whereas the center-bias effect is relatively stronger for the KonIQ dataset for the 'with DIM' case, it is relatively weaker for LIVEC dataset owing to few image samples (225 test images) although the center-bias effect is found to be more pronounced than for the 'without DIM' case. However, we observe little difference in the PLCC, SRCC, and RMSE results inferred from Table 3-this may be because the center-bias for ROI prediction does not appear to significantly affect the results for the IQA, unlike for the general saliency prediction. In addition, it is reasonable to argue that the slight differences in the results may be due to the variance arising from the randomnesss at the network initialization/learning stage, or it may be due to the varying influence of center-bias effect according to the underlying nature of each dataset.
Effect of linear normalization In order to test the effectiveness of linear normalization (Eq. 2), we re-performed the experiment by using the commonly used softmax normalization (Eq. 1), instead; please refer to the results under  the 'with softmax normalization' row of Table 3. The experimental results indicate that the performance when using linear normalization is better than when using softmax normalization, and these findings are in agreement with the results of [34] supporting that linear normalization better reflects the human eye fixation phenomenon.