Advanced machine learning has managed to detect IoT botnets. However, conflicts arise due to complex models and limited device resources. Our research aim is on a quantized intrusion detection system (QUIDS), an edge-based botnet detection for IoT device pairing. Using knearest neighbor (KNN) within QUIDS, we incorporate quantization, random sampling (RS), and feature selection (FS). Initially, we simulated a botnet attack, devised countermeasures via a sequence diagram, and then utilized a Kaggle botnet attack dataset. Our novel approach includes RS, FS, and 16-bit quantization, optimizing each step empirically. The test results show that employing a mean decrease in impurity (MDI) by FS reduces features from 115 to 30. Despite a slight accuracy drop in KNN due to RS, FS, and quantization sustain performance. Testing our model revealed 1200 RS samples as optimal, maintaining performance while reducing features. Quantization to 16-bit doesn’t alter feature value distribution. Implementing QUIDS increased the compression ratio (CR) to 175×, surpassing RS+FS threefold and RS by 13 times. This novel method emerges as the most efficient in CR.