HAIR: Hypernetworks-based All-in-One Image Restoration

## Abstract

Abstract Image restoration aims to recover a high-quality clean image from its degraded version. Recent progress in image restoration has demonstrated the effectiveness of All-in-One image restoration models in addressing various degradations simultaneously. However, these existing methods typically utilize the same parameters to tackle images with different degradation types, thus forcing the model to balance the performance between different tasks and limiting its performance on each task. To alleviate this issue, we propose HAIR, a H ypernetworks-based A ll-in-One I mage R estoration method that dynamically generates parameters based on input images. Specifically, HAIR consists of two main components, i.e., Classifier and Hyper Selecting Net (HSN). The Classifier is a simple image classification network used to generate a Global Information Vector (GIV) that contains the degradation information of the input image, and the HSN is a simple fully-connected neural network that receives the GIV and outputs parameters for the corresponding modules. Extensive experiments demonstrate that HAIR can significantly improve the performance of existing image restoration models in a plug-and-play manner, both in single-task and all-in-one settings. Notably, our innovative model, Res-HAIR, which integrates HAIR into the well-known Restormer, can obtain superior or comparable performance compared with current state-of-the-art methods. Moreover, we theoretically demonstrate that our proposed HAIR requires fewer parameters in contrast to the prevalent All-in-One methodologies. The code is available at https://github.com/toummHus/HAIR .

## 1 Introduction

Image restoration stands as a pivotal challenge within the field of computer vision, dedicated to the reconstruction of high-quality images from their degraded states. The presence of adverse conditions such as noise, haze, or rain can severely diminish the effectiveness of images for a variety of applications, such as autonomous navigation [, ], augmented reality [, , ]. Therefore, developing robust image restoration methods is of great importance. The use of deep learning in this domain has made remarkable progress, as evidenced by a suite of recent methodologies [, , , , , , , , , ]. Nonetheless, the predominant approach in current research is to employ task-specific models, each tailored to address a particular type of degradation [, , , , ]. This tailored approach, while precise, presents a constraint in terms of universality, as it restricts the applicability of models to scenarios with varied or unknown degradations [, , ]. To overcome this limitation, the research community has increasingly turned its attention to the development of All-in-One image restoration models. These models are designed to tackle various degradations using one single model. Pioneering efforts in this area [, , , , , , , , ] have utilized a variety of advanced techniques such as contrastive learning [], meta-learning [], visual prompting methods [, , , ]. These approaches have undoubtedly made substantial contributions to the field, propelling it forward with notable advancements.

Figure: Figure 1: The difference between our method and previous methods. (a) Previous All-in-One image restoration methods. For images with various degradations, these methods utilize a single model with the same parameters. (b) Our proposed HAIR. Given a certain degraded image, we first use a fixed Extraction module to extract the features, and feed the extracted feature into the Hypernetwork to generate the dynamic parameters for the fusion module and finally get the restored image by the generated parameters.
Refer to caption: /html/2408.08091/assets/x1.png

Despite the notable successes of these methods, they share a common drawback, namely, they rely on a single model with fixed parameters to address a variety of degradations. This one-size-fits-all approach can hinder the model’s effectiveness when dealing with multiple degradations simultaneously. For example, when viewed through the lens of frequency domain analysis, haze is characterized as low-frequency noise, in contrast to rain, which is considered high-frequency interference. An effective dehazing model acts as a low-pass filter, preserving high-frequency details, whereas deraining requires the opposite—enhancing the high-frequency components. Consequently, a model must strike a balance between these conflicting demands of different degradations, which may lead to suboptimal performance.

To mitigate the aforementioned issue, we propose HAIR in this paper. Our fundamental concept is the dynamic generation of parameters (weights) based on the degradation information present in the input image. HAIR employs Hypernetworks [], a trainable neural network that outputs parameters for other neural networks, to take the degradation information from the input image and produce corresponding parameters. Specifically, for a given unknown degraded image, we first utilize a Classifier, similar to those used in image classification networks, to obtain its Global Information Vector, which contains crucial discriminative information about various types of image degradation (as shown in [Fig. 2](#S1.F2)). This vector is then passed to the Hyper Selecting Net, which is a Fully Connected Network, to generate the requisite parameters, as illustrated in [Fig. 1](#S1.F1). Therefore, our method can dynamically adapt to various degradations. With these dynamically parameterised modules, we ultimately achieve the restored image. In brief, our contributions include:

- •
We propose HAIR, a novel Hypernet-based All-in-One image restoration method capable of dynamically generating parameters based on the input image’s characteristics. HAIR consists of two components, i.e. Classifier and Hyper Selecting Nets, both of which function as a plug-in-and-play module. Extensive experiments demonstrate that HAIR can significantly improve the performance of existing image restoration models in a plug-and-play manner, both in single-task and all-in-one settings.
- •
By incorporating HAIR into Restormer [], we propose a new all-in-one model, i.e. Res-HAIR. To the best of our knowledge, our method is the first to apply data-adaptive Hypernetworks to All-in-One image restoration models. Extensive experiments validate that the proposed Res-HAIR can achieve superior or comparable performance compared with current state-of-the-art methods across a variety of image restoration tasks.
- •
We theoretically prove that, for a given small error threshold $\epsilon$ in image restoration tasks, HAIR requires fewer parameters compared to mainstream embedding based All-in-One methods like [, , ].

Figure: Figure 2: The figure presents tSNE plots of the degradation embeddings utilized in PromptIR [] and our HAIR. Each distinct color represents a unique degradation type. It becomes evident that HAIR excels not only in recognizing various degradation types, such as noise, rain, and haze, but also in distinguishing between the same type of degradation at varying intensities, exemplified by noise with standard deviations of [15, 25, 50]. This capability underscores HAIR’s remarkable adaptability and generalization when confronted with diverse degradation scenarios.
Refer to caption: /html/2408.08091/assets/x2.png

## 2 Related Preliminaries

### 2.1 All-in-One Image Restoration

While single degradation methods do achieve great success [, , , , , ], blind all-in-one image restoration, which aims to utilize a single deep blind restoration model to tackle multiple types of degradation simultaneously without the prior information of the degradation of the input image, has gained more attention recently  [, , , , , ]. The seminal work AirNet [] achieves blind All-in-One image restoration by employing contrastive learning to extract degradation representations from corrupted images, which are subsequently utilized to restore the clean image. Next, IDR [] decomposes image degradations into their underlying physical principles, achieving All-in-One image restoration through a two-stage process based on meta-learning. With the rise of LLM [], prompt-based learning [, , ] has also emerged as a promising direction in computer vision tasks. Despite the success these methods have achieved, they typically use the same parameters for distinct degradations and inject the degradation information as conditional embeddings into the model, which may impair the performance of the models. In contrast, our proposed HAIR can adaptively generate specific parameters for the given degraded image, resulting in better generalization to unknown degradations. [] theoretically explains why using data-conditional Hypernetworks to generate adaptive parameters works better than injecting conditional embeddings into the model.

### 2.2 Image Classification and Feature Extraction

Image classification is a fundamental task in Computer Vision, with the goal of categorizing images based on their content []. Typically, image classification contains two key steps: feature extraction and classification. The primary challenge in this task is feature extraction, which involves converting an image into a vector that encapsulates its most critical information. While traditional methods relied on handcrafted techniques [], the advent of neural networks has revolutionized feature extraction [, , , ]. Given that these vectors are capable of classifying hundreds of categories [], they must contain the essential information of the images. This concept also extends to the classification of degraded images. For instance, if we categorize degraded images into different types, e.g. noisy, rainy, or hazy, and by levels of degradation like slightly noisy, moderately noisy, and very noisy, the feature vectors should be effective in classifying these variations. The rationale is that recognizing different degradations is generally less complex than identifying hundreds of distinct objects. Therefore, our proposed method employs a Classifier to obtain a Global Information Vector (GIV), that captures the rich global information of the image, including its degradation characteristics. (As shown in [Fig. 2](#S1.F2)) This GIV is then utilized to generate parameters tailored to the specific degradation present in the image.

### 2.3 Data-conditioned Hypernetworks

Hypernetworks [] are a class of neural networks designed to generate weight values (parameters) for other networks. They can be broadly classified into three main types: Task-conditioned, Data-conditioned, and Noise-conditioned hypernetworks []. Among these methods, Data-conditioned hypernetworks are particularly noteworthy for their ability to generate weights contingent upon the distinctive features of the input data. This capability allows the neural network to dynamically adapt its behaviour in response to specific input patterns or characteristics, fostering flexibility and adaptability within the model. Consequently, this results in enhanced generalization and robustness. Data-conditioned Hypernetworks have found applications across the field of computer vision, including semantic segmentation [] and image editing []. Despite previous attempts to integrate Hypernetworks into Image Restoration [], these have primarily leveraged Task-conditioned hypernetworks. Such an approach cannot fully harness the potential of hypernetworks for the task of image restoration. To the best of our knowledge, our work first introduces Data-conditioned hypernetworks to the domain of image restoration, unlocking new possibilities for the field.

Figure: Figure 3: The overall framework of Res-HAIR. In this paper, we mainly incorporate HAIR into Restormer [], which has demonstrated robust performance in all-in-one restoration scenarios [, , ]. HAIR introduces a Classifier that yields a Global Information Vector (GIV) $\mathbf{V_{g}}$ from the high-level feature $\mathbf{F_{g}}$ encapsulating the input image’s degradation information. Additionally, the Hyper Selecting Nets (HSNs) dynamically generate weights for the Transformer Blocks based on GIV, customizing the restoration process to address the specific degradation characteristics of each image. This innovative approach allows models to adapt to various image restoration tasks without altering the original architecture. For other baseline models, we follow a similar integration approach with HAIR: we introduce a classifier at the network’s midpoint and utilize the resulting GIV to dynamically generate weights for the subsequent layers of the network.
Refer to caption: /html/2408.08091/assets/x3.png

## 3 Method

In this section, we outline the core principles of our proposed effective all-in-one image restoration method. Note that we use Res-HAIR stands for Restormer embedded with HAIR.

Overall Pipeline As shown in [Fig. 3](#S2.F3), our network architecture is consistent with Restormer []. Given a certain degraded image input $\mathbf{X}\in\mathbb{R}^{H\times W\times 3}$, Res-HAIR utilizes a $3\times 3$ convolution to transform $\mathbf{X}$ into feature embeddings $\mathbf{F_{0}}\in\mathbb{R}^{H\times W\times C}$, where $C$ denotes the number of channels. These feature embeddings are then proceeded through a 4-level hierarchical encoder-decoder, resulting in deep features $\mathbf{F_{r}}$. Each level of the encoder-decoder incorporates several Transformer blocks, with an increasing number from the top to the bottom level, ensuring computational efficiency. The left three blue "Transformer Blocks" function as an Encoder, designed to extract features from $\mathbf{F_{0}}$ and ultimately produce a global feature map $\mathbf{F_{g}}\in\mathbb{R}^{\frac{W}{8}\times\frac{H}{8}\times 8C}$ with a large receptive field. $\mathbf{F_{g}}$ is then input into a Classifier to yield a Global Information Vector (GIV) $\mathbf{V_{g}}\in\mathbb{R}^{2C}$. The right four orange "HyperTrans Blocks" operate as a Decoder, aiming to adaptively fuse features at each Decoder level based on degradation, culminating in a restored image $\hat{\mathbf{X}}$. Specifically, at each Decoder level, the HyperTrans Block accepts two inputs: the input feature and the GIV $\mathbf{V_{g}}$. $\mathbf{V_{g}}$ is fed into the Hyper Selecting Net to generate weights for the corresponding Transformer Blocks, which are then applied to the input feature to produce the output. It is important to note that all HyperTrans Blocks use the same $\mathbf{V_{g}}$ derived from $\mathbf{F_{g}}$. Since the weights in the Decoder are generated based on $\mathbf{V_{g}}$, which contains the degradation information of $\mathbf{X}$, our method exhibits strong generalization and adaptability, leading to excellent restoration performance.

### 3.1 Classifier

As outlined in [Section 2.2](#S2.SS2), our approach to extracting degradation information involves designing a straightforward Classifier akin to those used in image classification tasks. We start by entering $\mathbf{F_{g}}\in\mathbb{R}^{\frac{H}{8}\times\frac{W}{8}\times 8C}$ into the backbone, which is composed of multiple ResNet blocks [] followed by downsampling $\times 2$. This process is aimed at downsizing the spatial resolution while distilling the essential information, as depicted by the following equations:

$$ $\displaystyle\mathbf{F_{g}^{1}}$ $\displaystyle=\text{Downsampling}(\text{ResNetBlock}(\mathbf{F_{g}})),$ (1) $\displaystyle\mathbf{F_{g}^{t}}$ $\displaystyle=\text{Downsampling}(\text{ResNetBlock}(\mathbf{F_{g}^{t-1}}))),\quad\text{for}\ t=1,2,3.$ $$

After three iterations, we obtain $\mathbf{F_{g}^{3}}\in\mathbb{R}^{\frac{H}{64}\times\frac{W}{64}\times 2C}$, which serves as the input for generating the GIV $\mathbf{V_{g}}\in\mathbb{R}^{2C}$:

$$ $\mathbf{V_{g}}=\text{GAP}(\mathbf{F_{g}^{3}}),$ (2) $$

where GAP denotes Global Average Pooling. The inclusion of GAP ensures that $\mathbf{V_{g}}$ remains a one-dimensional vector of consistent size, irrespective of the input image’s resolution. Unlike traditional image classification networks, there is no requirement for a Softmax layer here, as its application would confine the values of $\mathbf{V_{g}}$ within the [0,1] range, potentially restricting the parameter generation process. Moreover, the backbone can be substituted with other straightforward image classification networks such as VGG [] and Inception [], without any detrimental impact on performance, given that the classification of degradation types is a relatively simple task.

### 3.2 Hyper Selecting Net

Upon obtaining the Global Information Vector $\mathbf{V_{g}}$ from the Classifier, it is fed into our Data-conditioned Hypernetworks, known as Hyper Selecting Nets, to generate weights for the corresponding Transformer Blocks. Given $\mathbf{V_{g}}\in\mathbb{R}^{2C}$, a Selecting Vector (SV) $\mathbf{V_{s}}\in\mathbb{R}^{N}$ is initially computed as follows:

$$ $\mathbf{V_{s}}=\sigma(\mathbf{FCNN}(\mathbf{V_{g}})).$ (3) $$

Here, $\sigma$ stands for a Softmax operation and $\mathbf{FCNN}$ denotes a simple Fully-Connected Neural Network. Subsequently, the parameters $\mathbf{w}$ are derived as

$$ $\mathbf{w}=\sum_{i=1}^{N}\mathbf{V_{s}}^{i}\mathbf{W}_{i}.$ (4) $$

In this formula, $\mathbf{V_{s}}^{i}$ represents the $i$-th element of $\mathbf{V_{s}}$. The matrix $\mathbf{W}\in\mathbb{R}^{N\times P}$, referred to as the Weights Box, comprises $\mathbf{W}_{i}\in\mathbb{R}^{P}$ as its $i$-th column. The hyperparameter $N$ influences the total number of parameters, with $P$ being the count of parameters required for one Transformer Block. With $\mathbf{w}$ determined, it is then applied as parameters for the Transformer Block:

$$ $\mathbf{x}^{\prime}=\mathbf{Transformer_Block}(\mathbf{x};\mathbf{w}).$ (5) $$

Here, $\mathbf{x}$ signifies the input, and $\mathbf{x}^{\prime}$ is the resulting output. As the Transformer Blocks [] are based on convolution, $\mathbf{w}\in\mathbb{R}^{P}$ is reshaped into 4-dimensional tensors to serve as convolution kernels for the Transformer Blocks. To economize on parameters, Transformer Blocks at the same decoder level share one Weights Box, and each Transformer Block is independently equipped with its own FCNN.

### 3.3 Rethinking Weights Generation via a Selecting Perspective

If we consider the Weights Box as part of the FCNN, it may not be immediately clear why such a direct derivation of weights from a neural network works well. This seeming lack of intuitiveness is what we aim to address. Before delving into the explanation, we establish a foundational proposition:

###### Proposition 1 .

(Convolution operations exhibit the distributive law over addition) Let $\mathbf{x}\in\mathbb{R}^{H\times W\times C}$ be the input feature, and let $w_{i},\ i=1,2,\cdots,n$ represent the convolution kernels. The law is mathematically expressed as:

$$ $\mathbf{x}*(\sum_{i=1}^{n}w_{i})=\sum_{i=1}^{n}(\mathbf{x}*w_{i})$ (6) $$

where ’*’ denotes the standard 2-dimensional convolution.

With this proposition, the following formula becomes evident:

$$ $\displaystyle\mathbf{x}*\mathbf{w}=\mathbf{x}*\left(\sum_{i=1}^{N}\mathbf{V_{s}}^{i}\mathbf{W}_{i}\right)=\sum_{i=1}^{N}\left(\mathbf{x}*(\mathbf{V_{s}}^{i}\mathbf{W}_{i})\right)=\sum_{i=1}^{N}\mathbf{V_{s}}^{i}\left(\mathbf{x}*\mathbf{W}_{i}\right),$ (7) $$

where the constraint $\sum_{i}^{N}\mathbf{V_{s}}^{i}=1$ holds due to the property of Softmax operation. In essence, the convolution with the generated weights is equivalent to a weighted sum of convolutions between the input $\mathbf{x}$ and each kernel $\mathbf{W}_{i}$ in the Weights Box. This process can be seen as a process of selecting convolution kernels. For instance, with a Weights Box $\mathbf{W}\in\mathbb{R}^{2\times P}$ that includes a low-pass $\mathbf{W}_{1}$ and a high-pass $\mathbf{W}_{2}$, the rainy input $\mathbf{x}_{1}$ would ideally have a larger $\mathbf{V_{s}}^{1}$ to filter out high-frequency noise, while a smaller $\mathbf{V_{s}}^{2}$ would help retain details. Conversely, for a hazy input $\mathbf{x}_{2}$, a larger $\mathbf{V_{s}}^{2}$ would be necessary to mitigate low-frequency haze. Although real-world degradations can be more complex, our Hyper Selecting Net can adaptively select the appropriate weights. This insight into the selection process helps us understand HAIR, namely, for each input, the Hyper Selecting Net produces a tailored Selecting Vector and adaptively chooses the most suitable convolution kernel. Given that core operations such as convolution and matrix multiplication follow the distributive law over addition, HAIR is versatile and can be integrated into various architectures like Transformer [] and Mamba [].

###### Proposition 1 .

### 3.4 A Brief Analysis of Model Complexity

In [Section 2.3](#S2.SS3), we claim that our Hypernetworks-based method can work better than conditional embedding-based methods like AirNet [] and PromptIR []. This section will give a simple proof for this point. In the context of all-in-one image restoration, we aim to find a function $f:\mathbb{R}^{3HW}\xrightarrow{}\mathbb{R}^{3HW}$ to map a degraded image $\mathbf{X}$ to a restored image $\hat{\mathbf{X}}$ by minimizing the distance between $\hat{\mathbf{X}}$ and the ground truth $\mathbf{Y}=y(\mathbf{X})$.(^1^11For the sake of discussion, the following tensors are generally regarded as flattened one-dimensional vectors.) Mainstream methods typically utilize a neural network $g(\mathbf{X},e(\mathbf{X}))$ to learn the mapping, where $e(\mathbf{X})\in\mathbb{R}^{k}$ stands for the degradation information (degradation embedding) from the input image, such as the prompt in PromptIR []. These methods directly send $e(\mathbf{X})$ together with $\mathbf{X}$ into the network to get $\hat{\mathbf{X}}$. For our HAIR, the neural network can be formulated as $h(\mathbf{X};\theta(e(\mathbf{X})))$, where $\theta$ is a function that maps ${e(\mathbf{X})}$ into the parameters of $h$. We define the distance between the two functions as:

$$ $d(g,y)=\min_{g}\max_{\mathbf{X}}\|g(\mathbf{X},e(\mathbf{X}))-y(\mathbf{X})\|_{\infty}.$ (8) $$

Given that vector functions can be complex, we define a scalar function $f^{i}:\mathbb{R}^{M}\xrightarrow{}\mathbb{R},i=1,2,3\cdots M.$ of a vector function $f:\mathbb{R}^{M}\xrightarrow{}\mathbb{R}^{M}$. $i$ means $f^{i}$ produce the $i$-th value of $f$, then we have:

$$ $\displaystyle d(g,y)$ $\displaystyle=\min_{g}\max_{\mathbf{X}}\max_{i}|g^{i}(\mathbf{X})-y^{i}(\mathbf{X})|$ (9) $\displaystyle=\min_{g}\max_{i}\max_{\mathbf{X}}|g^{i}(\mathbf{X})-y^{i}(\mathbf{X})|$ $\displaystyle=\min_{g}\max_{\mathbf{X}}|g^{k(g)}(\mathbf{X})-y^{k(g)}(\mathbf{X})|.$ $$

Since the value range of $i$ is limited, given the function $g$, we can always find an integer $k(g)$ to replace $\max_{i}$. To complete the proof, we need some assumptions.

###### Assumption 1 .

The target function $y^{i}\in\mathcal{W}_{r,3HW},i=1,2,\cdots 3HW$. The Sobolev space $\mathcal{W}_{r,3HW}$ is the set of functions that are $r$-times differentiable with all $r$-th order derivatives being continuous and bounded by the Sobolev norm $\leq 1$, defined on $\mathbb{R}^{3HW}$.

Intuitively, since $y^{i}$ maps the degraded image to a single pixel of the clean image, a little disturbance on the degraded image should only bring a little difference to the single pixel, so $y^{i}$ should be smooth and differentiable or at least continue. What’s more, the domain and range of $y$ are restricted to $[0,1]^{3HW}$, with most of the pixels far less than 1, the Sobolev norm of $y_{i}$ can be generally less than 1. So this assumption generally holds.

###### Assumption 2 .

For various functions (especially neural networks) $g$, the integer $k(g)$ in [Eq. 9](#S3.E9) remains the same.

In our context, the various $g$ represents the same network with different weights during training. No matter how the parameters update, the most "difficult" degraded image generally remains the same one, e.g., the one with very severe degradation. Within this "difficult" image, the most "difficult" pixel should also remain the same, e.g., the pixel that varies dramatically from its clean version. In this way, we simplify the vector function $g$ to scalar function $g^{k(g)}$. With these two assumptions, as well as incorporating
Theorem 2-4 and all the assumptions in [], we can obtain the following conclusion.

###### Theorem 1 .

For conditional embedding-based all-in-one image restoration methods $g(\mathbf{X},e(\mathbf{X}))$ like PromptIR [], to achieve error $d(g,y)\leq\epsilon$, the complexity (number of parameters) of the corresponding model is at least $N_{g}=\Omega(\epsilon^{-3HW-k})$.

###### Theorem 2 .

For Hypernetworks based methods $h(\mathbf{X};\theta(e(\mathbf{X})))$ like our HAIR, to achieve error $d(h,y)\leq\epsilon$, the complexity of the corresponding model is $N_{\theta}=O(\epsilon^{-3HW/r})$.

Please refer to paper [] and [Section 6.1](#S6.SS1) for detailed premises and proof of [Theorem 1](#Thmtheorem1) and [2](#Thmtheorem2). The two Theorems demonstrate that to achieve the same error $\epsilon$, our proposed HAIR requires fewer parameters than conditional embedding-based methods. (As long as $\epsilon$ is small enough.)

###### Assumption 1 .

###### Assumption 2 .

###### Theorem 1 .

###### Theorem 2 .

## 4 Experiments

We conduct experiments by rigorously adhering to the methodologies established in prior research on general image restoration [, ], under two distinct experimental configurations: (a) All-in-One and (b) Single-task. In the All-in-One configuration, a singular model is trained to handle multiple types of degradation, encompassing both three and five unique degradations. In contrast, the Single-task configuration involves the training of individual models dedicated to specific restoration tasks.

### 4.1 Experimenting Preparation

Implementation Details.
Our Res-HAIR framework is designed to be end-to-end trainable, eliminating the need for pre-training any of its components. The architecture comprises a 4-level encoder-decoder structure, with each level equipped with a varying number of Transformer blocks. Specifically, the number of blocks increases progressively from level-1 to level-4, following the sequence [4, 6, 6, 8]. HyperTrans Blocks are employed throughout level-4 and the decoding stages of levels 1-3. Additionally, the Weights Box parameter $N$ is set according to the sequence [5, 7, 7, 9] for each respective level. In the all-in-one setting, the model is trained with a batch size of 32, while in the single-task setting, a batch size of 8 is used. The optimization of the network is guided by an L1 loss function, employing the AdamW optimizer [] with parameters $\beta_{1}=0.9$ and $\beta_{2}=0.999$. The learning rate is set to $2e-4$ for the initial 150 epochs, and we change it to $2e-5$ for the final 10 epochs. To enhance the training data, input patches of size 128 $\times$ 128 are utilized, with random horizontal and vertical flips applied to the images to augment the dataset.

Datasets.
We follow the approaches in previous studies [, , ] for our All-in-One and single-task experiments, using the following datasets. For single-task image denoising, we use the BSD400 [] and WED [] datasets, adding Gaussian noise at levels $\sigma\in\{15,25,50\}$ to generate training images. Testing is performed on the BSD68 [] and Urban100 [] datasets. For deraining, we employ the Rain100L dataset []. Dehazing experiments utilize the SOTS dataset []. Deblurring and low-light enhancement tasks use the GoPro [] and LOL-v1 [] datasets respectively. To create a comprehensive model for all tasks, we combine these datasets and train them in a setting that covers three or five types of degradations. For single-task models, training is conducted for the same duration on the respective dataset.

**Table 1: Comparison to state-of-the-art on three degradations. PSNR (dB, $\uparrow$) and SSIM ($\uparrow$) metrics are reported on the full RGB images. Best and second best performances are highlighted. Our method sets a new state-of-the-art on average across all benchmarks while being significantly more efficient than previous work. ‘-’ represents unreported results.**
| Method | Params. | Dehazing | Deraining | Denoising | Average |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| SOTS | Rain100L | BSD68$\sigma$=15 | BSD68$\sigma$=25 | BSD68$\sigma$=50 |  |  |  |  |  |  |  |  |  |
| BRDNet [] | - | 23.23 | .895 | 27.42 | .895 | 32.26 | .898 | 29.76 | .836 | 26.34 | .693 | 27.80 | .843 |
| LPNet [] | - | 20.84 | .828 | 24.88 | .784 | 26.47 | .778 | 24.77 | .748 | 21.26 | .552 | 23.64 | .738 |
| FDGAN [] | - | 24.71 | .929 | 29.89 | .933 | 30.25 | .910 | 28.81 | .868 | 26.43 | .776 | 28.02 | .883 |
| DL [] | 2M | 26.92 | .931 | 32.62 | .931 | 33.05 | .914 | 30.41 | .861 | 26.90 | .740 | 29.98 | .876 |
| MPRNet [] | 16M | 25.28 | .955 | 33.57 | .954 | 33.54 | .927 | 30.89 | .880 | 27.56 | .779 | 30.17 | .899 |
| Restormer [] | 26M | 29.92 | .970 | 35.56 | .969 | 33.86 | .933 | 31.20 | .888 | 27.90 | .794 | 31.68 | .910 |
| AirNet [] | 9M | 27.94 | .962 | 34.90 | .967 | 33.92 | .933 | 31.26 | .888 | 28.00 | .797 | 31.20 | .910 |
| PromptIR [] | 36M | 30.58 | .974 | 36.37 | .972 | 33.98 | .933 | 31.31 | .888 | 28.06 | .799 | 32.06 | .913 |
| DaAIR[] | 6M | 32.30 | .981 | 37.10 | .978 | 33.92 | .930 | 31.26 | .884 | 28.00 | .792 | 32.51 | .913 |
| Res-HAIR (ours) | 29M | 30.98 | .979 | 38.59 | .983 | 34.16 | .935 | 31.51 | .892 | 28.24 | .803 | 32.70 | .919 |
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |

### 4.2 Results

All-in-One: Three degradations. We conducted a comparative evaluation of our All-in-One image restoration framework against several state-of-the-art specialized methods, including BRDNet [], LPNet [], FDGAN [], DL [], MPRNet [], AirNet [], PromptIR [], and DaAIR []. Each of these methods was trained to handle the tasks of dehazing, deraining, and denoising. As illustrated in [Table 1](#S4.T1), our approach excels as the leading contender, offering a significant average improvement of $0.64$ dB over PromptIR []. Our method notably outperforms existing benchmarks on BSD68 and Rain100L datasets, setting a new precedent by exceeding the performance of the previous best methods by margins of $0.19$ dB and $1.49$ dB respectively.

All-in-One: Five Degradations.
Following recent studies [, ], we have extended our approach to include deblurring and low-light image enhancement, thereby broadening our three-degradation framework to a more complex All-in-One setting. As demonstrated in [Table 2](#S4.T2), our method excels by learning specialized models for each degradation type while effectively capturing the shared characteristics between tasks. It achieves an average improvement of $0.6$ dB over PromptIR [] and $0.13$ dB over DaAIR [], establishing a new benchmark for state-of-the-art (SOTA) performance across all five benchmarks. Additionally, we compared our method with general image restoration models trained in the same All-in-One setting. Notably, our method significantly outperforms our baseline (i.e. Restormer []) in various tasks. This comparison highlights the strong capability of our method as a versatile plug-in-and-play module, enhancing the performance of existing restoration architectures with minimal integration complexity.

**Table 2: Comparison to state-of-the-art on five degradations. PSNR (dB, $\uparrow$) and SSIM ($\uparrow$) metrics are reported on the full RGB images with $(^{\ast})$ denoting general image restorers, others are specialized all-in-one approaches. Best and second best performances are highlighted.**
| Method | Params. | Dehazing | Deraining | Denoising | Deblurring | Low-Light | Average |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| SOTS | Rain100L | BSD68$\sigma$=25 | GoPro | LOLv1 |  |  |  |  |  |  |  |  |  |
| NAFNet^∗ [] | 17M | 25.23 | .939 | 35.56 | .967 | 31.02 | .883 | 26.53 | .808 | 20.49 | .809 | 27.76 | .881 |
| DGUNet^∗ [] | 17M | 24.78 | .940 | 36.62 | .971 | 31.10 | .883 | 27.25 | .837 | 21.87 | .823 | 28.32 | .891 |
| SwinIR^∗ [] | 1M | 21.50 | .891 | 30.78 | .923 | 30.59 | .868 | 24.52 | .773 | 17.81 | .723 | 25.04 | .835 |
| Restormer^∗ [] | 26M | 24.09 | .927 | 34.81 | .962 | 31.49 | .884 | 27.22 | .829 | 20.41 | .806 | 27.60 | .881 |
| DL [] | 2M | 20.54 | .826 | 21.96 | .762 | 23.09 | .745 | 19.86 | .672 | 19.83 | .712 | 21.05 | .743 |
| Transweather [] | 38M | 21.32 | .885 | 29.43 | .905 | 29.00 | .841 | 25.12 | .757 | 21.21 | .792 | 25.22 | .836 |
| TAPE [] | 1M | 22.16 | .861 | 29.67 | .904 | 30.18 | .855 | 24.47 | .763 | 18.97 | .621 | 25.09 | .801 |
| AirNet [] | 9M | 21.04 | .884 | 32.98 | .951 | 30.91 | .882 | 24.35 | .781 | 18.18 | .735 | 25.49 | .847 |
| IDR [] | 15M | 25.24 | .943 | 35.63 | .965 | 31.60 | .887 | 27.87 | .846 | 21.34 | .826 | 28.34 | .893 |
| PromptIR [] | 36M | 30.61 | .974 | 36.17 | .973 | 31.25 | .887 | 27.93 | .851 | 22.89 | .842 | 29.77 | .905 |
| DaAIR [] | 6M | 31.97 | .980 | 36.28 | .975 | 31.07 | .878 | 29.51 | .890 | 22.38 | .825 | 30.24 | .910 |
| Res-HAIR (ours) | 29M | 30.62 | .978 | 38.11 | .981 | 31.49 | .891 | 28.52 | .874 | 23.12 | .847 | 30.37 | .914 |
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |

Single-Degradation Results.
To evaluate the effectiveness of our proposed method, we provide results in [Table 3](#S4.T3), which show the performance of individual instances of our method trained under a single degradation protocol. Specifically, the single-task variant dedicated to deraining consistently achieves higher performance than PromptIR [] and DaAIR by margins of $1.96$ dB and $1.22$ dB, respectively. When applied to image denoising, our method also demonstrates superiority over the aforementioned approaches, with an improvement of $0.21$ dB and $0.47$ dB, respectively. These results underscore the significant enhancements in performance delivered by our method.

**Table 3: Comparison to state-of-the-art for single degradations. PSNR (dB, $\uparrow$) and SSIM ($\uparrow$) metrics are reported on the full RGB images. Best and second best performances are highlighted. Our method excels prior work on deraining and denoising.**
| Method | SOTS |  |
| --- | --- | --- |
| DehazeNet  [] | 22.46 | .851 |
| MSCNN  [] | 22.06 | .908 |
| EPDN  [] | 22.57 | .863 |
| FDGAN [] | 23.15 | .921 |
| Restormer [] | 30.87 | .969 |
| AirNet [] | 23.18 | .900 |
| PromptIR [] | 31.31 | .973 |
| DaAIR [] | 31.99 | .981 |
| Res-HAIR (ours) | 31.68 | .980 |

Visual Results The visual results captured under three degradation scenarios are presented in [Fig. 4](#S4.F4). These results clearly demonstrate the superiority of our method in terms of visual quality: In the denoising task at $\sigma=25$, Res-HAIR retains more fine details compared to other methods; in the deraining task, Res-HAIR effectively removes all rain streaks, whereas the compared methods exhibit noticeable remnants; in the dehazing task, Res-HAIR may not closely resemble the Ground Truth, yet it provides the most visually pleasing outcome and even clears the original haze present in the Ground Truth. Collectively, these observations confirm the efficacy of our approach in enhancing image quality across different degradation conditions.

Figure: Figure 4: Visual comparison of all-in-one methods in all-in-one degradation settings.
Refer to caption: /html/2408.08091/assets/x4.png

### 4.3 Ablation Studies

We have done several ablation studies to show the contributions and properties of our proposed HAIR.

Effectiveness of Classifier and Hyper Selecting Net (HSN) As detailed in [Table 4](#S4.T4), we study the impact of the proposed modules in four settings: (a) Here, the model aligns with the Restormer architecture []. (b) In this configuration, the Global Information Vector (GIV) is directly used as conditional embeddings for the Transformer Blocks in the Decoder, rather than for weight generation. (c) The GIVs are designated as independently trainable parameters, each randomly initialized, with the Decoder’s Transformer Blocks having their own distinct GIVs. (d) This setup incorporates both components. The results demonstrate the indispensability of both components. With the addition of only 3M parameters and no change to the logical structure, Res-HAIR outperforms Restormer by 1.7 dB in PSNR, underscoring the simplicity and effectiveness of our proposed approach.

Position of Classifier (and HyperTrans Blocks) In our design approach, the Classifier is positioned after the first three Encoder levels, with the subsequent four Decoder levels employing HyperTrans Blocks, constituting a 3+4 configuration. The rationale for this design choice is demonstrated in [Table 5](#S4.T5). It is evident that the optimal placement for the Classifier is at the network’s midpoint. This positioning takes advantage of the expansive receptive field of the features post the network’s halfway point, while allowing the HSN to dynamically generate parameters for the remaining modules. Furthermore, it is crucial to strike a balance between the receptive field size of the features fed into the Classifier and the count of HyperTrans Blocks utilized, ensuring the model’s efficiency and adaptability.

Figure: Table 4: Impact of key components. Results are from single deraining task on Rain100L.

HAIR for Other Baselines. We have previously posited that HAIR is essentially a plug-in-and-play module which is readily integrable with any image-to-image network architecture. To substantiate this claim, we have implemented HAIR on various established baselines. As depicted in Table [Table 6](#S4.T6), we selected three efficacious image restoration models—Transweather [], AirNet [], and Restormer []—for integration with HAIR. Specifically, we have integrated the Classifier at the network’s midpoint for each method and transitioned the subsequent layers to Hypernetworks-based modules. The outcomes show that our method outperforms PromptIR as a plug-in-and-play module, underscoring the universality and potency of our approach.

**Table 6: HAIR for different baselines architectures. PSNR (dB, $\uparrow$) and SSIM ($\uparrow$) metrics are reported on the full RGB images. Best performances are highlighted.**
| Method | Main Operation | Params | Dehazing | Deraining | Denoising | Deblurring | Low-Light | Average |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| SOTS | Rain100L | BSD68$\sigma$=25 | GoPro | LOLv1 |  |  |  |  |  |  |  |  |  |  |
| Transweather [] | Self-Attention | 38M | 21.32 | .885 | 29.43 | .905 | 29.00 | .841 | 25.12 | .757 | 21.21 | .792 | 25.22 | .836 |
| Transweather+PromptIR | 51M | 22.89 | .920 | 29.79 | .913 | 29.95 | .877 | 25.74 | .781 | 23.02 | .849 | 26.28 | .868 |  |
| Transweather+HAIR | 42M | 23.66 | .935 | 32.34 | .947 | 29.96 | .875 | 26.33 | .802 | 23.16 | .858 | 27.09 | .884 |  |
| AirNet [] | Convolution | 9M | 21.04 | .884 | 32.98 | .951 | 30.91 | .882 | 24.35 | .781 | 18.18 | .735 | 25.49 | .847 |
| AirNet+PromptIR | 14M | 21.34 | .883 | 33.52 | .953 | 30.92 | .882 | 24.37 | .786 | 18.18 | .737 | 25.67 | .848 |  |
| AirNet+HAIR | 10M | 22.15 | .899 | 34.56 | .957 | 30.94 | .884 | 25.44 | .792 | 18.24 | .740 | 26.27 | .854 |  |
| Restormer [] | Convolution | 26M | 24.09 | .927 | 34.81 | .962 | 31.49 | .884 | 27.22 | .829 | 20.41 | .806 | 27.60 | .881 |
| Restormer+PromptIR | 36M | 30.61 | .974 | 36.17 | .973 | 31.25 | .887 | 27.93 | .851 | 22.89 | .842 | 29.77 | .905 |  |
| Restormer+HAIR | 29M | 30.62 | .978 | 38.11 | .981 | 31.49 | .891 | 28.52 | .874 | 23.12 | .847 | 30.37 | .914 |  |

## 5 Conclusion

This paper introduces HAIR, a novel plug-and-play Hypernetworks-based module capable of being easily integrated and adaptively generating parameters for different networks based on the input image. Our method comprises two main components: the Classifier and the Hyper Selecting Net (HSN). Specifically, the Classifier is a simple image classification network with Global Average Pooling, designed to produce a Global Information Vector (GIV) that encapsulates the global information from the input image. The HSN functions as a Fully-connected Neural Network, receiving the GIV and outputting parameters for the corresponding modules. Extensive experiments indicate that HAIR can significantly enhance the performance of various image restoration architectures at a low cost without necessitating any changes to their logical structures. By incorporating HAIR into the widely recognized Restormer architecture, we have achieved State-Of-The-Art performance on a range of image restoration tasks. The potential for further exploitation of data-conditioned Hypernetworks in image-to-image tasks is substantial, considering their robust adaptability to diverse input images based on their content.

## 6 Appendix

### 6.1 Detailed Proof of Theorem 1 , Theorem 2

Notations We consider $\mathcal{X}=[-1,1]^{m_{1}}$ and $\mathcal{I}=[-1,1]^{m_{2}}$ and denote, $m:=m_{1}+m_{2}$. Here $\mathcal{X}$ stands for the set of input images $\mathbf{X}$, meanwhile $\mathcal{I}$ refers to the set of degradation information $e(\mathbf{X})$. For a closed set $X\subset\mathbb{R}^{n}$, we denote by $C^{r}(X)$ the linear space of all $r$-continuously differentiable functions $h:X\to\mathbb{R}$ on $X$ equipped with the supremum norm $\|h\|_{\infty}:=\max_{x\in X}\|h(x)\|_{1}$.

###### Theorem 3 .

(The Theorem 2 in []) Let $\sigma$ be a universal, piece-wise $C^{1}(\mathbb{R})$ activation function with $\sigma^{\prime}\in BV(\mathbb{R})$ and $\sigma(0)=0$. Let $\mathcal{E}_{\mathbf{e},\mathbf{q}}$ be a neural embedding method. Assume that $\mathbf{e}$ is a class of continuously differentiable neural network $e$ with zero biases, output dimension $k=\mathcal{O}(1)$ and $\mathcal{C}(e)\leq\ell_{1}$ and $\mathbf{q}$ is a class of neural networks $q$ with $\sigma$ activations and $\mathcal{C}(q)\leq\ell_{2}$. Let $\mathbb{Y}:=\mathcal{W}_{1,m}$. Assume that any non-constant $y\in\mathbb{Y}$ cannot be represented as a neural network with $\sigma$ activations. If the embedding method achieves error $d(\mathcal{E}_{\mathbf{e},\mathbf{q}},\mathbb{Y})\leq\epsilon$, then, the complexity of $\mathbf{q}$ is: $N_{\mathbf{q}}=\Omega\left(\epsilon^{-(m_{1}+m_{2})}\right)$.

The notation $BV(\mathbb{R})$ stands for the set of functions of bounded variation,

$$ $BV(\mathbb{R}):=\left\{f\in L^{1}(\mathbb{R})\mid\|f\|_{BV}<\infty\right\}\textnormal{ where, }\|f\|_{BV}:=\sup\limits_{\begin{subarray}{c}\phi\in C^{1}_{c}(\mathbb{R})\\ \|\phi\|_{\infty}\leq 1\end{subarray}}\int_{\mathbb{R}}f(x)\cdot\phi(x)\;\textnormal{d}x$ (10) $$

Note that a distinct neural network $e$ is not mandatory. For example, the "prompts" in PromptIR [] are a set of trainable parameters that do not require a separate network to generate them. Yet, the conclusion remains the same even if network $e$ is non-existent.

###### Theorem 4 .

(The Theorem 3 in [])
In the setting of [Theorem 3](#Thmtheorem3), except $k$ is not necessarily $\mathcal{O}(1)$. Assume that the first layer of any $q\in\mathbf{q}$ is bounded $\|W^{1}\|_{1}\leq c$, for some constant $c>0$. If the embedding method achieves error $d(\mathcal{E}_{\mathbf{e},\mathbf{q}},\mathbb{Y})\leq\epsilon$, then, the complexity of $\mathbf{q}$ is: $N_{\mathbf{q}}=\Omega\left(\epsilon^{-\min(m,2m_{1})}\right)$.

###### Theorem 5 .

(The Theorem 4 in [])
Let $\sigma$ be as in [Theorem 3](#Thmtheorem3). Let $y\in\mathbb{Y}=\mathcal{W}_{r,m}$ be a function, such that, $y_{I}$ cannot be represented as a neural network with $\sigma$ activations for all $I\in\mathcal{I}$. Then, there is a class, $\mathbf{g}$, of neural networks with $\sigma$ activations and a network $f(I;\theta_{f})$ with ReLU activations, such that, $h(x,I)=g(x;f(I;\theta_{f}))$ achieves error $\leq\epsilon$ in approximating $y$ and $N_{\mathbf{g}}=\mathcal{O}\left(\epsilon^{-m_{1}/r}\right)$.

In the realm of image restoration, $m_{1}$ equals $3HW$, and $m_{2}$ equals $k$, where $k$ denotes the dimensionality of the flattened degradation embedding. In our method, $k$ is consistent with the shape of the Global Information Vector (GIV), specifically $2C$, and thus is $\mathcal{O}(1)$. Conversely, in PromptIR [], $k$ is dynamic and contingent on the resolution of the input image, precluding it from being $\mathcal{O}(1)$. Theorem 5 indicates that the complexity for a Hypernetworks-based method to attain an error of $\epsilon$ is $\mathcal{O}\left(\epsilon^{-3HW/r}\right)$. Theorems 3 and 4 collectively suggest that the complexity for embedding-based methods is at least $\Omega\left(\epsilon^{-\min(3HW+k,6HW)}\right)$. This comparison illustrates that Hypernetworks-based methods like HAIR may require fewer parameters to reach a given error threshold compared to their embedding-based counterparts.

###### Theorem 3 .

###### Theorem 4 .

###### Theorem 5 .

### 6.2 Visual Results

In [Fig. 5](#S6.F5), [Fig. 6](#S6.F6) we provide more visual results to show the strong ability of our method for image restoration tasks.

Figure: Figure 5: Additional visual results.
Refer to caption: /html/2408.08091/assets/x5.png

Figure: Figure 6: Additional visual results
Refer to caption: /html/2408.08091/assets/x6.png

## Peer Reviews

confidence: 5
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. The proposed method may not appear dominant for the dehaze task when compared to DaAIR. The authors should consider analyzing the reasons for this.

2. More visual results are needed for tasks such as deblurring and low-light enhancement. Additionally, quantitative comparisons for single-degradation experiments (deblurring and low-light enhancement) should be included. The current visual results make it challenging to observe differences, so the authors could consider labeling these differences in the plots or displaying PSNR/SSIM metrics to improve clarity.

3. An updated baseline could be added to Table 6 to strengthen comparisons.

4. What does "Linear Combination" refer to in Figure 3? How is the "weights box" generated?

5. The article lacks a description of the loss function. Additionally, is there a loss constraint applied to the Global Information Vector (GIV)?

6. Consider adding single-task performance as an upper bound in Tables 9, 10, and 11 to verify the authors' conjecture: “This tendency results in weights that are a midpoint between those associated with each individual degradation type.”

7. Since the experiments in this paper are based on synthetic data, the authors could consider validating the model on real images to demonstrate its generalization ability.

8. Some comparison methods in Tables 3 and 6 lack citations.
soundness: 3
strengths: 1.This work theoretically prove that, for a given small enough error threshold ϵ in image restoration tasks, HAIR requires fewer parameters compared to main stream embedding-based All-in-One methods.

2. The writing is logically rigorous.
summary: This work proposes a plug-and-play Hypernetworks-based module, which can be easily integrated and adaptively generate parameters for differentnet works based on the input image. Specifically, two main components are introduced, the Classifier and the Hyper Selecting Net (HSN) . The former is a simple image classification network with Global Average Pooling, designed to produce a Global Information Vector (GIV) that encapsulates the global information from the input image. The HSN functions as a fully-connected neural network, receiving the GIV and outputting parameters for the corresponding modules.
weaknesses: 1. Some experiments are not provided, such as the single-task performance usually tested in all-in-one image restoration works as an performance upper bound, and the results in real-world cases in addition to the synthetic cases.

2. The analysis should be improved, such as the dehazing performance of the proposed method over DaAIR.

3. The descriptions for the proposed method should be improved, such as the loss function.

More details of the weakness are provided in the Questions part.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. Could you provide more detailed insights into the computational overhead introduced by the Hyper Selecting Net during inference? Specifically, how does the increased parameter generation cost compare with conventional fixed-parameter models, particularly regarding runtime and GPU memory usage? This would help in better understanding the practical deployment challenges of HAIR.
soundness: 3
strengths: 1. Unlike traditional approaches that use a fixed set of parameters for handling different types of degradation, HAIR dynamically generates parameters tailored to the specific input image. This adaptive parameter generation is an innovative use of hypernetworks in image restoration, marking a significant departure from the existing fixed-parameter paradigm.
2. The manuscript is written in a clear and concise manner, making it easy to follow. The logical flow of the content aids in understanding the key points.
3. HAIR's significance lies in its potential to redefine how All-in-One image restoration tasks are approached. By moving away from the conventional fixed-parameter models to an adaptive, data-conditioned mechanism, HAIR not only enhances restoration quality but also simplifies model design, making it more suitable for real-world applications where degradations are often unknown and mixed.
summary: The paper proposes HAIR, a Hypernetworks-based all-in-one image restoration method that dynamically generates parameters based on input images. Unlike existing methods that use fixed parameters for different degradations, HAIR adapts to each specific degradation, enhancing its effectiveness. By incorporating a Classifier and Hyper Selecting Net, HAIR outperforms current state-of-the-art models like PromptIR and InstructIR, achieving superior or comparable results.
weaknesses: 1. While the Hyper Selecting Net effectively generates dynamic parameters, it does introduce additional computational complexity, especially during inference. A more in-depth analysis of this trade-off between performance improvement and computational cost could further strengthen the claims.

---

confidence: 5
contribution: 2
initial_rating: 3
presentation: 2
questions: 1. Could the authors elaborate on how the classifier module performs classification? For example, is it based on degradation types such as denoising or deraining, or does it classify based on internal features or another method? A detailed explanation would be helpful. Additionally, are the authors familiar with the PromptIR model? The results in Table 3 indicate that there is little difference between Res-HAIR and PromptIR. Have the authors validated the effectiveness and computational efficiency of these two networks?

2. The ablation study is limited to the impact of the classifier and HSN components. It is suggested that the authors investigate the influence of the depth of the Hyper Selecting Network or the dimension of the Global Information Vector on the model's performance. Additionally, in Table 4, the Rain100L dataset is used for the ablation study, while the de-raining results in Table 2 also employ the Rain100L dataset. Could the authors explain the discrepancy in the obtained PSNR results?

3. Could the authors discuss potential practical applications of HAIR, especially in scenarios where images are degraded by multiple factors, such as in autonomous driving or surveillance systems? How does HAIR's performance translate to these real-world applications?
soundness: 3
strengths: 1. The paper introduces HAIR, a novel approach that leverages hypernetworks to dynamically generate parameters for image restoration tasks. This represents an innovative application of hypernetworks in the field of image restoration, offering a fresh perspective. The method is designed to be plug-and-play, allowing integration with existing image restoration models to enhance their performance without significant structural changes. The authors have also provided code for supplementary materials, which is a positive aspect for reproducibility.
2. The paper is well-organized and structured, guiding the reader through the problem, the proposed solutions, experiments, and results. Each section transitions logically to the next, making the paper easy to follow.
summary: This paper proposes a hypernetworks-based all-in-one image restoration plug-and-play method called HAIR. This method generates parameters based on the input image, allowing the model to dynamically adapt to specific degradations. HAIR consists of two main components，the Classifier and the Hyper Selecting Net. The Classifier is a simple image classification network that generates a Global Information Vector containing the degradation information of the input image. The HSN is a fully connected neural network that receives the GIV and outputs parameters for the corresponding modules.
weaknesses: 1. While the paper claims that HAIR can generalize to unseen composite degradations, the results for these cases show only marginal improvements over the baseline PromptIR method. The restoration outcomes for such degradations are not satisfactory, indicating that the model may not be fully capturing the complexities of real-world degradation combinations.

2. The paper emphasizes the parameter efficiency of HAIR compared to embedding-based methods. However, there is a lack of discussion on the computational cost and runtime of the hypernetwork-generated parameters. In practical applications, especially in resource-constrained environments, both the number of parameters and the computational efficiency are crucial. 

3. The experiments are comprehensive but are limited to a specific set of benchmark datasets. To further validate the generalization capabilities of HAIR, it would be beneficial to include additional datasets that capture a wider variety of real-world conditions and degradation types.  Furthermore, the paper does not provide a more comprehensive visual comparison.

4. The ablation studies are limited to the impact of the Classifier and HSN components. More detailed ablation studies on other aspects, such as the depth of the Hyper Selecting Net or the dimensionality of the Global Information Vector, could provide deeper insights into the factors that influence HAIR's performance.