{"notes":[{"id":"classic-cnns/nasnet","category":"classic-cnns","legacyPath":"classic-cnns/1707-nasnet","legacySlug":"1707-nasnet","legacyPaths":[],"title":"NASNet","subtitle":"Searching for Network Architectures","author":"Z. Yuan","paperDate":"2017-07-21","publishedOn":"2024-06-26","paperTitle":"Learning Transferable Architectures for Scalable Image Recognition","paperUrl":"https://arxiv.org/abs/1707.07012","bibliography":{"title":"Learning Transferable Architectures for Scalable Image Recognition","authors":["Barret Zoph","Vijay Vasudevan","Jonathon Shlens","Quoc V. Le"],"url":"https://arxiv.org/abs/1707.07012","pdfUrl":"https://arxiv.org/pdf/1707.07012","codeUrl":null,"preprint":{"id":"1707.07012","submittedOn":"2017-07-21","url":"https://arxiv.org/abs/1707.07012"},"publication":{"venue":"CVPR","year":2018,"kind":"conference","url":"https://doi.org/10.1109/cvpr.2018.00907"},"citation":"@misc{classiccnnsnasnet2017,\n  title = {{Learning Transferable Architectures for Scalable Image Recognition}},\n  author = {Barret Zoph and Vijay Vasudevan and Jonathon Shlens and Quoc V. Le},\n  year = {2017},\n  eprint = {1707.07012},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1707.07012}\n}\n","citationPath":"/content/papers/citations/classic-cnns/nasnet.f6a561f13f90.bib"},"thumbnail":{"src":"/content/papers/assets/b2d2e9edd0aa83df25d43fcba9a942774de024dfa090f0771473452abb1ff417.jpg","width":930,"height":966},"locale":"en","path":"/content/papers/en/classic-cnns/nasnet.2e5b9ff03912.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"transferable-architectures","text":"Transferable Architectures","depth":3},{"id":"fundamental-structures","text":"Fundamental Structures","depth":3},{"id":"the-search-process","text":"The Search Process","depth":3},{"id":"droppath-module","text":"DropPath Module","depth":3},{"id":"search-experiment-results","text":"Search Experiment Results","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"results-on-cifar-10","text":"Results on CIFAR-10","depth":3},{"id":"transferring-architectures-to-imagenet","text":"Transferring Architectures to ImageNet","depth":3},{"id":"evaluation-on-mobile-devices","text":"Evaluation on Mobile Devices","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"classic-cnns/efficientnet","relation":"next","topic":"Architecture search and efficient scaling"}]},{"id":"classic-cnns/efficientnet","category":"classic-cnns","legacyPath":"classic-cnns/1905-efficientnet","legacySlug":"1905-efficientnet","legacyPaths":[],"title":"EfficientNet","subtitle":"Compound Scaling","author":"Z. Yuan","paperDate":"2019-05-28","publishedOn":"2024-07-04","paperTitle":"EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks","paperUrl":"https://arxiv.org/abs/1905.11946","bibliography":{"title":"EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks","authors":["Mingxing Tan","Quoc V. Le"],"url":"https://arxiv.org/abs/1905.11946","pdfUrl":"https://arxiv.org/pdf/1905.11946","codeUrl":null,"preprint":{"id":"1905.11946","submittedOn":"2019-05-28","url":"https://arxiv.org/abs/1905.11946"},"publication":{"venue":"ICML","year":2019,"kind":"conference","url":"https://arxiv.org/abs/1905.11946"},"citation":"@misc{classiccnnsefficientnet2019,\n  title = {{EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks}},\n  author = {Mingxing Tan and Quoc V. Le},\n  year = {2019},\n  eprint = {1905.11946},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1905.11946}\n}\n","citationPath":"/content/papers/citations/classic-cnns/efficientnet.ad7d6744b5d4.bib"},"thumbnail":{"src":"/content/papers/assets/f8202301fddceafac70e33ea34ffeb6b2255d2617c880baee08c51ce4c8a4c93.jpg","width":1596,"height":674},"locale":"en","path":"/content/papers/en/classic-cnns/efficientnet.0edcea10a122.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"two-key-observations","text":"Two Key Observations","depth":3},{"id":"compound-scaling","text":"Compound Scaling","depth":3},{"id":"base-model-architecture","text":"Base Model Architecture","depth":3},{"id":"model-scaling-architecture","text":"Model Scaling Architecture","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"importance-of-compound-scaling","text":"Importance of Compound Scaling","depth":3},{"id":"results-on-imagenet","text":"Results on ImageNet","depth":3},{"id":"inference-speed","text":"Inference Speed","depth":3},{"id":"parameter-accuracy-curve","text":"Parameter-Accuracy Curve","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{"compound-scaling-1":"compound-scaling"},"guide":null,"relatedReading":[{"id":"classic-cnns/nasnet","relation":"background","topic":"Architecture search and efficient scaling"},{"id":"classic-cnns/efficientnet-v2","relation":"next","topic":"Architecture search and efficient scaling"}]}],"text":"When you have a hammer, everything looks like a nail.\n\n＊\n\nSince the rise of deep learning neural networks, constructing an effective network architecture has become a significant challenge.\n\nTo tackle this, researchers have proposed various methods for automatically searching for network architectures, known as Neural Architecture Search (NAS).\n\nAmong the leaders in this field is the Google team, which you can find employing NAS techniques in various applications.\n\n\n> [!TIP]\n> \n> Neural Architecture Search (NAS) is an automated technique designed to create and optimize deep learning model architectures. It aims to overcome the challenges and limitations of manually designing neural network architectures, especially when dealing with complex data or specific application scenarios. NAS searches for better-performing structures within a predefined search space and compute budget. Designing that space still requires expertise, the search can be expensive, and a global optimum is not guaranteed.\n\n\n## Defining the Problem\n\nSince the popularity of AlexNet, numerous network architectures have flourished between AlexNet and this paper’s publication in 2017.\n\nHowever, these architectures are often based on experience and intuition rather than rigorous theoretical foundations.\n\nThis leads to several issues, such as:\n\n- Uncertainty about which architectures are the best.\n- Designing architectures requires extensive expertise and experience.\n- The design process is often time-consuming and resource-intensive.\n\nWe can leave the question of theoretical foundations aside here. This paper proposes a way to search for network architectures automatically, which may address *some* of the problems above.\n\n## Solving the Problem\n\n### Transferable Architectures\n\n![NASNet paper Figure 2: Normal and Reduction Cell stacks for CIFAR-10 and ImageNet](/content/papers/assets/b2d2e9edd0aa83df25d43fcba9a942774de024dfa090f0771473452abb1ff417.jpg)\n\n*Paper Figure 2: the CIFAR-10 network has two Reduction Cells. The ImageNet network begins with a stride-2 convolution and two Reduction Cells; two further Reduction Cells separate groups of Normal Cells. The repetition count $N$ can be adjusted for the task and compute budget.*\n\nAt the time, ImageNet accuracy was an important benchmark for image classification research.\n\nHowever, ImageNet is too large, and directly searching for suitable architectures on ImageNet would consume considerable resources.\n\nThe authors therefore search for **cell structures** on CIFAR-10, then adjust the repeat count $N$ and filter count to reuse those structures on ImageNet. The CIFAR-10 weights are not transferred.\n\n### Fundamental Structures\n\nThe authors propose two fundamental structures for constructing network architectures:\n\n1. **Normal Cell**: This structure maintains the dimensions of the input feature map (i.e., height and width). Information retention requires a separate assessment of the cell’s operations.\n2. **Reduction Cell**: This halves the feature map's height and width by using stride 2 in the initial operations on its inputs.\n\nAlthough Reduction and Normal Cells can share the same architecture, learning two separate architectures is beneficial based on experience.\n\nAdditionally, each time the spatial dimensions are reduced, the authors double the channel count to increase representational capacity; this does not exactly recover information lost through downsampling.\n\nRepeated modules in Inception and ResNet inspired the design. The overall cell placement is chosen by hand; the controller searches inside the Normal and Reduction Cells. Their repetition count and initial filter count remain adjustable.\n\n### The Search Process\n\n![NASNet paper Figure 3: five controller RNN choices form one block of a convolutional cell](/content/papers/assets/3fe839815472ae30d8b169af6724235e3812729aff651e0a767b6a0b07e0dc59.jpg)\n\n*Paper Figure 3: gray boxes choose two input states, yellow boxes choose operations, and the green box combines the results. The example on the right is one block; a complete cell repeats this process $B$ times.*\n\nIn the search space, each convolutional cell receives two initial hidden states, $h_i$ and $h_{i-1}$, derived from the outputs of the previous two lower-level cells or the input image.\n\nA controller RNN proposes candidate cells. During search, each candidate network trains for a fixed **20 epochs** on CIFAR-10; held-out validation accuracy becomes the reward for a PPO update. After search, the top **250** architectures receive fuller training to select the final cell. The “hidden states” below are feature tensors inside a candidate cell, distinct from the controller RNN's own hidden state.\n\nThe paper also compares random search in the same space. It performs slightly worse than reinforcement learning, but the gap is modest. The main contribution is the transferable, scalable cell search space; the results should not all be attributed to PPO.\n\n- **The Prediction Process of the RNN**\n\n  The RNN recursively predicts the structure of the convolutional cells following these steps:\n\n  1. **Select Hidden State**: Choose a hidden state from $h_i$, $h_{i-1}$, or the set of hidden states generated by previous blocks.\n  2. **Select Second Hidden State**: Choose a second hidden state from the same options as Step 1.\n  3. **Select Operation**: Select an operation to apply to the hidden state chosen in Step 1.\n  4. **Select Second Operation**: Select an operation to apply to the hidden state chosen in Step 2.\n  5. **Combine Outputs**: Choose a method to combine the outputs of Steps 3 and 4 to produce a new hidden state.\n\n- **Repeating Prediction Steps and Blocks**\n\n  The RNN repeats the above five prediction steps B times, corresponding to B blocks in the convolutional cell.\n\n  These experiments use $B=5$; the authors did not exhaustively search other values.\n\n  Each round of prediction adds the newly created hidden state to the existing set of hidden states as potential inputs for subsequent blocks.\n\n- **Operation Selection**\n\n  The RNN selects operations from the following list, based on their popularity in the CNN literature:\n\n  - Identity\n  - 1x3 then 3x1 convolution\n  - 1x7 then 7x1 convolution\n  - 3x3 dilated convolution\n  - 3x3 average pooling\n  - 3x3 max pooling\n  - 5x5 max pooling\n  - 7x7 max pooling\n  - 1x1 convolution\n  - 3x3 convolution\n  - 3x3 depthwise separable convolution\n  - 5x5 depthwise separable convolution\n  - 7x7 depthwise separable convolution\n\n- **Combination Methods**\n\n  In Step 5, the RNN chooses elementwise addition or channel concatenation to produce a new state. Later blocks may read that state. At the end of a NASNet-A cell, states unused by later blocks are concatenated along channels to form the cell output.\n\n### DropPath Module\n\nIn previous literature, DropPath technology was used to prevent overfitting and improve model generalization.\n\n- [**Fractalnet: Ultra-deep neural networks without residuals**](https://arxiv.org/abs/1605.07648)\n\nWhen training NASNet, the authors tried fixed-probability DropPath and found that it worked poorly.\n\nThey instead used **ScheduledDropPath**, increasing the probability of dropping paths inside a cell linearly during training. The paper reports improvements on both CIFAR-10 and ImageNet.\n\n### Search Experiment Results\n\n![NASNet paper Figure 4: searched NASNet-A Normal and Reduction Cells](/content/papers/assets/d95e59811660891ea94ae4dc02156603278c238b3fc6f04a8e6ab51f9f3f68e1.jpg)\n\n*Paper Figure 4: each cell has five blocks. Yellow nodes are primitive operations, green nodes combine two branches, and the pink top node concatenates states not reused by later blocks. Dashed and solid edges indicate inputs from $h_{i-1}$ and $h_i$; a cell has more than two fixed paths.*\n\nThe CIFAR-10 search produced the two NASNet-A cells above. Repeating them according to Figure 2 gives the full classifier. The search used roughly **500 GPUs for four days**; that is search cost, not inference cost.\n\nWhile the diagram may seem complex at first glance, it is quite understandable:\n\n- Each green node combines two inputs after the yellow operations. Later blocks can reuse states produced by earlier blocks; the pink node concatenates the final cell output.\n- Insert a `Reduction Cell` where spatial resolution must shrink, and repeat `Normal Cell` elsewhere. These are different cells in the network, not alternative data paths inside a single cell.\n\n## Discussion\n\n### Results on CIFAR-10\n\n![NASNet paper Table 1: CIFAR-10 model parameters and test error rates](/content/papers/assets/0fab51e8d8111b1473914a27cb6a7510d5bbd0721ab178b48ba9ecb69aeb4649.jpg)\n\n*Paper Table 1: lower error is better. NASNet-A (7 @ 2304) with Cutout reports 2.40% as the mean of five runs.*\n\nAs seen in the table, the large NASNet-A model with cutout data augmentation achieved a state-of-the-art error rate of 2.40% (average of five runs), slightly better than the previous best of 2.56%.\n\nThe authors noted that their best single-run error rate reached 2.19%.\n\n### Transferring Architectures to ImageNet\n\n![NASNet paper Table 2: ImageNet input sizes, parameters, multiply-adds, and top-1/top-5 accuracy](/content/papers/assets/c15e1581e6b20a2311a923b5c8bd4db032be77430691d7a328790e9e0ffabdf1.jpg)\n\n*Paper Table 2: input resolutions differ. NASNet-A (6 @ 4032) at 331×331 has 88.9M parameters, 23.8B multiply-adds, and 82.7% top-1 accuracy. SENet also reaches 82.7%, with 145.8M parameters and 42.3B multiply-adds in this table.*\n\nOnly the network structure was transferred here; the model was retrained.\n\nSeveral NASNet-A configurations show higher or similar accuracy with fewer parameters and multiply-adds than their listed comparators. The input resolutions differ, so these rows are not a controlled same-input ablation.\n\nThe largest NASNet-A achieves **82.7%** single-model ImageNet top-1 accuracy, **1.2 percentage points** above DPN-131 (**81.5%**), which the paper calls the previous published best. SENet also reaches **82.7%** in the table; the authors describe it as a contemporaneous unpublished result, so NASNet is not alone at the highest listed accuracy.\n\n### Evaluation on Mobile Devices\n\n![NASNet paper Table 3: ImageNet models near 500 million multiply-adds on 224×224 inputs](/content/papers/assets/bab2dc8a2c7691eef3e2b0c9198e192e24af67c15add24180a3bb9fc555a2c8e.jpg)\n\n*Paper Table 3: NASNet-A (4 @ 1056) has 5.3M parameters, 564M multiply-adds, and 74.0/91.6% top-1/top-5 accuracy. These are classification and operation counts, not measured device latency.*\n\nWith 224×224 ImageNet inputs, MobileNet-224 reaches **70.6%** top-1 at **569M** multiply-adds, and ShuffleNet (2x) reaches **70.9%** at **524M**.\n\nNASNet-A (4 @ 1056) stays near this compute range at **564M** multiply-adds and reaches **74.0%** top-1, **3.1 percentage points** above ShuffleNet. Its **5.3M** parameters exceed MobileNet's **4.2M**, so it is not smaller on every resource measure.\n\n\n> [!TIP]\n> \n> Simply using computational complexity to evaluate a model does not necessarily reflect its actual performance. Real-world inference tests are needed to confirm effectiveness.\n> \n> NASNet has many additions and concatenations across branches. These operations can make branches wait on one another and may lower efficiency. That is an engineering concern from the architecture, not latency measured in Table 3.\n\n\n## Conclusion\n\nThe paper studies a way to learn an architecture on a dataset of interest: search for repeatable cells on CIFAR-10, transfer their structure to ImageNet, and train the weights again.\n\nBy separating a cell's internal structure from network depth, the authors can search for Normal and Reduction Cells once, then adjust $N$ and the filter count to build models at different compute budgets. The search itself remains expensive.\n\nResearchers without enough compute to run the search themselves can reuse the published cell structures. They still need to train and measure the resulting model for their own task.\n\n\n> [!NOTE]\n> \n> What I wonder is: with enough resources, would searching directly on ImageNet find a better architecture?\n> \n> Perhaps when the Google team takes an interest in that experiment, we'll get an answer. The experiments in this paper do not answer it directly.\n","imageSizes":{"/content/papers/assets/b2d2e9edd0aa83df25d43fcba9a942774de024dfa090f0771473452abb1ff417.jpg":{"width":930,"height":966},"/content/papers/assets/3fe839815472ae30d8b169af6724235e3812729aff651e0a767b6a0b07e0dc59.jpg":{"width":1940,"height":404},"/content/papers/assets/d95e59811660891ea94ae4dc02156603278c238b3fc6f04a8e6ab51f9f3f68e1.jpg":{"width":1304,"height":780},"/content/papers/assets/0fab51e8d8111b1473914a27cb6a7510d5bbd0721ab178b48ba9ecb69aeb4649.jpg":{"width":1224,"height":720},"/content/papers/assets/c15e1581e6b20a2311a923b5c8bd4db032be77430691d7a328790e9e0ffabdf1.jpg":{"width":1514,"height":556},"/content/papers/assets/bab2dc8a2c7691eef3e2b0c9198e192e24af67c15add24180a3bb9fc555a2c8e.jpg":{"width":1438,"height":370}}}
