T RANSFERABLE R ECOGNITION -A WARE I MAGE P ROCESSING
Anonymous authors
Paper under double-blind review
A BSTRACT
Recent progress in image recognition has stimulated the deployment of vision systems (e.g. image search engines) at an unprecedented scale.
As a result, visual data are now often consumed not only by humans but also by machines.
Meanwhile, existing image processing methods only optimize for better human perception, whereas the resulting images may not be accurately recognized by machines.
This can be undesirable, e.g., the images can be improperly handled by search engines or recommendation systems.
In this work, we propose simple approaches to improve machine interpretability of processed images: optimizing the recognition loss directly on the image processing neural network or through an intermediate transforming model, a process which we show can also be done in an unsupervised manner.
Interestingly, the processing model’s ability to enhance the recognition performance can transfer when evaluated on different recognition models, even if they are of different architectures, trained on different object categories or even different recognition tasks.
This makes the solutions applicable even when we do not have the knowledge about future downstream recognition models, e.g., if we are to upload the processed images to the Internet.
We conduct comprehensive experiments on three image processing tasks with two downstream recognition tasks, and conﬁrm our method brings substantial accuracy improvement on both the same recognition model and when transferring to a different one, with minimal or no loss in the image processing quality.
I NTRODUCTION
[Figure]
Unlike in image recognition where a neural network maps an image to a semantic label, a neural network used for image processing maps an input image to an output image with some desired properties.
Examples include image super-resolution (Dong et al., 2014), denoising (Xie et al., 2012), deblurring (Eigen et al., 2013), colorization (Zhang et al., 2016) and style transfer (Gatys et al., 2015).
The goal of such systems is to produce images of high perceptual quality to a human observer.
For example, in image denoising, we aim to remove noise in the signal that is not useful to an observer and restore the image to its original “clean” form.
Metrics like PSNR and SSIM (Wang et al., 2004) are often used (Dong et al., 2014; Tong et al., 2017) to approximate human-perceived similarity between the processed images with the original images, and direct human assessment on the ﬁdelity of the output is often considered the “gold-standard” assessment (Ledig et al., 2017; Zhang et al., 2018b).
Therefore, many techniques (Johnson et al., 2016; Ledig et al., 2017; Isola et al., 2017) have been proposed for making the output images look perceptually pleasing to human.
However, image processing outputs may not be accurately recognized by image recognition systems.
As shown in Fig.
1, the output image of an denoising model could easily be recognized by a human as a bird, but a recognition model classiﬁes it as a kite.
One could speciﬁcally train a recognition model only on these output images produced by the denoising model to achieve better performance on such images, or could leverage some domain adaptation approaches to adapt the recognition model to this domain, but the performance on natural images can be harmed.
This retraining/adaptation scheme might also be impractical considering the signiﬁcant overhead induced by catering to various image processing tasks and models.
With the fast-growing size of image data, many images are often “viewed” and analyzed more by machines than by humans.
Nowadays, any image uploaded to the Internet is likely to be analyzed by certain vision systems.
For example, Facebook uses a system called Rosetta to extract texts from over 1 billion user-uploaded images every day (Maria, 2018).
It is of great importance that the processed images be recognizable by not only humans, but also by machines.
In other words, recognition systems (e.g., image classiﬁer or object detector), should be able to accurately explain the underlying semantic meaning of the image content.
In this way, we make them potentially easier to search, recommended to more interested audience, and so on, as these procedures are mostly executed by machines based on their understanding of the images.
Therefore, we argue that image processing systems should also aim at better machine recognizability.
We call this problem “Recognition-Aware Image Processing”.
It is also important that the enhanced recognizability is not speciﬁc to any concrete neural networkbased recognition model, i.e., the improvement on recognition performance is only achieved when the output images are evaluated on that particular model.
Instead, the improvement should ideally be transferable when evaluated on different models, to support its usage without access to possible future recognition systems, since we may not decide what model will be used for recognizing the processed image, for example if we upload it to the Internet or share it on social media.
We may not know what network architectures (e.g. ResNet or VGG) will be used for inference, what object categories the downstream model recognizes (e.g. animals or scenes), or even what task will be performed on the processed image (e.g. classiﬁcation or detection).
Without these speciﬁcations, it might be hard to enhance image’s machine semantics.
In this work, we propose simple and highly effective approaches to make image processing outputs more accurately recognized by downstream recognition systems, transferable among different recognition architectures, categories and tasks.
The approaches we investigate add a recognition loss optimized jointly with the image processing loss.
The recognition loss is computed using a ﬁxed recognition model that is pretrained on natural images, and can be done in an unsupervised manner, e.g., without semantic labels of the image.
It can be optimized either directly by the original image processing network, or through an intermediate transforming network.
We conduct extensive experiments, on multiple image enhancement/restoration (super-resolution, denoising, and JPEG-deblocking) and recognition (classiﬁcation and detection) tasks, and demonstrate that our approaches can substantially boost the recognition accuracy on the downstream systems, with minimal or no loss in the image processing quality measured by conventional metrics.
Also, the accuracy improvement transfers favorably among different recognition model architectures, object categories, and recognition tasks, which renders our simple solution effective even when we do not have access to the downstream recognition models.
Our contributions can be summarized as follows:
• We propose to study the problem of enhancing the machine interpretability of image processing outputs, a desired property considering the amount of images analyzed by machines nowadays.
• We propose simple and effective methods towards this goal, suitable for different use cases, e
g., without ground truth semantic labels.
Extensive experiments are conducted on multiple image processing and recognition tasks, demonstrating the wide applicability of the proposed methods.
• We show that using our simple approaches, the recognition accuracy improvement could transfer among recognition architectures, categories and tasks, a desirable behavior making the proposed methods applicable without access to the downstream recognition model.
R ELATED W ORK
Image processing/enhancement problems such as super-resolution and denoising have a long history (Tsai, 1984; Park et al., 2003; Rudin et al., 1992; Cand`es et al., 2006). Since the initial success of deep neural networks on these problems (Dong et al., 2014; Xie et al., 2012; Wang et al., 2016b), a large body of works try to investigate better model architecture design and training techniques (Dong et al., 2016;
Kim et al., 2016b; Shi et al., [Table] [Table] [Table]
[Table]
[Table]
[Table] [Table] [Table] [Table]
[Table]
[Table]
[Table]
[Table] [Table] [Table] et al., 2018; Lefkimmiatis, 2018; Chen et al., 2018; Haris et al., 2018b), mostly on the image superresolution task.
These works focus on generating high visual quality images under conventional metrics or human evaluation, without considering recognition performance on the output.
There are also a number of works that relate image recognition with processing.
Some works (Zhang et al., 2016; Larsson et al., 2016; Zhang et al., 2018c; Sajjadi et al., 2017) use image classiﬁcation accuracy as an evaluation metric for image colorization/super-resolution, but without optimizing for it during training. Wang et al. (2016a) incorporates super-resolution and domain adaptation techniques for better recognition on very low resolution images.
Bai et al.
(2018) train a superresolution and reﬁnement network simultaneously to better detect faces in the wild.
Zhang et al.
(2018a) train networks for face hallucination and recognition jointly to achieve better recover the face identity from low-resolution images.
Liu et al.
(2018) considers 3D face reconstruction and trains the recognition model jointly with the reconstructor.
Sharma et al.
(2018) trains a classiﬁcation model together with an enhancement module.
Our problem setting is different from these works, in that we assume we do not have the control on the recognition model, as it might be on the cloud or decided in the future, thus we advocate adapting the image processing model only.
This also ensures the recognition model is not harmed on natural images.
Haris et al.
(2018a) investigate how super-resolution could help object detection in low-resolution images.
VidalMata et al.
(2019) and Banerjee et al.
(2019) also aims to enhance machine accuracy on poor-conditioned images but mostly focus on better image processing techniques without using recognition models.
Wang et al.
(2019) propose a method to make denoised images more accurately segmented, also presenting some interesting ﬁndings in transferability.
Most existing works only consider one image processing task or image domain, and develop speciﬁc techniques, while our simpler approach is task-agnostic and potentially more widely applicable.
Our work is also related but different from those which aims for robustness of the recognition model (Hendrycks & Dietterich, 2019;
Li et al., 2019; Shankar et al., 2018), since we focus on the training of the processing models and assume the recognition model is given.
M ETHOD
In this section we ﬁrst introduce the problem setting of “recognition-aware” image processing, and then we develop various approaches to address it, each suited for different use cases.
3. P ROBLEM S ETTING
In a typical image processing problem, given a set of training input images { I kin } and corresponding target images { I ktarget } ( k = 1 , · · · N ), we aim to train a neural network that maps an input image to its corresponding target.
For example, in image denoising, I kin is a noisy image and I ktarget is the corresponding clean image.
Denoting this mapping network as P (for processing), parameterized by W P , during training our optimization objective is:
[Equation]
where P (cid:0) I kin (cid:1) is simply the output of the processing model I out , and l proc is the loss function for each sample.
The pixel-wise mean-squared-error (MSE, or L 2 ) loss is one of the most popular choices.
During evaluation, the performance is typically measured by average similarity (e.g.,
PSNR, SSIM) between I ktarget
and I kout =
P (cid:0) I kin (cid:1) , or through human assessment.
In our problem setting of recognition-aware processing, we are interested in a recognition task, with a trained recognition model R ( R for recognition), parameterized by W R .
We assume each input/target image pair I kin /I
ktarget is associated with a ground truth semantic label S k for the recognition task.
Our goal is to train a image processing model P such that the recognition performance on the output images { I kout =
P (cid:0) I kin (cid:1) } is high, when evaluated using R with the semantic labels { S k } .
In practice, the recognition model R might not be available (e.g., on the cloud), in which case we could resort to other models if the performance improvement transfers among models. [Figure]
3. O PTIMIZING R ECOGNITION L OSS
Given our goal is to make the output images by P more recognizable by R , it is natural to add a recognition loss on top of the objective of the image processing task (Eqn. 1) during training: [Figure]
[Equation]
2) l recog is the per-example recognition loss deﬁned by the downstream recognition task.
For example, for image classiﬁcation, l recog could be the cross-entropy (CE) loss.
Adding the image processing loss (Eqn. 1) and recognition loss (Eqn. 2) together, our total training objective becomes
[Figure] [Equation] [Equation]
where λ is the coefﬁcient controlling the weights of L recog relative to L proc .
We denote this simple solution as “RA (Recognition-Aware) processing”, which is visualized in Fig.
2 left.
Note that once the training is ﬁnished, the recognition model used as loss is not needed anymore, and during inference, we only need the processing model P, thus no additional overhead is introduced when the model is actually put to deployment.
A potential shortcoming of directly optimizing L recog is that it might deviate P from optimizing the original loss L proc , and the trained P will generate images that are not as good as if we only optimize L proc .
We will show that in experiments, however, with proper choice of λ , we could substantially boost the recognition performance with minimal or no sacriﬁce on image quality.
If using R as a ﬁxed loss function can only boost the recognition accuracy on R itself, the use of the method could be restricted.
Sometimes we do not have the knowledge about the downstream recognition model or even task, but we still would like to improve future recognition performance.
Interestingly, we ﬁnd that image processing models trained with the loss of one recognition model
R 1 , can also boost the performance when evaluated using recognition model R 2 , even if model Rhas a different architecture, recognizes a different set of categories or even is trained for a different task.
This makes our method effective even when we cannot access the target downstream model, in which case we could use another trained model we do have access to as the loss function.
This phenomenon also implies that the “recognizability” of a processed image can be a more general notion than just the extent it ﬁts to a speciﬁc model.
More details on how the improvement is transferable among different recognition models will be presented in the experiments.
3. U NSUPERVISED O PTIMIZATION OF R ECOGNITION L OSS
The solution mentioned above requires semantic labels available for training images, which however, may not be satisﬁed all the time.
In this case, we could instead resort to regress the recognition model’s output of the target image R ( I ktarget ) , given the target images { I ktarget } at hand, and that the recognition model R is pretrained and ﬁxed.
The recognition objective in Eqn.
2 changes to
[Equation]
where l dis is a distance metric between R ’s output given input of processed image P (cid:0) I kin (cid:1) and ground truth target image I ktarget .
For example, when R is a classiﬁcation model and outputs a probability distribution over classes, l dis could be the KL divergence or simply a L 2 distance.
During evaluation, the output of R is still compared to the ground truth semantic label S k .
We call this approach “unsupervised RA”.
Note that it is only “unsupervised” for training model P , but not necessarily for the model R . The (pre)training of the model R is not our concern since in our problem setting (Sec. 3.1) R is a given trained model, and it can be trained in any manner, either with or without full supervision, and it can even be trained with another dataset as we later show in Sec. 4.4.
This approach is to some extent related to the “knowledge distillation” paradigm (Hinton et al., 2014) used for network model compression, where the output of a large model is used to guide the output of a small model, given the same input images.
Instead we use the same recognition model R but guide the upstream processing model to generate input to R which produces similar output with that of the target image.
3. U SING AN I NTERMEDIATE T RANSFORMER
Sometimes we do want to guarantee that the added recognition loss L recog will not deviate the model
P from optimizing its original loss.
We can achieve this by introducing another intermediate transformation model T .
After the input image going through the image processing model P , the output image is ﬁrst fed to the model T , and T ’s output image serves as the input for the recognition model
R (Fig. 2 right).
In this case, T ’s parameters W T are optimized for minimizing the recognition loss:
[Equation]
In this way, with the help of T on optimizing the recognition loss, the model P can now “focus on” its original image processing loss L proc .
The optimization objective becomes:
[Equation]
In Eqn. 6, P is still solely optimizing L proc as in the original image processing problem (Eqn. 1).
P is learned as if there is no recognition loss, and therefore the image processing quality of its output will not be affected.
This could be achieved by “cutting” the gradient generated by L recog between the model T and P (Fig. 2 right).
The responsibility for a better recognition performance falls on the model T .
We term this solution as “RA with transformer”.
The downside of using a transformer compared with directly optimizing recognition loss using the processing model, is that there are two instances for each image (the output of model P and T ), one is “for human” and the other is “for machines”.
Also, as we will show later, it can sometimes harm the transferability of the performance improvement, possibly because there is no image processing loss as a constraint on T ’s output.
Therefore, the transformer is best suited for the case where we want to guarantee the image processing quality not affected at all, at the expense of maintaining another image and losing some transferability.
E XPERIMENTS
We evaluate our proposed methods on three image processing tasks, namely image super-resolution, denoising, and JPEG-deblocking. More speciﬁcally, these are image enhancement or restoration tasks, where usually the target image is an enhanced image or the original image.
Other more broader image processing tasks such as pattern detection, segmentation, object extraction are not considered in this work.
To obtain the input images, for super-resolution, we use a downsampling scale factor of 4 × ; for denoising, we add Gaussian noise on the images with a standard deviation of 0.1 to obtain the noisy images; for JPEG deblocking, a quality factor of 10 is used to compress the image to JPEG format.
We pair these three tasks with two common visual recognition tasks, image classiﬁcation and object detection.
We adopt the SRResNet (Ledig et al., 2017) as the architecture of the image processing model P , due to its popularity and simplicity.
For the transformer model T , we use the 6-block ResNet architecture in CycleGAN (Zhu et al., 2017), a general-purpose image to image transformation network.
For classiﬁcation we use the ImageNet and for detection we use
PASCAL VOC as our benchmark.
The recognition architectures are ResNet, VGG and DenseNet.
Training is performed with the training set and results on the validation set are reported.
For more details on the training settings and hyperparameters of each task, please refer to Appendix A. [Table]
E VALUATION ON THE S AME R ECOGNITION M ODEL
[Table]
We ﬁrst show our results when evaluating on the same recognition model, i.e., the R used for evaluation is the same as the R we use as the recognition loss in training.
Table 1a shows our results on
ImageNet classiﬁcation.
ImageNet-pretrained classiﬁcation models ResNet-18/50/101, DenseNet121 and VGG-16 are denoted as R18/50/101, D121, V16 in Table 1a.
The “No Processing” row denotes the recognition performance on the input of the image processing model: for denoising/JPEGdeblocking, this corresponds to the noisy/JPEG-compressed images; for super-resolution, the lowresolution images are bicubic interpolated to the original resolution.
“Plain Processing” denotes conventional image processing models trained without recognition loss as described in Eqn. 1.
We observe that a plainly trained processing model can boost the accuracy over unprocessed images.
These two are considered as baselines in our experiments.
From Table 1a, using RA processing can signiﬁcantly boost the accuracy of output images over plainly processed ones, for all image processing tasks and recognition models.
This is more prominent when the accuracy of plain processing is lower, e.g., in super-resolution and JPEG-deblocking, in which case we mostly obtain ∼ 10% accuracy improvement.
Even without semantic labels, our unsupervised RA can still in most cases outperform baseline methods, despite achieves lower accuracy than its supervised counterpart.
Also in super-resolution and JPEG-deblocking, using an intermediate transformer T can bring additional improvement over RA processing.
The results for object detection are shown in Table 1b.
We observe similar trend as in classiﬁcation: using recognition loss can consistently improve the mAP over plain image processing by a notable margin.
On super-resolution, RA processing mostly performs on par with RA with transformer, but on the other two tasks using a transformer is slightly better.
The model with transformer performs better more often possibly because with this extra network in the middle, the capacity of the whole system is increased: in RA Processing the processing model P optimizes both processing and recognition loss, but now P optimizes processing loss while T optimizes recognition loss
4. T RANSFER BETWEEN R ECOGNITION A RCHITECTURES
In reality, sometimes the recognition model R we want to eventually evaluate the output images on might not be available for us to use as a loss for training, e.g., it could be on the cloud, kept conﬁdential or decided later.
In this case, we could train an image processing model P using recognition model R A that is accessible to us, and after we obtain the trained model P , evaluate its output images’ recognition accuracy using another unseen recognition model R B .
We evaluate all model architecture pairs on ImageNet classiﬁcation in Table 2 and Table 3, for RA Processing and RA with
Transformer respectively, where row corresponds to the model used as recognition loss ( R A ), and
[Table]
In Table 2’s each column, training with any model R A produces substantially higher accuracy than plainly processed images on R B .
Thus, we conclude that the improvement on the recognition accuracy is transferable among different recognition architectures.
A possible explanation for this is that these models are all trained on the same ImageNet dataset, such that their mapping functions from input to output are similar, and optimizing the loss of one would lead to the lower loss of another.
This phenomenon enables us to use RA processing without the knowledge of the downstream recognition model architecture.
However, among all rows, the R A that achieves the highest accuracy is still the same model as R B , indicated by the diagonal boldface numbers in Table 2. [Table]
Meanwhile in Table 3, in most cases improvement is still transferable when we use a transformer
T , but there are a few exceptions.
For example, when R A is ResNet or DenseNet and when R B is
VGG-16, in most cases the accuracy fall behind plain processing by a large margin.
This weaker transferability is possibly caused by the fact that there is no constraint imposed by the image processing loss on T ’s output, thus it “overﬁts” more to the speciﬁc R it is trained with.
For more results on object detection and unsupervised RA, please refer to the Appendix B.1.
This is intuitive since the processing model optimizes the same recognition loss during training as that used in evaluation.
One of the reasons why our method attains transferability is possibly that these models learn many common features that could be useful for general computer vision, especially in shallower layers.
More importantly, the reason could be similar to the reason why adversarial examples can transfer among models: different models’ decision boundaries are similar. Liu et al. (2016) studies adversarial examples’ transferability and shows decision boundaries of different models align well with each other; Tram`er et al. (2017) quantitatively analyzes similarity of different models’ decision boundaries, and shows that the boundaries are close in arbitrary directions, whether adversarial or benign.
4. T RANSFER BETWEEN O BJECT C ATEGORIES
What if the R A and R B recognize different categories of objects?
Can RA processing still bring transferable improvement?
To answer this question, we divide the 1000 classes from ImageNet into two splits (denoted as category A/B ), each with 500 classes, and train two 500-way classiﬁcation models (ResNet-18) on both splits, obtaining R A and R B .
Next, we train two image processing models P A and P B with the R A and R B as recognition loss, using images from category A and
B respectively.
Note that neither the image processing model P nor the recognition model R has seen any images from the other split of categories during training, and R A and R B learn completely different mappings from input to output.
The plain processing counterparts of P A and P B are also trained with category A and B respectively, but without the recognition loss.
We evaluate obtained image processing models on both splits, and the results are shown in Table 4.
[Table]
We observe that using RA processing still beneﬁts the recognition accuracy even when transferring across categories (e.g., in super-resolution, from 60.1% to 66.5% when transferring from category A to category B , on super resolution).
The improvement is only marginally lower than directly training with recognition model of the same category (e.g., from 60.2% to 67.8% when trained and evaluated both on category B ).
Such transferability between categories suggest the learned image processing models do not improve accuracy by adding category-speciﬁc signals to the output images, instead they generate more general signals that enable a wider set of classes to be better recognized.
4. T RANSFER BETWEEN R ECOGNITION T ASKS
What if we take a further step to the case when R A and R B not only recognize different categories, but also perform different tasks?
We evaluate such task transferability for when task A is classiﬁcation and task B is object detection in Table 5.
For results on the opposite direction and results for unsupervised RA, please refer to Appendix B.2.
[Table] In Table [Table] note that rows indicate classiﬁcation models used as loss and columns indicate detection models, so even if they are of the same name (e.g., “R18”), they are still different models, and are trained on different datasets for different tasks.
We are transferring between architectures, categories as well as tasks in this experiment.
There is even a domain shift since the model P is trained with
ImageNet training set but fed with PASCAL VOC input images during evaluation.
Here “Plain
Processing” models are trained on the ImageNet instead of PASCAL VOC dataset, thus the results are different from those in Table 1b.
We observe that except two cases on the “V16” column in denoising, using classiﬁcation loss on model A (row) can boost the detection accuracy on model B notably upon plain processing.
This improvement is even comparable with directly training using the detection loss, as in Table 1b.
Such task transferability suggests the “machine semantics” of the image could even be a task-agnostic property, and makes our method even more broadly applicable.
4. I MAGE P ROCESSING Q UALITY C OMPARISON
We have analyzed the recognition accuracy of the output images, now we compare the output image quality using conventional metrics PSNR and SSIM.
When using RA with transformer, the output quality of P is guaranteed unaffected, therefore here we evaluate RA processing.
We use ResNeton ImageNet as R , and report results with different λ s (Eqn. 3) in Table 6.
[Table]
λ = 0 corresponds to plain processing.
When λ = 10 − 4 , in super-resolution, the PSNR/SSIM metrics are even slightly higher, and in denoising and JPEG-deblocking they are only marginally worse.
However, the accuracy obtained is signiﬁcantly higher.
This suggests that the added recognition loss is not harmful when λ is chosen properly.
When λ is excessively large ( 10 − 2 ), the image quality is hurt more, and interestingly even the recognition accuracy start to decrease.
A proper balance between image processing loss and recognition loss is needed for both image quality and performance on downstream recognition tasks
[Table]
[Figure]
In Fig.
3, we visualize some examples where the output image is incorrectly classiﬁed with a plain image processing model, and correctly recognized with RA processing.
With smaller λ ( 10 − 2 and 10 − 3 ), the image is nearly the same as the plainly processed images.
When λ is too large ( 10 − 2 ), we could see some extra textures when zooming in.
For more results please refer to Appendix C.
A NALYSIS
In this section we analyze some alternatives to our approaches.
All experiments in this section are conducted using RA processing on super-resolution, with ResNet-18 trained on ImageNet as the recognition model, and λ = 10 − 3 if used.
Training without the Image Processing Loss.
It is possible to train the processing model on the recognition loss L recog , without even keeping the original image processing loss L proc (Eqn. 3).
This may presumably lead to better recognition performance since the model P can now “focus on” optimizing the recognition loss.
However, we found removing the original image processing loss hurts the recognition performance: the accuracy drops from 61.8% to 60.9%; even worse, the SSIM/PSNR metrics drop from 26.33/0.792 to 16.92/0.263, which is reasonable since the image processing loss is not optimized during training.
This suggests the original image processing loss is helpful for the recognition accuracy, since it helps the corrupted image to restore to its original form.
Fine-tuning the Recognition Model.
Instead of ﬁxing the recognition model R , we could ﬁnetune it together with the training of image processing model P , to optimize the recognition loss.
Many prior works (Sharma et al., 2018; Bai et al., 2018; Zhang et al., 2018a)
do train/ﬁne-tune the recognition model jointly with the image processing model.
We use SGD with momentum as R ’s optimizer, and the ﬁnal accuracy reaches 63.0%.
However, since we do not ﬁx R , it becomes a model that speciﬁcally recognizes super-resolved images, and we found its performance on original target images drops from 69.8% to 60.5%.
Moreover, when transferring the trained P on ResNet56, the accuracy is 62.4 %, worse than 66.7% when we train with a ﬁxed ResNet-18.
We lose some transferability if we do not ﬁx the recognition model R .
Training Recognition Models from Scratch.
Other than ﬁne-tuning a pretrained recognition model
R , we could ﬁrst train a super-resolution model, and then train R from scratch on the output images.
We achieve 66.1% accuracy on the output images in the validation set, higher than 61.8% in RA processing.
However, the accuracy on original clean images drops from 69.8% to 66.1%.
Alternatively, we could even train R from scratch on the interpolated low-resolution images, in which case we achieve 66.0% on interpolated validation data but only 50.2% on the original validation data.
In summary, training or ﬁne-tuning R to cater the need of super-resolved or interpolated images can harm its performance on the original clean images, and causes additional overhead in storing models.
In contrast, using our RA processing technique could boost the accuracy of output images with the performance on original images intact.
C ONCLUSION
We investigated the problem of enhancing the machine interpretability of image processing outputs.
We ﬁnd our simple approach – optimizing with the additional recognition loss during training can signiﬁcantly boost the recognition accuracy with minimal or no loss in image processing quality.
Moreover, such improvement can transfer to recognition architectures, object categories, and vision tasks unseen during training, indicating the enhanced interpretability is not speciﬁc to one particular model but generalizable to others.
This makes the proposed approach feasible even when the future downstream recognition models are unknown.
A PPENDIX A E XPERIMENTAL D ETAILS
General Setup.
We evaluate our proposed methods on three image processing tasks: image superresolution, denoising, and JPEG-deblocking.
In those tasks, the target images are all the original images from the datasets.
To obtain the input images, for super-resolution, we use a downsampling scale factor of 4 × ; for denoising, we add Gaussian noise on the images with a standard deviation of 0.1 to obtain the noisy images; for JPEG deblocking, a quality factor of 10 is used to compress the image to JPEG format.
The image processing loss used is the mean squared error (MSE, or L 2 ) loss.
For the recognition tasks, we consider image classiﬁcation and object detection, two common tasks in computer vision.
In total, we have 6 (3 × 2) task pairs to evaluate.
We adopt the SRResNet (Ledig et al., 2017) as the architecture of the image processing model P , which is simple yet effective in optimizing the MSE loss.
Even though SRResNet is originally designed for super-resolution, we ﬁnd it also performs well on denoising and JPEG deblocking when its upscale parameter set to 1 for the same input-output sizes.
Throughout the experiments, on both the image processing network and the transformer, we use the Adam optimizer (Kingma & Ba, 2014) with an initial learning rate of 10 − 4 , following the original SRResNet
(Ledig et al., 2017).
Our implementation is in PyTorch (Paszke et al., 2017).
Image Classiﬁcation.
For image classiﬁcation, we evaluate our method on the large-scale ImageNet benchmark (Deng et al., 2009).
We use ﬁve pre-trained image classiﬁcation models, ResNet18/50/101 (He et al., 2016), DenseNet-121 (Huang et al., 2017) and VGG-16 (Simonyan & Zisserman, 2015) with BN (Ioffe & Szegedy, 2015) (denoted as R18/50/101, D121, V16 in Table 1a), on which the top-1 accuracy (%) of the original validation images is 69.8, 76.2, 77.4, 74.7, and 73.
respectively.
We train the processing models for 6 epochs on the training set, with a learning rate decay of 10 × at epoch 5 and 6, and a batch size of 20.
In evaluation, we feed unprocessed validation images to the image processing model, and report the accuracy of the output images evaluated on the pre-trained classiﬁcation networks.
For unsupervised RA, we use L 2 distance as the function l dis in Eqn. 4.
The hyperparameter λ is chosen using super-resolution with the ResNet-18 recognition model, on two small subsets for training/validation from the original large training set.
The λ chosen for RA processing, RA with transformer, and unsupervised RA is 10 − 3 , 10 − 2 and 10 respectively.
Object Detection.
For object detection, we evaluate on PASCAL VOC 2007 and 2012 dataset, using Faster-RCNN (Ren et al., 2015) as the recognition model.
Our implementation is based on the code from (Yang et al., 2017).
Following common practice (Redmon et al., 2016; Ren et al., 2015;
Dai et al., 2016), we use VOC 07 and 12 trainval data as the training set, and evaluate on VOCtest data.
The Faster-RCNN training uses the same hyperparameters in (Yang et al., 2017).
For the recognition model’s backbone architecture, we evaluate ResNet-18/50/101 and VGG-16 (without
BN (Ioffe & Szegedy, 2015)), obtaining mAP of 74.2, 76.8, 77.9, 72.2 on the test set respectively.
Given those trained detectors as recognition loss functions [Table] we train the models on the training set for 7 epochs, with a learning rate decay of 10 × at epoch 6 and [Table]
and a batch size of 1.
We report the mean Average Precision (mAP) of processed images in the test set.
As in image classiﬁcation, we use λ = 10 − 3 for RA processing, and λ = 10 − 2 for RA with transformer.
B M ORE R ESULTS ON T RANSFERABILITY
We present some additional results on transferability here.
B. T RANSFERRING BETWEEN A RCHITECTURES
[Table]
We provide the model transferability results of RA processing on object detection in Table 7.
Rows indicate the models trained as recognition loss and columns indicate the evaluation models.
We see similar trend as in classiﬁcation (Table 1a): using other architectures as loss can also improve recognition performance over plain processing; the loss model that achieves the highest performance is mostly the model itself, as can be seen from the fact that most boldface numbers are on the diagonals.
As a complement in Section 4.2, we present the results when transferring between recognition architectures, using unsupervised RA, in Table 8.
We note that for super-resolution and JPEG-deblocking, similar trend holds as in (supervised) RA processing, as using any architecture in training will improve over plain processing.
But for denoising, this is not always the case.
Some models P trained with unsupervised RA are slightly worse than the plain processing counterpart.
A possible reason for this is the noise level in our experiments is not large enough and plain processing achieve very high accuracy already.
[Table]
B. T RANSFERRING BETWEEN R ECOGNITION T ASKS
In Section 4.
[Table]
we investigated the transferability of improvement from classiﬁcation to detection.
Here we evaluate the opposite direction, from detection to classiﬁcation.
The results are shown in
Table 9.
Here, using RA processing can still consistently improve over plain processing for any pair of models, but we note that the improvement is not as signiﬁcant as directly training using classiﬁcation models as loss (Table 1a and Table 2)
[Table]
Additionally, the results when we transfer the model P trained with unsupervised RA with image classiﬁcation to object detection are shown in Table 10.
In most cases, it improves over plain processing, but for image denoising, this is not always the case.
Similar to results in Table 8, this could be because the noise level is relatively low in our experiments [Table] Evaluation on
[Table]
C M ORE V ISUALIZATIONS
We provide more visualizations in Fig.
4 where the output image is incorrectly classiﬁed by ResNet18 with a plain image processing model [Table] and correctly recognized with RA processing, as in Fig.at Section 4. [Table]
[Figure]
RA λ = 10 − RA λ = 10 −
RA λ = 10 −
[Figure]
Low
[Table]
resolution
[Table]
Label
[Figure]
[Table]
cliff
[Table] [Table]
[Figure] [Figure]
Low
[Figure]
[Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table] [Figure] [Table] [Figure]
[Figure]
D R ESULTS ON I MAGE N ET -C
We evaluate our methods on the ImageNet-C benchmark (Hendrycks & Dietterich, 2019). It imposes 17 different types of corruptions on the ImageNet (Deng et al., 2009) validation set. Despite ImageNet-C benchmark is designed for more robust recognition models, but not for testing image processing models, it is a good testbed to test our methods in a broader range of processing tasks.
Since only corrupted images from the validation set are released, we divide it evenly for each class into two halves and train/test on its ﬁrst/second half. The corrupted image is the input image to the processing model and the original clean image is the target image. The recognition model used in this experiment is an ImageNet-pretrained ResNet-18. In Table 11, we evaluate RA Processing on all 17 types of corruptions, with corruption level 5 as in (Hendrycks & Dietterich, 2019).
We observe that RA Processing brings consistent improvement over plain processing, sometimes by an even larger margin than the tasks considered in Sec. 4.
[Table]
In Table 12, we experiment with different levels of corruptions with corruption type “speckle noise” and “snow”. We also evaluate with our variants – Unsupervised RA and RA with Transformer. We observe that when the corruption level is higher, our methods tend to bring more recognition accuracy gain.
[Table]
In Table [Table] we examine the transferability of RA Processing between recognition architectures, using the same two tasks “speckle noise” and “snow”, with corruption level 5. Note the recognition loss used during training is from a ResNet-
[Table]
and we evaluate the improvement over plain processing on ResNet-50/101, DenseNet-121 and VGG-16.
We observe that the improvement over plain processing is transferable among different architectures
[Table]