Classifying Sequences of Extreme Length with Constant Memory Applied to Malware Detection
About
Recent works within machine learning have been tackling inputs of ever-increasing size, with cybersecurity presenting sequence classification problems of particularly extreme lengths. In the case of Windows executable malware detection, inputs may exceed $100$ MB, which corresponds to a time series with $T=100,000,000$ steps. To date, the closest approach to handling such a task is MalConv, a convolutional neural network capable of processing up to $T=2,000,000$ steps. The $\mathcal{O}(T)$ memory of CNNs has prevented further application of CNNs to malware. In this work, we develop a new approach to temporal max pooling that makes the required memory invariant to the sequence length $T$. This makes MalConv $116\times$ more memory efficient, and up to $25.8\times$ faster to train on its original dataset, while removing the input length restrictions to MalConv. We re-invest these gains into improving the MalConv architecture by developing a new Global Channel Gating design, giving us an attention mechanism capable of learning feature interactions across 100 million time steps in an efficient manner, a capability lacked by the original MalConv CNN. Our implementation can be found at https://github.com/NeuromorphicComputationResearchProgram/MalConv2
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Malware Detection | Windows PE Files D3 (test) | TPR@0.1%3.6 | 15 | |
| Malware Detection | macOS Malware Dataset (fat) | TPR @ 1% FPR81.77 | 10 | |
| Malware Detection | macOS Malware Dataset multi-arch | TPR @ 1% FPR89.06 | 10 | |
| Malware Detection | macOS Malware Dataset x86-64 | TPR @ 1% FPR82.04 | 10 | |
| Malware Detection | macOS Malware Dataset (arm64) | TPR @ 1% FPR79.81 | 10 | |
| Malware Detection | Windows PE Files D2 (test) | TPR@0.1%6.6 | 10 | |
| Malware Detection | fresh dataset fat | TPR at 1% FPR61.22 | 6 | |
| Malware Detection | fresh dataset fat | F1-score (1% FPR)66.8 | 6 | |
| Malware Detection | fresh dataset x86-64 | TPR @ 1% FPR65.42 | 6 | |
| Malware Detection | fresh dataset arm64 | TPR @ 1% FPR51.1 | 6 |