Reinforced Compressive Neural Architecture Search for Versatile Adversarial Robustness
산업용 섬유 · (10) 아라미드
기본 정보
- 저자
- DOI
- 10.1145/3637528.3672009
- 저널
- Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining
- 발행년도
- 2024
- 발행기관
- –
- 피인용수
- 1
- 라이선스
- cc-by
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1145/3637528.3672009
- 토픽
- High-Velocity Impact and Material Behavior
- OpenAlex ID
- W4401862778
평가 내용
- 관련도
- 사업분야
- 산업용 섬유 · (10) 아라미드
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '산업용 섬유 > 아라미드' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
본문 50,456자
본문 펼치기
섹션 본문 88문단 · 48,494자
(제목 없음)
1Prior neural architecture search (NAS) for adversarial robustness works have discovered that a lightweight and adversarially robust neural network architecture could exist in a non-robust large teacher network, generally disclosed by heuristic rules through statistical analysis and neural architecture search, generally disclosed by heuristic rules from neural architecture search.However, heuristic methods cannot uniformly handle different adversarial attacks and "teacher" network capacity.To solve this challenge, we propose a Reinforced Compressive Neural Architecture Search (RC-NAS) for Versatile Adversarial Robustness.Specifically, we define task settings that compose datasets, adversarial attacks, and teacher network information.Given diverse tasks, we conduct a novel dual-level training paradigm that consists of a meta-training and a fine-tuning phase to effectively expose the RL agent to diverse attack scenarios (in meta-training), and making it adapt quickly to locate a sub-network (in fine-tuning) for any previously unseen scenarios.Experiments show that our framework could achieve adaptive compression towards different initial teacher networks, datasets, and adversarial attacks, resulting in more lightweight and adversarially robust architectures.
INTRODUCTION
2Deep neural networks (DNNs) have benefited many real-world applications, such as image classification [16], object detection [18], and natural language processing [24].However, standard DNNs are vulnerable to adversarial attacks, raising an effective remedy to include deeper and/or wider blocks along with adversarial training [20,23,31,33,36].Since such strategies may incur significant computational overhead, recent efforts have been devoted to locating lightweight architectures that are robust to different adversarial attacks through neural architecture search (NAS) [6,9,12,13,25,39].
3One mainstream direction in NAS is to leverage a generative process to seek the best-performed network architectures based on a manually designed library of architectural ingredients.However, given the complex nature of DNN architectures coupled with the diverse types of adversarial attacks, such a process can become too costly to cover various aspects, making it hard to guarantee a good adversarially robust performance.Another line of work suggests that there exists an optimal architectural configuration for adversarial robustness in a large non-robust "teacher" architecture, which enjoys a smaller parameter size and better robustness [12,25].Consequently, network-to-network (N2N) compression could be conducted to achieve adversarial robustness and has shown promising progress in recent works [12,13].For example, Huang et al. [13] investigated over 1,000 network architectures randomly sampled from some large teacher networks and selected top-ranked robust sub-networks.Empirically, they derived a set of useful rules that can help to guide the design of robust ResNet (RobustResNet) architectures from different teacher networks and computation budgets, varying from 5G to 40G.However, most of these rules are derived in a heuristic way, offering no guarantee of achieving an optimal trade-off between compression ratio and adversarial accuracy as the learning environment changes, which thus may lead to suboptimal performance.As shown in Figure 1, RobustResNet [13] suffers from a lower adversarial accuracy due to adopting the fixed configuration rules across different attacks and computation budgets.
4To overcome the key limitations of existing solutions, we propose a novel reinforcement learning (RL) framework, referred to as Reinforced Compressive Neural Architecture Search (RC-NAS), that leverages the flexibility of a specially designed RL agent supported by a powerful dual-level training paradigm to perform a systematic search over a rich and complex space of architecture configurations.The trained RL agent can quickly adapt to the highly diverse attack scenarios and locate a compressed student sub-network with guaranteed adversarial robustness while meeting the computational budget constraints.The ability to automatically adjust to distinct attack scenarios and adaptively compress the teacher network in different ways (instead of following fixed rules) is a critical step towards realizing truly versatile adversarial robustness that significantly advances the state of the art.
5To achieve versatile adversarial robustness, it is essential to identify the key characteristics from different attack scenarios and train the RL agent to recognize them and perform adaptive N2N compression given a specific attack setting.To this end, the proposed RL framework collectively considers important features of the teacher network, the nature of the dataset, the level of adversarial attack, and the overall computational budget.Based on different attack conditions as RL states, the compression ratio of each stage (RL actions) should be adaptive to achieve the best compression and robust accuracy trade-off.Specifically, given an RL state, the agent performs an action to shrink the network by compressing the width and depth at the stage level as well as determining specific configurations (e.g., convolution type, activation, and normalization) at the block level.A specially designed award function that integrates adversarial accuracy with computational budget constraint serves as the feedback to encourage the RL to seek for architectures with an optimal robust accuracy and compression trade-off.
6For the RL training, we introduce a novel dual-level training paradigm that consists of a meta-training and a fine-tuning phases to effectively expose the RL agent to diverse attack scenarios so that it can quickly adapt to a sub-network customized towards the unknown attacks during the test phase.In the meta-training phase, a pool of diverse attack tasks with distinct characteristics is formulated.The RL agent is iteratively trained by sampling different tasks from the pool so that it can gain the capability to recognize key patterns from these different combinations of task key factors and perform adaptive N2N compression.In the second phase, the agent is given a more specific attack scenario and it performs finetuning by leveraging the meta-trained model as the starting point to achieve quick and effective adaptation.Figure 1 (a)-(d) shows that the proposed RL framework can adapt to different attack scenarios by finding highly customized robust sub-networks, instead of relying on a fixed set of configuration rules as in existing works.As a result, it leads to much improved adversarial accuracy with a better compression ratio.Furthermore, as shown in (e)-(h), highly distinct compression ratios are applied to different stages of the teacher network and an overall higher compression ratio is applied to a larger teacher network.More interestingly, the compression ratios also vary dramatically based on the level of attacks: for a more severe attack (i.e., auto-attack), the first two stages are compressed much less (to capture the subtle changes in the input) while the last stage is compressed more significantly (to reduce the perturbation caused by the attack).Our theoretical analysis provides further insights on the compression behavior.
7To the best of our knowledge, this is the first effort to provide a principled RL framework for searching an adversarially robust architecture in a non-robust large teacher network (network-to-network compression for adversarial robustness).Our main contributions are summarized below:
8framework that leverages the flexibility of reinforcement learning to explore a rich and complex space of architectures for lightweight and adversarially robust sub-networks, • Simulated RL environment equipped with a specially designed state encoder and an award function, allowing the RL agent to encode key ingredients from the teacher architecture, the dataset, level of adversarial attack, and the computational budget, • Dual-level RL training to enable quick adaption to specific attack settings by exposing the RL agent to diverse attack scenarios, • Deeper theoretical analysis that reveals why the RL driven N2N compression can lead to improved adversarial robustness.We conduct extensive experiments to demonstrate the effectiveness of the proposed RC-NAS framework over different input conditions, including different teacher network architecture with pairing computation budgets (5G-40G), and visual learning tasks of varying difficulty (CIFAR-10, CIFAR-100, and Tiny-ImageNet).For the adversarially trained RL compressed network, we compare it with the latest N2N compression baselines for adversarial robustness and show its superior performance across different teacher network capacities, datasets, and adversarial attack test conditions.We also emphasize that such good performance is attributed to the novel RL framework and its unique dual-level training paradigm, which is verified by multiple ablative studies and statistical analysis of RL selected robust sub-network architectures.
RELATED WORK
9Neural Architecture Search (NAS).There has been much work on exploring the rich design space of neural network architectures [6,14,39,40].The principal aim of previous work in architecture search has been to build models that maximize performance on a specific dataset.There has been increasing interest in conduct a N2N style architecture search to achieve adversarial robustness [9,12,13].For example, Wu et al. theoretically analyze why wider networks tend to have worse perturbation stability on linearized neural tangent kernels and develop a width adjusted regularization (WAR) algorithm to address that [32].Huang et al. emphasize that a higher model capacity does not necessarily improve adversarial robustness, especially in the last stage and there exists an optimal architectural configuration for adversarial robustness under the same parameter budget [12].To this end, residual networks have been intensively analyzed by considering architecture design at both the block level and the network scaling level [13].A robust residual block and a compounding scaling rule have been derived to properly distribute depth and width at the desired computation budget.However, those proposed heuristic rules for N2N compression are either too general or too specific for diverse adversarial learning scenarios.A flexible way to achieve a robust architecture that can adapt to the unique characteristics of each attack scenario is in demand to achieve truly versatile adversarial robustness, which is the focus of our work.) stages as in [13] and we visualize both depths and widths of the corresponding RobustResNet for each stage.In (a)-(d), the left three bar plots (in blue and orange) show the depths and widths in the three stages of RobustResNet A3 and A4 that follow the same configuration rules; the right three bar plots (in red and orange) show the adaptive configuration obtained by the proposed reinforced learning (RL) based architecture search.In (e)-(h), the grey bars denote the capacity of the corresponding teacher networks and denotes the remaining percentage of each stage after compression.
10Network pruning.Pruning-based methods preserve the weights that matter most and remove the redundant weights [8,10,17].While pruning-based approaches typically operate on the weights of the model, our approach operates on a much larger search space over both model weights and model architecture.Recently some works have combined adversarial learning with network pruning such as Hydra [25] and ADMM [35], but none of them have paid attention to architecture search.Instead, our work focus on reinforced neural architecture search for adversarial robustness, thus providing more flexible architectural design choices and enjoying a compressed parameter space at the same time.
11Reinforcement learning.Deep Reinforcement Learning has been extensively applied in game agent training [21], natural language contextual understanding [27], causal relationship inference [37], image classification [11], object detection [3], time series analysis [29] and information retrieval [30].In the NAS domain, there are some works [2,40] focusing on designing an RL agent to sample a sub-network within a pre-defined architecture search space.For example, Ashok et al. perform student-teacher knowledge distillation for clean accuracy on small datasets [2].However, none of existing efforts pay attention to the relationship between the adversarial robustness and the reinforced network-to-network compression, which is main design focus of our RL framework.
METHODOLOGY
12Overview.The overall goal of the proposed RC-NAS framework is to train a RL agent so that it can perform adaptive N2N compression of a large teacher network to achieve lightweight sub-networks robust to specific adversarial attacks.Given a different attack scenario, the RL agent needs to recognize its key characteristics and formulates a customized policy to generated compression actions.To this end, we propose a dual-level training paradigm and employ a meta-training phase to expose the RL agent to diverse attack scenarios.For the action design, we want our RL agent to control both macro stagelevel width/depth configuration and micro block-level details, such as convolution types, activation and normalization.To support RL training, we define a formal Markov Decision Process that provides the key building blocks of the RL environment.
Markov Decision Process
13The Markov Decision Process (MDP) for our proposed RC-NAS defines its own state, action, reward and state transition function: In each time step, we sample the input teacher architecture, adversarial attack, as well as a dataset and encode them into the next state +1 by leveraging the state encoder.Then, the multi-head policy network takes +1 to generate a compression action +1 that specifies the compression operations, such as the remaining percentage of depth and width for each stage, as well as the application of robust block configurations.After getting the newly sampled sub-network, it is included into the architecture buffer and the RL agent moves to the next step.For RL training, we train the RL sampled sub-network on the training set with standard adversarial training and test its adversarial performance on corresponding evaluation set of the same input task setting.The reward is calculated based on the adversarial accuracy normalized by the robust accuracy from the teacher network, and weighted by the compression ratio comparing to the teacher network.We also consider an annealing penalization if the computation budget is not satisfied.The whole RL framework is trained by vanilla policy gradient based on the above defined reward.We introduce the detailed RL settings in the following section.
Reinforced Neural Architecture
14Attack task formulation An attack task is formed by combining an adversarial attack method P, a dataset , and an initial teacher architecture sampled their corresponding buffers.An evaluation set is further separated from the dataset for reward evaluation (we assign 256 data samples to the evaluation set in our experiments).After the RL agent is fully trained, it will sample a sub-network from the target task's teacher network , and then the selected sub-network will be trained using a standard adversarial training process on the clean training set and evaluated on P-attacked test set from the target task.
15State encoder.As shown in Figure 2a, the state encoder takes the initial teacher network topology as input, including each stage's width (scalar), depth (scalar), stride step of its first layer indicating whether to down-sample the input feature map into half from the last stage output (binary), and the application of robust block [13] inside each stage (binary).We split above information into stage encodings which summarize each stage's related information.These stage encodings ST , ∀ ∈ [1, ] will go through a bi-directional LSTM to output forward and backward encodings and , respectively.The forward encoding summarizes all previous stage information while the backward encoding considers the afterward stage information beyond the current stage.
16To capture the level of adversarial attack, we propose to evaluate the Lipschitz coefficient [28] of the attacked dataset with respect to the teacher network.This can be achieved through three steps: 1) Train the teacher network using a standard adversarial training process on the training set.2) Perform adversarial attack on the clean trained teacher network with evaluation set data applying the adversarial attack method from the same input task setting.3) Calculate the Lipschitz coefficient of each adversarial attacked data instance on the evaluation set by comparing to the network output from the same clean instance,
17where is the adversarially trained teacher network, P is the chosen adversarial attack, and is the evaluation set.
18Finally, the capacity of the current input teacher network is represented by its inference speed cost on every data instance of the evaluation set, which is measured by GFLOPs, resulting into another embedding vector CT.By concatenating all four embedding vectors, we generate the state embedding concat(LIPS, , , CT).Through a multi-layer perception module MLP we transform the a state embedding into the RL state ,
19Multi-head policy network.Multi-head policy network (•) functions as the RL actor to generate actions given state
20corresponding to is a four dimensional vector and designates four different compression operations for each stage.The policy network is multi-head after a shared feature extraction module E. Specifically, the our heads are to generate the two pairs of means: = ( ,1 , ,2 ) ⊤ and a covariance matrix
21for constructing a two-dimensional Gaussian distribution N ( , Σ ), to sample the remaining percentage of the width and depth after RL compression.We use a diagonal co-variance matrix Σ by assuming that width and depth are independent to each other.Another two heads are used to generate the probabilities = ( ,1 , ,2 ) for sampling two binary signals through a multi-Bernoulli distribution to designate whether to half down-sample the input feature map in the stage's first layer through the first binary signal and whether to apply the robust block configuration in that stage through the other binary signal.For those Gaussian and Bernoulli heads with parameters N and B , we train them with vanilla policy gradient using the reparametrization trick [15], and the gradients from two heads will both trace back to and update the shared feature extraction module parameters E .We formulate this process below:
22where is the sigmoid activation function.
23RL reward design.The evaluation reward is defined in Eq. ( 4).First, the generated network compressed by the RL actions is trained on the training set of the given task using standard adversarial training, and then evaluated on the adversarially attacked evaluation set of the task to get the adversarial accuracy à .Then, the accuracy is normalized by the adversarially trained teacher network's evaluation accuracy Ãℎ and then weighted by a compression ratio comparing to the teacher network, we use the quadratic form (2 − ) to smoothly encourage a higher compression due to the characteristics of the quadratic curve, where = 1 reaches the peak of curve (2 − ).We also consider the desired computation budget which is measured by GFLOPs.If the average inference speed (GFLOPs) of the RL compressed sub-network on evaluation set = () surpasses this computation budget, the reward will be penalized by an annealing factor which starts 1 and gradually reduce to 0 as training goes.Therefore in the beginning of training, RL agent is encouraged to find the best adversarial robust architectures suitable to the task setting while not paying too much attention to the computation budget limit, and as it is trained to grasp the necessary knowledge about architecture choices, it will try to fulfill the computation budget requirements while following its summarized rules for compressing the network.
24Optimization.The state encoder is pre-trained separately as Figure 5 shows in Appendix C.After its pre-training, the state encoder's weight will be frozen during RL framework training to guarantee the training stability and success.For RL framework optimization, only the actor will be updated by an RL training algorithm, namely vanilla policy gradient (VPG), through multiplying the reward with the probability of action leading to that reward.The training objective optimization of VPG is defined as Eq. ( 5), and the parameter of the policy network (•) will be updated.
25where
Dual-level Training Paradigm
26We develop a dual-level training paradigm for the RL framework training.The meta-training phase aims to expose the RL agent to diverse adversarial attack scenarios so that it can it can gain a general knowledge from learning a wide range of tasks of varying levels of attack, dataset difficulty, input teacher architecture, and computational budget.In the second phase, the agent performs fine-tuning on the target task by leveraging the meta-trained model as the starting point to achieve quick and effective adaptation.For the newly RL compressed subnetwork, we evaluate its reward using Eq. ( 4) and train the RL using Eq. ( 5) with VPG.Then, the sub-network will be added into the architecture buffer and move to the next time step by sampling next input task setting.When the maximum time step is reached, we start a new RL iteration by re-initializing all the buffers until maximum RL iteration is reached.• Downstream RL fine-tuning: After meta RL training, we let the RL agent quickly adapt to the target domain by conducting a few iterations of fine-tuning.We conduct similar operations as in meta RL training and the only exception is that the target task setting could be repeatedly provided as fine-tuning task input instead of randomly sampling.We set = 1, = M for an one time-step, limited iteration RL fine-tuning.The psueduo code of the detailed training process is summarized by Algorithms 1 & 2 in the Appendix.
Theoretical Analysis
27In this section, we theoretically demonstrate how the proposed RL-guided compressed student sub-network trained on adversarial samples results in a better adversarial accuracy compared to the dense network trained using standard adversarial training.To prove this, we leverage the idea of the dense mixture accumulation concept and extend the recently developed theoretical framework that justifies the effectiveness of the adversarial training to improve the robustness performance [1].For this, first, we define the problem setup that involves the key concepts used in our theoretical analysis along with some assumptions to make the proof easier.Next, we present a lemma, demonstrating how the proposed RL-compressed student sub-network leads to the tighter gradient update bound compared to one without compression.Finally, based on the lemma, we present the main theorem that shows how the proposed RLcompressed student sub-network achieves better robust accuracy on adversarial training by ensuring the more reduction in the dense mixture components compared to the the one without compression.For brevity, we denote RL-compressed student sub-network trained using adversarial samples as − and the one without compression as .Problem setup.Let us assume x ∈ R indicates the ℎ data sample that is used to train the student sub-network obtained using our proposed RC-NAS framework.Also, let us assume that the data sample x ∈ R is generated from the sparse coding mechanism with x = Mz + ε, where M ∈ R × is a sparse matrix whose basis functions is learned by student sub-network.Further z ∈ R is the sparse hidden vector with sparsity defined by parameter .ε ∈ R is the Gaussian noise with zero mean and standard deviation of .Also, for the sake of simplicity let us assume that the final student sub-network obtained using RC-NAS is a simple, two-layer symmetric neural network with ReLU activation.Then with , being the hidden weight for the ℎ neuron at time , the student sub-network can be represented as:
28where is the bias at ℎ at training step , and ∼ N (0, 2 ) is the smoothing of the original ReLU.Then at any clean training , the weight learned by ℎ neuron can be decomposed as the following
29where that are responsible to generate inaccurate response during the adversarial attack.It should be noted that we have a big portion of the robust (pure) features along with some small dense mixtures during the training process in a given neuron.Also, ∈ N where N indicates the subset on which we have a highly correlated pure features.Based on this problem setup we present the following lemma for the gradient update.Remark.It should be noted that in the case of the − , we reduce the width as well as the depth of the given network.This is the same as zeroing out unnecessary edges in our dictionary matrix M.However, zeroing out the pure (robust) features in dictionary M will lead to a smaller reward.Intuitively, we can infer that to maximize the reward, the RL-agent is forced to compress less important (mostly the dense mixture) components in the given network.Based on this, we have the following theorem.Theorem 3.2.Let + ′ ,− be the final dense mixture component for the ℎ neuron of − and + ′ , be the dense mixture for the ℎ neuron of .Then, based on the gradient update Lemma 3.1 with high probability we have the following:
30Remark.This theorem indicates that our proposed RC-NAS based sparsification mechanism on a teacher network has the potential to further lower the dense mixture components compared to without sparsification.This is because, through the sparsification, our RL-agent strives to find the sparse student sub-network that can potentially improve the adversarial accuracy by zeroing out the many non-robust entries in the dictionary M. Please refer to the Appendix for the proof.
EXPERIMENTS
31Datasets.We have three datasets as our test beds, CIFAR-10, CIFAR-100 and Tiny-ImageNet.CIFAR-10 and CIFAR-100 are widely used benchmark datasets in computer vision for image classification tasks.CIFAR-10 consists of 60,000 32x32 color images in 10 classes, with 6,000 images per class, while CIFAR-100 has the same number of images but in 100 classes.In Tiny-ImageNet, there are 100,000 images divided up into 200 classes.Every image in the dataset is downsized to a 64×64 colored image.For every class, there are 500 training images, 50 validating images, and 50 test images.
32Adversarial attacks.Projected Gradient Descent (PGD) [20] is an iterative FGSM method by iteratively conducting FGSM until the image is misclassified or a certain number of iterations is reached.
33In our setting, we try 20 attack methods with an attack radius ε = 8/255 and with a maximum number of iterations 20.Also, we investigate a traditional Carlini & Wagner ( 40 ) attack [4], which utilizes two separate losses: An adversarial loss to make the generated image actually adversarial, i.e., is capable of fooling image classifiers, and an image distance loss to constrain the quality of the adversarial examples so as not to make the perturbation too obvious to the naked eye.Auto-attack [5] is a prevailing comprehensive attack method which is a parameter-free, computationally affordable, and user-independent ensemble of existing attacks.
34Experimental settings.Given four initial teacher networks (WRN-28- trained with standard adversarial training on the clean training set from the same task setting and evaluated their performance on the same test split in the target task setting.The standard adversarial training (AT) method is TRADES [36] with auto-attack as the adversarial attack choice.
35Baselines.We compare our proposed RC-NAS with other latest neural architecture search works for adversarial robustness, such as RobNet-large-v2 [9], AdvRush [22], RACL [7], WRN-34-R [12] and RobustResNet A1-A4 [13] corresponding to computation budgets 5G, 10G, 20G, 40G, respectively.We also include the performance of the teacher network in the beginning of each computation budget category for reference.For fair comparison, we align the network capacity of AdvRush and RACL to different computation budgets by adjusting the number of repetitions of the normal cell N and the input channels of the first normal cell C, denoted as (N@C).The additional details of those baselines are described in Appendix F.
Results and Comparison
36For target task settings, we use CIFAR-10, CIFAR-100 and Tiny-ImageNet as dataset choices, and train all baseline models under four computation budgets using standard adversarial training on the same clean training set and test their adversarial performance on the clean test set or test set with three different adversarial attack categories ( 20 , 40 , AutoAttack).For the compressed subnetworks selected by the RL agents which are fine-tuned given different target tasks, we train them with standard adversarial training and report its their respective test performance on the corresponding task setting, i.e.CIFAR-10, CIFAR-100 test set with no attack or three different kinds of adversarial attacks, same as other baselines.We summarize the comparison results of CIFAR-10 and CIFAR-100 in Table 1, and results of Tiny-ImageNet in Table 5.From Table 1 and 5, our model consistently achieves better classification accuracy under different computation budgets and adversarial attacks on the test sets, either for CIFAR-10, CIFAR-100 or Tiny-ImageNet, compared to all the other baselines of similar budgets.The RL decided sub-network is not only superior in robust accuracy against adversarial attacks, but also smaller regarding its parameter size (See column # ()) and achieves faster inference speed, denoted by GFLOPs in column # ().
37Remark.We would like to clarify that we included PGD, which can be regarded as an iterative FGSM.Since it is more severe than FGSM, we did not report FGSM result separately.Instead, we provide a more detailed analysis that varies the PGD attack upper boundary rate from 4/255 to 16/255 and the results are summarized in the table 2. As can be seen, RC-NAS maintains a clear advantage other strong baselines such as RobustResNet-A1, A2 in 5G/10G computational budgets under different perturbation rates.
SoTA Adversarial Attacks.
38As for black-box attacks, we already included auto-attack [5].By investigating latest adversarial attack methods, we conducted experiments by adding advanced boundary attack [26], neuron-based attack [38] and latest adaptive auto-attack methods ( 3 ) [34], (3) [19].Specifically, we fine-tune our meta-trained RL agent under above SoTA adversarial attacks on CIFAR-10 within WRN-28-10 (5G budget).The comparison result with RobustResNet-A1 is shown in Table 3.It can be seen that RC-NAS remains robust under these SoTA attacks, and achieves clear advantage comparing to the strongest baseline RobustResNet-A1, thanks to the achieved versatile adversarial robustness.
Ablative Study on RL critical design components.
39We use RL compressed teacher network WRN-46-14 (20G) on Tiny-ImageNet as an example.Given the target task, we first train and downstream fine-tune the RL agent using different design ablation component settings and get the corresponding RL agent with its compressed sub-network.Then, we test the sub-network's classification accuracy on the test set from the same target task, after standard adversarial training.The result is shown in Table 7.We can clearly see that model's performance on all categories will largely drop after the Lipschitz-guided data difficulty embedding being removed in state formulation.Also, without which reflects the teacher network's inference costs and capacity, the performance will drop a little around 1%. Annealing represents the model is using soft annealing penalty when constraints are not satisfied, otherwise just assign -1 as a hard penalty for those actions violating the computation budget.By ablating it, the performance also drops around 2% for different attack categories.
Statistical Analysis.
40Given different teacher networks (WRN-28-10, WRN-34-12) with computation budgets (5G, 10G), we can analyze the RL agent compress decisions on them for auto attacked CIFAR-10 and CIFAR-100 datasets.For WRN-28-10 as teacher network input, it lacks enough generalization ability to auto attack for either CIFAR-10 and CIFAR-100, resulting into a relatively higher width ratio for the last stage comparing to the larger (10G) budget teacher model WRN-34-12, especially for CIFAR-100 which is more Figure 4: RL compressed sub-network statistical analysis: depth/width compression ratio across three stages under 5G and 10G budgets (5G-D, 5G-W, 10G-D, 10G-W), and the total depth to total width compression ratio under 5G (5G-T) and 10G (10G-T) budgets on auto attacked CIFAR 10 and 100.
41complex to classify.For the total width to total depth ratio, 5G model is much higher than 10G model on either CIFAR-10 or CIFAR-100, because the model needs to expand width more to effectively learn the important features for classification given the relatively smaller budget.For the 10G model, it possesses enough parameter learning space and prefers adversarial robustness more than generalization ability, thus tending to reducing the width for higher adversarial robust accuracy.The statistical comparison is shown in Figure 4.
CONCLUSION
42In this paper, we propose a RC-NAS framework trained by a novel dual-level training paradigm to achieve reinforced compressive neural architecture architecture search.Specifically, given an input teacher network, a dataset and adversarial attack, our RL agent is able to recognize its difficulty level based upon the capacity of the given teacher network and perform the adaptive stage-level and block-level compression to generate a robust sub-network architecture.Experiments show that our proposed RL sub-network achieves an improved test performance on a wide range of target task's test set across different datasets, adversarial attacks and initial teacher networks.We further investigate the topology of the RL generated sub-network to illustrate its effectiveness in selecting a unique and adversarial robust network architecture given the target task requirements.The general RL training process is included in Algorithms 1.For meta-training, we set 100 iterations for the RL agent to learn the general knowledge.Each iteration includes 5 time steps so 500 architectures will be trained.State and action generation are fast as they only perform forward passes.Reward evaluates current selected sub-network.We train each such subnetwork in 5 epochs and evaluate their accuracy to get the reward.
E THEORETICAL PROOF
43In this section, we provide the Proof of Lemma 3.1 and Theorem 3.2.Before formally proving them, first we would define the gradient update in our case which would be the essential block to prove our Lemma and Theorem.
E.1 Gradient Computation
44At every iteration t, the gradient of the loss with respect to the neuron Θ can be represented as :
45For simplicity, considering the task to be binary classification problem i.e., ∈ [−1, 1], and loss to be log-loss represented as:
46Further, ′ (Θ , ; x, , ) is defined as:
47It should be noted that for the sake of simplicity, we have removed the subscript wherever applicable.For the generic gradient direction shown above, we will first derive the upper bound and then instantiate to the RL-guided compressed sub-student network − and dense network without compression i.e., .It is worth mentioning that we apply adversarial training on both networks.Using the Analysis of F.4 from [1], we can write the following
48In the above equation
492 ) Now let us try to find the bound for the norm of
50According to Eq. F.7 [1], inner product of with M ; ∈ [] can be decomposed into the following three terms:
51The summation of the first term in above equation for all neurons can be represented as (using Eq.F.8 from [1])
52It should be noted that the scalar s takes different values depending on the nature of the training.In the case of the RC-NAS student sub-network adversarial training, as the model is forced to zero out the weights, ⟨x, M ⟩ will always be less compared to the dense network trained using adversarial training.In other words we = 1 in the case of , and 0 ≤ ≤ 1 in the case of the − .Similarly for the second term, applying the fact that ⟨M , ε⟩ for RC-NAS based student sub-network adversarial training is less than that of the standard adversarial training on the dense network, we have following (according to F.9 from [1]):
53Here = 1 for the whereas, 0 ≤ ≤ 1 for − .Similarity the bound for the third term with leveraging the fact that ⟨ , M ⟩ is smaller for the RC-NAS student sub-network compared to the standard adversarial dense network training, we have following (using F.10 in [1])
54In case of (21) This completes the Lemma 3.1.
E.3 Proof of Theorem 3.2
55Considering the Equation 3.1 is true in Lemma 3.1 then the + ′ after ′ steps of training can be expressed as
56Where is the learning rate used in the SGD to update network.Using this we can conclude
57Where ′ is the upper bound of dense mixture component for and ′ − be the dense mixture upper bound for − .By using this inequality, we can write max
58Thie completes the proof for Theorem 3.2.
F ADDITIONAL EXPERIMENT F.1 Baseline Description
59Guo et al. [9] take an architectural perspective and investigate the patterns of network architectures that are resilient to adversarial attacks.
60To obtain the large number of networks needed for this study, they adopt one-shot neural architecture search, training a large network for once and then finetuning the sub-networks sampled therefrom, the best of the model series searched by this method is called RobNet-large-v2.Dong et al. [7] explore the relationship among adversarial robustness, Lipschitz constant, and architecture parameters and show that an appropriate constraint on architecture parameters could reduce the Lipschitz constant to further improve the robustness, namely RACL.Mok et al. [22] propose AdvRush, a novel adversarial robustness-aware neural architecture search algorithm, based upon a finding that independent of the training method, the intrinsic robustness of a neural network can be represented with the smoothness of its input loss landscape.Through a regularizer that favors a candidate architecture with a smoother input loss landscape, AdvRush successfully discovers an adversarially robust neural architecture.Specifically, we align the network complexity of AdvRush and RACL models by adjusting the number of repetitions of the normal cell N and the input channels of the first normal cell C, denoted as (N@C).Huang et al. [12] propose WRN-34-R based on three key observations derived via a comprehensive investigation on the impact of network width and depth on the robustness of adversarially trained DNNs.Additionally, in the latest work [13]
F.3 Additional RL Critical Component Ablation Study
61We collect the additional RL designed component ablation study results on CIFAR-10 and CIFAR-100 under 10G computation budget from teacher network WRN-34-12 in Table 10.
F.4 Additional Topology Comparison Results
62We collect additional topology comparison results on diverse target task settings: (1) clean CIFAR-10 under 5G/10G budget, (2) auto attacked CIFAR-10 under 5G/10G budget, (3) clean CIFAR-100 under 10G/20G budget and (4) auto attacked CIFAR-100 under 10G/20G budget.The comparison results are shown in Figure 6.
G BROADER IMPACT
63Since nowadays data input from real environment is multi-modal, diverse and contain much potential unwanted noises, and most edge computing devices require an efficient memory usage of neural networks, shrinking the network parameter space without harming the generalization and adversarial robustness ability is tempting.Our method provides a novel reinforced compressive architecture search framework which could realize the difficulty level of the input scenarios and take corresponding compression operations to make the sampled neural network architecture more robust to the versatile input challenges after standard adversarial training.
H SOURCE CODE
64For the source code, please click here.
65, = O (1)M indicates pure features' contribution to produce the desired output and , = ′≠ O Θ ′ M ′ indicates the dense mixture learned during the clean training in the direction of M ′
Lemma 3 . 1 .
66Let T be the total iterations for the clean training and ′ be the additional iterations for the adversarial training.Considering be the l2-perturbation applied on input sample for the adversarial training with a radius of the perturbation defined as || || 2 ≤ .Then gradient movement bound for − is lower than that of the .Specifically let Δ − be the gradient movement in − and Δ be the gradient movement in the , then the following inequality holds at any iteration Δ
Figure 3 :
67Figure 3: Evaluation curves of the RL (w/ and w/o meta RL training) selected sub-networks on target task setting: WRN-46-14 (20G budget) on auto attacked Tiny-ImageNet.test performance, which includes a meta RL training phase to optimize under different adversarial tasks and a downstream RL finetuning phase to let the meta-trained RL agent quickly adapt to the target task setting.We name the RL agent trained directly on the target task setting (without meta training phase) as R-NAS, and the agent trained with the dual-level training paradigm as RC-NAS.Table6shows that on a large dataset Tiny-ImageNet, under same computation budgets, RC-NAS consistently improves over R-NAS, as well as enjoys a lower variance because meta training gives RC-NAS a good weight initialization that can be smoothly adapted into any downstream tasks, without suffering the instability resulting from potentially biased training under a repeated target setting.Such phenomenon has also been verified by the detailed evaluation curves along their respective downstream fine-tuning or training process, where the RL downstream fine-tuned curve with RL meta training will converge fast at earlier training iterations comparing to the RL downstream trained curve w/o meta RL training, shown as Figure3.
68Auto attacked CIFAR-100.
Figure 5 :
69Figure 5: State Encoder Pre-Training
Figure 6 :
70Figure6: Architecture topology analysis of RobustResNet in different attack scenarios from the mildest (i.e., clean) to the most severe (i.e., auto-attack) on CIFAR-10 (a)-(h) and CIFAR-100 (i)-(p) data sets.WRN-28-10, WRN-34-12 and WRN-46-14 are leveraged as teacher networks with 5, 10 and 20 GFLOPs computation budgets, respectively.The corresponding student networks are referred to as RobustResNet-A1, RobustResNet-A2 and RobustResNet-A3.The entire teacher network architecture is partitioned into multiple (e.g., 3) stages as in[13] and we visualize both depths and widths of the corresponding RobustResNet for each stage.In (a)-(d), the left three bar plots (in blue and orange) show the depths and widths in the three stages of RobustResNet A1 and A2 that follow the same configuration rules; the right three bar plots (in red and orange) show the adaptive configuration obtained by the proposed reinforced learning (RL) based architecture search.In (i)-(l), the left three bar plots represent depths and widths in the three stages of RobustResNet A2 and A3 and the right three bar plots show the RL compressed network's topology configuration.In (e)-(h) and (m)-(p), the grey bars denote the capacity of the corresponding teacher networks and denotes the remaining percentage of each stage after compression.
Robust Block LSTM LSTM Stage-1 Encoding State: Cost LIPS 1 0 Block Block Block Stem Stride LSTM LSTM Stage-2 Encoding State:
71Transition function +1 ∼ T (•| , ) is achieved by multiple buffers, i.e. an architecture buffer which
Table 1 :
7210, WRN-34-12, WRN-46-14, WRN-70-16) corresponding to different computation budgets (5G,10G,20G,40G), we apply a range of diverse adversarial attacks targeting on the trained teacher network on the clean training set with the evaluation set and test set data.In RL training and downstream RL finetuning, we leverage the training set and adversarially attacked evaluation set only.Once we get the RL compressed sub-network architectures for the target task, we train it with standard adversarial training on clean training set and test its adversarial performance using classification accuracy on the adversarially attacked test set generated above from the same task setting.For fair comparison, all baselines (architectures found by other research works given same computation budgets) will be Baseline Comparison on CIFAR datasets
Table 2 :
73Robustness against different PGD attack levels under 5G and 10G budget comparing to RobustResNet-A1,A2 respectively.Model Budget PGD 20 ( = 4/255) PGD 20 ( = 8/255) PGD 20 ( = 12/255) PGD 20 ( = 16/255)
Table 3 :
74Robustness against SoTA adversarial attack methods with comparison to RobustResNet-A1.
75Thanks to the unique dual-level training paradigm, the model can learn the key characteristics from different attack scenarios through meta-training, which takes around 45 hours.And by leveraging this general knowledge, the RL agent can perform quick adaptive N2N compression given a specific attack setting in the testing phase, which only takes 10 iterations and 3-9 hours to converge, given different architectures/datasets.For other baselines, to discover suitable sub-networks, they need to randomly sample a large number of architectures and evaluate each one.For example, RobustResNet samples 1,000 subnetworks, easily taking more than 75 hours.More importantly, as shown in our paper, when the learning environment changes, the heuristically derived rules usually lead to suboptimal performance.This implies that a large number of architectures need to be re-sampled and evaluated to meet the new requirements, which is much more expensive than RC-NAS's adaptive training strategy.The fine-tuning time of our models under different data sets, teacher networks with various budgets are detailed in Table4.
Table 4 :
76Fine-tuning time of our models under different data sets, teacher network with various budgets.
774.4.1 Effectiveness of RL guided exploration.We investigate the effectiveness of the RL guided architectural exploration by replacing it with other existing techniques, including advanced adversarial
Table 5 :
78Baseline Comparison on Tiny-ImageNet
Table 6 :
79RL v.s.net pruning and adversarial training baselines
804.4.2Effectiveness of dual-level training paradigm.Given the effectiveness of RL mechanism, we further investigate whether the novelly designed dual-level training paradigm helps improve the
Table 7 :
81Effectiveness of key components
Table 8 :
82Summary of Notations Multi-head policy network with its parameter space .N (•|, 2 ), (•|) Gaussian distribution, Bernoulli distribution. N , B , E Gaussian head, Bernoulli head and their previous shared feature extraction module's respective parameter space. , Σ 2 Suppose at any training iteration t, max ∈ [ ] || || 2 ≤ ′ .Also, for the sake of simplicity let (Θ ; x, , ) = ∈ [−1, 1].Also, consider ∈ R be the perturbation applied on x with || || 2 ≤ .Then, l2 norm of average gradient direction bound for ℎ ; ∈ [ ] neuron in the network with the adversarial input x + can be represented as: = ||E x,, 1 ⟨ + ,x+ ⟩+ ≥ (x + ) || 2
83− , 0 ≤ ≤ 1 whereas, = 1 for .Combining Eqs 17, 18, 19 and 15, we have the following ||E x,, 1 ⟨ + ,x, ⟩+ ≥ (x + ) || 2 ≤ O In the above equation = 1 for whereas 0 ≤ ≤ 1 for the − .Considering left hand side of the above Equation as Δ with Δ −
84It should be noted that = 1 for the standard dense network adversarial training i.e., on a network whereas 0 ≤ ≤ 1 in the RC-NAS guided sparse adversarial training on student sub-network i.e., on − .This means to show max ∈ [ ] ||
85+ ′ || ≤ ′ , we can choose the following O
Table 9 :
86RL v.s.network pruning v.s.adversarial training baselines
87, Huang et al. propose a portfolio of adversarially robust residual networks, dubbed RobustResNets A1-A4, spanning a broad spectrum of model FLOP budgets (i.e., 5G -40G FLOPs), based on a series of architecture search rules found by a large-scale architecture investigation on CIFAR-10 dataset.We further collect the adversarial training, network pruning and RL based methods test performance comparison results on a wide range of target task settings, including two cifar datasets, four clean/adversarial attack categories and two initial teacher network with 5G and 10G computation budgets.All non-RL based methods follow the same training and test procedures in the same task setting as compared RL method for fair comparison.We find that with RL dual-level training mechanism, the proposed RC-NAS is consistently better than other non-RL based baselines or the baseline without meta RL training, which aligns with the conclusion in Table6.
Table 10 :
88RC-NAS with different design component ablations under 10G budget.
참고문헌 15건
- Towards Evaluating the Robustness of Neural Networks 2022 IEEE Symposium on Security and Privacy (SP) · 2017 10.1109/sp.2017.49
- Adversarial Robustness vs. Model Compression, or Both? 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · 2019 10.1109/iccv.2019.00020
- When NAS Meets Robustness: In Search of Robust Architectures Against Adversarial Attacks 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) · 2020 10.1109/cvpr42600.2020.00071
- Do Wider Neural Networks Really Help Adversarial Robustness? arXiv (Cornell University) · Cornell University · 2020 10.48550/arxiv.2010.01279
- AdvRush: Searching for Adversarially Robust Neural Architectures 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · 2021 10.1109/iccv48922.2021.01210
- On Adversarial Robustness: A Neural Architecture Search perspective 2021 10.1109/iccvw54120.2021.00022
- Exploring Architectural Ingredients of Adversarially Robust Deep Neural Networks arXiv (Cornell University) · Cornell University · 2021 10.48550/arxiv.2110.03825
- Automated Discovery of Adaptive Attacks on Adversarial Defenses arXiv (Cornell University) · Cornell University · 2021 10.48550/arxiv.2102.11860
- Advances in neural information processing systems 7 Computers & Mathematics with Applications · Elsevier BV · 1996 10.1016/s0898-1221(96)90463-0
- Deep Reinforced Attention Regression for Partial Sketch Based Image Retrieval 2021 IEEE International Conference on Data Mining (ICDM) · 2021 10.1109/icdm51629.2021.00078
- Learning to summarize from human feedback arXiv (Cornell University) · Cornell University · 2020 10.48550/arxiv.2009.01325
- Practical Evaluation of Adversarial Robustness via Adaptive Auto Attack 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) · 2022 10.1109/cvpr52688.2022.01468
- Improving Adversarial Transferability via Neuron Attribution-based Attacks 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) · 2022 10.1109/cvpr52688.2022.01457
- Decision-Based Query Efficient Adversarial Attack via Adaptive Boundary Learning IEEE Transactions on Dependable and Secure Computing · IEEE Computer Society · 2023 10.1109/tdsc.2023.3289298
- Reinforced Compressive Neural Architecture Search for Versatile Adversarial Robustness arXiv (Cornell University) · Cornell University · 2024 10.48550/arxiv.2406.06792