Original title:
Automatická kvantizace neuronových sítí
Translated title:
Automatic Quantization of Neural Networks
Authors:
Šafář, Miroslav ; Vašíček, Zdeněk (referee) ; Mrázek, Vojtěch (advisor) Document type: Bachelor's theses
Year:
2023
Language:
cze Publisher:
Vysoké učení technické v Brně. Fakulta informačních technologií Abstract:
[cze][eng]
Kvantizace hlubokých neuronových sítí je častou technikou optimalizace jejich paměťové a energetické náročnosti, aby mohly být nasazeny na zařízení s omezenými zdroji. Kvantizace se smíšenou přesností umožňuje ještě lepší paměťové a energetické úspory. Volba kvantizačních úrovní jednotlivých vrstev však vyžaduje odborné znalosti a hlubokou analýzu sítě, což je časově velmi náročná činnost. V této bakalářské práci se věnuji návrhu systému pro automatické určování kvantizační úrovně jednotlivých vrstev vstupní neuronové sítě. Využívám k tomu evoluční algoritmus NSGA-II a quantization-aware učení k doladění parametrů kvantizované sítě. S navrženým systémem jsem provedl experimenty s neuronovou sítí MobileNet a podmnožinou datové sady ImageNet. Navržený systém nalezl řešení, které téměř desetkrát zmenšuje velikost modelu při zachování jeho Top-1 klasifikační přesnosti, což v tomto případě překonalo uniformní kvantizaci téměř o 100 %. Tyto úspory lze využít ke snížení výrobních nákladů pamětí do hardwarových akcelerátorů nebo k nasazení hlubokých neuronových sítí na ještě menší zařízení.
Quantization of deep neural networks is a common way to optimize the networks for deployment on energy and memory-constrained devices while maintaining an acceptable accuracy loss. Mixed-precision quantization for weights and activations allows even better memory and energy savings. But selecting the precision for each layer needs expert knowledge and a deep network analysis. In this work, we address this problem and we present a system for automated mixed-precision quantization of neural networks. We utilize the multi-objective evolutionary algorithm NSGA-II and quantization-aware training for fine-tuning the quantization configurations. We conducted experiments with a subset of the ImageNet dataset and MobileNet network. We achieved accuracies comparable to floating-point models while making the memory footprint of the model about ten times smaller. The proposed approach outperforms a widely-used uniform quantization by almost 100 %. These size savings result in the costs of memories in the hardware accelerator savings. Therefore the proposed approach allows deploying deep neural networks to even smaller devices.
Keywords:
automated design; automated quantization; batch normalization quantization; evolutionary algorithm; mixed-precision quantization; neural networks; per-channel quantization; quantization; tensorflow; automatická kvantizace; automatický návrh neuronových sítí; evoluční algoritmy; kvantizace; kvantizace batch normalizace; kvantizace se smíšenou přesností; neuronové sítě; per-channel kvantizace; tensorflow
Institution: Brno University of Technology
(web)
Document availability information: Fulltext is available in the Brno University of Technology Digital Library. Original record: http://hdl.handle.net/11012/210486