Traditional on-chip filters are usually devoid of algorithmic utilization and span several hundred micrometers or greater in length, thereby constraining the compactness of the device. This study presents a design of an ultra-compact narrow-band band-stop filter with a high extinction ratio and low loss, achieved through the proposed improved adjoint method, which has solved the problem that the adjoint method fails to fully binarize the pixel points at the binarization stage. The demonstrated filter has a footprint of merely 9.6 × 7.2 μm2 with effective suppression at the 1550 nm wavelength. Within the 1530–1570 nm operating band, the extinction ratio for the 1550 nm wavelength is 51.2 dB, the pass-band insertion loss is only 0.65 dB, and the full width at half maximum is 0.16 nm. The excellent performance and ultra-compact size of the device make it highly advantageous and widely applicable in high-density photonic integrated circuits.