亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Table of Contents
Method
Alignment of training recipes
Optimization of Block Design
Optimization of macro-architectural elements
Deeper Downsampling Layers
Adjustment of micro-design
Network Architecture
Experiment
Image Classification
Home Technology peripherals AI 1.3ms takes 1.3ms! Tsinghua's latest open source mobile neural network architecture RepViT

1.3ms takes 1.3ms! Tsinghua's latest open source mobile neural network architecture RepViT

Mar 11, 2024 pm 12:07 PM
iphone Architecture Neural Networks Open source overflow

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

Paper address: https://arxiv.org/abs/2307.09283

Code address: https:/ /github.com/THU-MIG/RepViT

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

RepViT performs well in the mobile ViT architecture and shows significant advantages. Next, we explore the contributions of this study.

  1. It is mentioned in the article that lightweight ViTs generally perform better than lightweight CNNs on visual tasks, mainly due to their multi-head self-attention module (MSHA) allows the model to learn global representation. However, the architectural differences between lightweight ViTs and lightweight CNNs have not been fully studied.
  2. In this study, the authors gradually improve the mobile-friendliness of standard lightweight CNNs (especially MobileNetV3) by integrating effective architectural choices of lightweight ViTs. This makes Derived the birth of a new pure lightweight CNN family, namely RepViT. It is worth noting that although RepViT has a MetaFormer structure, it is entirely composed of convolutions.
  3. Experimental results It is shown that RepViT surpasses existing state-of-the-art lightweight ViTs and shows better performance and efficiency than existing state-of-the-art lightweight ViTs on various visual tasks, including ImageNet classification, Object detection and instance segmentation on COCO-2017, and semantic segmentation on ADE20k. In particular, on ImageNet, RepViT achieved the best performance on iPhone 12 With a latency of nearly 1ms and a Top-1 accuracy of over 80%, this is the first breakthrough for a lightweight model.

Okay, what everyone should be concerned about next is "How How can a model designed with such low latency but high accuracy come out?

Method

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

## again

ConvNeXt , the authors based on the ResNet50 architecture through rigorous theoretical and experimental analysis, finally designed a very excellent pure convolutional neural network architecture comparable to Swin-Transformer. Similarly, RepViT also mainly performs targeted transformations by gradually integrating the architectural design of lightweight ViTs into standard lightweight CNN, namely MobileNetV3-L ( Magic modification). In this process, the authors considered design elements at different levels of granularity and achieved the optimization goal through a series of steps.

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

Alignment of training recipes

In the paper, a new metric is introduced to measure latency on mobile devices and ensures that the training strategy is consistent with the currently popular lightweight Level ViTs remain consistent. The purpose of this initiative is to ensure the consistency of model training, which involves two key concepts of delay measurement and training strategy adjustment.

Latency Measurement Index

In order to more accurately measure the performance of the model on real mobile devices, the author chose to directly measure the actual delay of the model on the device. as a baseline measure. This metric differs from previous studies, which mainly optimize the model's inference speed through metrics such as FLOPs or model size, which do not always reflect the actual latency in mobile applications well.

Alignment of training strategy

Here, the training strategy of MobileNetV3-L is adjusted to align with other lightweight ViTs models. This includes using the AdamW optimizer [a must-have optimizer for ViTs models], 5 epochs of warm-up training, and 300 epochs of training using cosine annealing learning rate scheduling. Although this adjustment results in a slight decrease in model accuracy, fairness is guaranteed.

Optimization of Block Design

Next, the authors explored the optimal block design based on consistent training settings. Block design is an important component in CNN architecture, and optimizing block design can help improve the performance of the network.

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

Separate Token mixer and channel mixer

This is mainly for MobileNetV3-L The block structure was improved to separate token mixers and channel mixers. The original MobileNetV3 block structure consists of a 1x1 dilated convolution, followed by a depthwise convolution and a 1x1 projection layer, and then connects the input and output via residual connections. On this basis, RepViT advances the depth convolution so that the channel mixer and token mixer can be separated. To improve performance, structural reparameterization is also introduced to introduce multi-branch topology for deep filters during training. Finally, the authors succeeded in separating the token mixer and the channel mixer in the MobileNetV3 block and named such block the RepViT block.

Reduce the dilation ratio and increase the width

In the channel mixer, the original dilation ratio is 4, which means that the hidden dimension of the MLP block is four times the input dimension times, which consumes a large amount of computing resources and has a great impact on the inference time. To alleviate this problem, we can reduce the dilation ratio to 2, thereby reducing parameter redundancy and latency, bringing the latency of MobileNetV3-L down to 0.65ms. Subsequently, by increasing the width of the network, i.e. increasing the number of channels at each stage, the Top-1 accuracy increased to 73.5%, while the latency only increased to 0.89ms!

Optimization of macro-architectural elements

In this step, this article further optimizes the performance of MobileNetV3-L on mobile devices, mainly starting from the macro-architectural elements, including stem, downsampling layer, classifier as well as overall stage proportions. By optimizing these macro-architectural elements, the performance of the model can be significantly improved.

Shallow network using convolutional extractor

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViTPicture

ViTs typically use a "patchify" operation that splits the input image into non-overlapping patches as the stem. However, this approach has problems with training optimization and sensitivity to training recipes. Therefore, the authors adopted early convolution instead, an approach that has been adopted by many lightweight ViTs. In contrast, MobileNetV3-L uses a more complex stem for 4x downsampling. In this way, although the initial number of filters is increased to 24, the total latency is reduced to 0.86ms, while the top-1 accuracy increases to 73.9%.

Deeper Downsampling Layers

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

In ViTs, spatial downsampling is usually implemented through a separate patch merging layer. So here we can adopt a separate and deeper downsampling layer to increase the network depth and reduce the information loss due to resolution reduction. Specifically, the authors first used a 1x1 convolution to adjust the channel dimension, and then connected the input and output of two 1x1 convolutions through residuals to form a feedforward network. Additionally, they added a RepViT block in front to further deepen the downsampling layer, a step that improved the top-1 accuracy to 75.4% with a latency of 0.96ms.

Simpler classifier

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

In lightweight ViTs, the classifier is usually followed by a global average pooling layer consists of a linear layer. In contrast, MobileNetV3-L uses a more complex classifier. Because the final stage now has more channels, the authors replaced it with a simple classifier, a global average pooling layer and a linear layer. This step reduced the latency to 0.77ms while being top-1 accurate. The rate is 74.8%.

Overall stage proportion

The stage proportion represents the proportion of the number of blocks in different stages, thus indicating the distribution of calculations in each stage. The paper chooses a more optimal stage ratio of 1:1:7:1, and then increases the network depth to 2:2:14:2, thereby achieving a deeper layout. This step increases top-1 accuracy to 76.9% with a latency of 1.02 ms.

Adjustment of micro-design

Next, RepViT adjusts the lightweight CNN through layer-by-layer micro design, which includes selecting the appropriate convolution kernel size and optimizing squeeze-excitation (Squeeze- and-excitation, referred to as SE) layer location. Both methods significantly improve model performance.

Selection of convolution kernel size

It is well known that the performance and latency of CNNs are usually affected by the size of the convolution kernel. For example, to model long-range context dependencies like MHSA, ConvNeXt uses large convolutional kernels, resulting in significant performance improvements. However, large convolution kernels are not mobile-friendly due to its computational complexity and memory access cost. MobileNetV3-L mainly uses 3x3 convolutions, and 5x5 convolutions are used in some blocks. The authors replaced them with 3x3 convolutions, which resulted in latency being reduced to 1.00ms while maintaining a top-1 accuracy of 76.9%.

Position of SE layer

One advantage of self-attention modules over convolutions is the ability to adjust weights based on the input, which is called a data-driven property. As a channel attention module, the SE layer can make up for the limitations of convolution in the lack of data-driven properties, thereby leading to better performance. MobileNetV3-L adds SE layers in some blocks, mainly focusing on the last two stages. However, the lower-resolution stage gains smaller accuracy gains from the global average pooling operation provided by SE than the higher-resolution stage. The authors designed a strategy to use the SE layer in a cross-block manner at all stages to maximize the accuracy improvement with the smallest delay increment. This step improved the top-1 accuracy to 77.4% while delaying reduced to 0.87ms. [In fact, Baidu has already done experiments and comparisons on this point and reached this conclusion a long time ago. The SE layer is more effective when placed close to the deep layer]

Network Architecture

Finally, by integrating the above improvement strategies, we obtained the overall architecture of the model RepViT, which has multiple variants, such as RepViT-M1/ M2/M3. Likewise, the different variants are mainly distinguished by the number of channels and blocks per stage.

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

Experiment

Image Classification

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

##Detection and Segmentation

1.3ms耗時!清華最新開源移動端神經(jīng)網(wǎng)絡(luò)架構(gòu) RepViT

Summary

This paper re-examines the efficient design of lightweight CNNs by introducing the architectural choice of lightweight ViT. This led to the emergence of RepViT, a new family of lightweight CNNs designed for resource-constrained mobile devices. RepViT outperforms existing state-of-the-art lightweight ViTs and CNNs on various vision tasks, showing superior performance and latency. This highlights the potential of purely lightweight CNNs for mobile devices.

The above is the detailed content of 1.3ms takes 1.3ms! Tsinghua's latest open source mobile neural network architecture RepViT. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1488
72
How to create a contact group on iPhone How to create a contact group on iPhone Jul 13, 2025 am 01:17 AM

iPhone does not support creating contact groups directly in the address book application, but similar functions can be achieved through the following methods: 1. Use the "Group" function in the address book application, click "Edit" > "Add Group" to create a custom group; 2. Add each contact to the corresponding group by editing it; 3. If you need to send a group message, you can create a new multi-person conversation in the information application; 4. Use iCloud or Gmail to synchronize tagged groups to facilitate the management of a large number of contacts on the computer. These methods are used in conjunction with efficient management of contact groups.

How to check if an iPhone is unlocked How to check if an iPhone is unlocked Jul 15, 2025 am 01:17 AM

TocheckifaniPhoneisunlocked,1)gotoSettings>Cellular>CellularDataOptionsandlookforlabelslike“Unlocked”or“NoSIMrestrictions,”2)insertadifferentcarrier’sactiveSIMcardandseeifthephoneacceptsit,3)usetheIMEInumberononlinetoolslikeIMEI.infotocheckunlo

How to check iPhone trade-in value How to check iPhone trade-in value Jul 13, 2025 am 01:13 AM

Determining the depreciation value of iPhone requires multiple factors and comparing different platforms. 2. The first choice is Apple's official replacement plan, which has a simple and transparent process, but the final valuation must be based on the actual condition of the equipment. 3. Third-party websites such as Gazelle, Swappa, etc. may provide higher quotations, but you need to pay attention to describing the real situation and avoiding the charging trap. 4. The core factors affecting value include model and storage capacity, equipment status, operator lock status, etc. Small problems may also affect the quotation. 5. If you pursue higher returns, you can choose to sell privately, but you need to weigh the time cost and transaction risks.

How to create a Personal Voice on iPhone How to create a Personal Voice on iPhone Jul 11, 2025 am 02:19 AM

To create PersonalVoice in iOS17, you first need to enable the feature in the settings and record a sound model for about five minutes. The specific steps are as follows: 1. Open "Settings" > "Assistance Functions" > "Narration", click "PersonalVoice" and select "Create PersonalVoice"; 2. Read the text provided by the system in a quiet environment to keep the speech speed stable; 3. After creation, you can use your personalized voice to read messages, notifications, etc. in "Narration", or switch back to the default voice; 4. Currently, only English and some languages ??are supported, and Chinese is not supported at the moment; 5. Pay attention to environmental noise, intonation consistency and storage space when recording, and re-record unsatisfactory content. Voice mode

How to transfer contacts from one iPhone to another How to transfer contacts from one iPhone to another Jul 12, 2025 am 02:36 AM

Migrating contacts can be accomplished in three ways when replacing a new iPhone: First, using iCloud synchronization is the most worry-free, ensuring that the old phone has turned on the iCloud address book backup, and the new phone logs into the same account and enables synchronization; Second, using AirDrop is suitable for a small number of contacts to transmit. After setting up AirDrop visibility on both phones, sending and receiving them through the share button; Third, with the help of computer relay, both Mac or Windows, synchronizing contacts through Finder or iTunes and replacing or merging data. Select the method that suits you and pay attention to your account and permission settings to easily complete the migration.

How to clear RAM on iPhone How to clear RAM on iPhone Jul 12, 2025 am 02:30 AM

The RAM of iPhone cannot be cleaned manually, but the following methods can be used to free memory to improve smoothness: 1. Close the background application: Double-click the Home button or slide from the bottom to pause and close the card; 2. Restart the phone regularly: Refresh the system status once a week; 3. Reduce background refresh: Enter Settings → General → Backend App Refresh to limit the number of applications; 4. Avoid running multiple high-resource applications at the same time, and use them in stages to reduce memory pressure. These operations can effectively alleviate the lag caused by the tight memory of iPhone.

How to buy stablecoins for Apple phones? Where to buy stablecoins for Apple phones? How to buy stablecoins for Apple phones? Where to buy stablecoins for Apple phones? Jul 24, 2025 pm 09:18 PM

Purchase USDT and other stablecoins on Apple phones, you must download the compliant exchange app through the overseas Apple ID and complete the authentication and conduct transactions. The specific steps are as follows: 1. Use Apple ID in the non-mainland region to log in to the App Store; 2. Download recommended platforms such as OKX, Binance, Huobi (HTX), Gate.io or KuCoin; 3. Complete registration and identity authentication (KYC); 4. Enter the "Buy Coin" or "C2C/P2P Transaction" page to select USDT; 5. Filter merchants according to the payment method and place orders; 6. Pay through Alipay, WeChat or bank card and confirm transactions; 7. Wait for the merchant to put the coins into the account, and the entire process is completed.

How to use the Files app on iPhone How to use the Files app on iPhone Jul 19, 2025 am 01:48 AM

Using the iPhone's file app for file management is very simple and suitable for daily tasks. 1. Organize files and folders: Folders can be created through the "New Folder" function, and supports renaming, moving or copying files. They can also be sorted by name, date, etc. 2. Access iCloud and other cloud services: You can connect to iCloudDrive, GoogleDrive, Dropbox, etc., manage the displayed services through "Browse>Location>Edit", and directly save files to cloud storage. 3. Open and share files from other applications: Select the application to open the file through the share icon at the bottom, or share files through email, message or AirDrop. In short, although its functions are limited, its basic

See all articles