Neural Network Pruning for Efficient Inference
2026 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesis
Abstract [en]
Neural network models used for computer vision have achieved remarkable predictive performance in recent years, but these improvements have often come at the cost of increased computational complexity and inference latency. This creates challenges when deploying models on resource-constrained hardware, where efficient inference is critical. Neural network pruning is a model compression technique that aims to reduce computational requirements by removing parameters or structural components from trained networks while preserving predictive performance. This thesis investigates the effects of neural network pruning on predictive performance and inference latency for object detection models. A modular pruning framework was developed in Python using PyTorch and evaluated on the YOLOv8m and RT-DETR object detection architectures using the VisDrone dataset. The framework supports unstructured pruning, structured pruning, and N:M sparsity pruning together with multiple importance criteria, including magnitude-based pruning, first-order Taylor pruning, and activation-based pruning. A series of pruning experiments were conducted across multiple pruning ratios. For each configuration, models were pruned, fine-tuned, and evaluated using mAP50:95. Inference latency was measured to assess the practical deployment benefits of different pruning strategies. The results show that predictive performance generally decreases as pruning ratios increase, although substantial parameter reductions can often be achieved before severe degradation occurs. For both YOLOv8m and RT-DETR, unstructured pruning preserved predictive performance more effectively than structured pruning at comparable pruning levels. Magnitude-based pruning consistently matched or outperformed the more computationally expensive first-order Taylor criterion across most experiments. N:M sparsity pruning retained much of the predictive performance achieved by unstructured pruning while enforcing hardware-oriented sparsity patterns. The latency experiments revealed a clear distinction between sparsity-based and structure-based pruning approaches. Unstructured pruning and N:M sparsity produced only modest reductions in inference latency despite achieving substantial parameter sparsity. In contrast, structured pruning substantially reduced inference latency by physically removing channels and filters from the network architecture. These findings suggest that parameter sparsity alone is insufficient to guarantee practical runtime acceleration on conventional hardware. Overall, the results demonstrate that pruning remains an effective approach for improving deployment efficiency in object detection systems, while highlighting the importance of selecting pruning strategies according to deployment objectives and hardware constraints.
Abstract [sv]
Moderna neurala nätverk för datorseende uppnår hög prediktiv prestanda men kräver samtidigt betydande beräkningsresurser. Detta kan försvåra användning på resursbegränsad hårdvara där hög inferenshastighet och effektiv resursanvändning är viktiga krav. Modellbeskärning är en modellkomprimeringsteknik som syftar till att minska modellers komplexitet genom att avlägsna parametrar eller strukturella komponenter samtidigt som prestandan i största möjliga utsträckning bevaras. I denna studie undersöks hur olika metoder för modellbeskärning påverkar prediktiv prestanda och inferenshastighet för objektdetektionsmodeller. Ett modulärt ramverk för modellbeskärning utvecklades i Python med hjälp av PyTorch och utvärderades på objektdetektionsmodellerna YOLOv8m och RT-DETR med VisDrone-datasetet. Ramverket stödjer ostrukturerad beskärning, strukturerad beskärning och N:M-beskärning samt flera olika beskärningskriterier. Resultaten visar att den prediktiva prestandan generellt minskar när beskärningsgraden ökar, men att betydande parameterreduktioner kan uppnås innan större prestandaförluster uppstår. Ostrukturerad beskärning bevarade i regel prestandan bättre än strukturerad beskärning, medan strukturerad beskärning gav de största förbättringarna i inferenshastighet. Magnitudbaserad beskärning uppvisade genomgående lika god eller bättre prestanda än mer beräkningskrävande gradientbaserade metoder. Närning bevarade en stor del av modellernas prestanda men gav endast begränsade förbättringar i inferenshastighet på den utvärderade hårdvaran. Sammanfattningsvis visar studien att modellbeskärning är en effektiv metod för att förbättra implementeringseffektiviteten hos objektdetektionssystem. Resultaten belyser samtidigt vikten av att välja beskärningsmetod utifrån både prestandakrav och tillgänglig hårdvara.
Place, publisher, year, edition, pages
2026.
Keywords [en]
Objektdetektion, datorseende, YOLOv8m, RT-DETR, VisDrone, modellbeskärning, neurala nätverk, maskininlärning
Keywords [sv]
Object detection, neural networks, deep learning, pruning, YOLOv8m, RT-DETR, computer vision, VisDrone
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:liu:diva-229018ISRN: LiU-ITN-TEK-A--26/035--SEOAI: oai:DiVA.org:liu-229018DiVA, id: diva2:2114775
External cooperation
SAAB Linköping
Supervisors
Examiners
2026-11-032026-11-032026-11-03Bibliographically approved