One of the requirements of neutron detection in wide energy range is a detector with flat response. In this work, a compact neutron detector for energy range from 5-20 MeV has been introduced. The detector has two small spherical 3He proportional counters (PC) placed inside a cylindrical polyethylene moderator. Flat response (sensitivity) of the detector has been optimized according to the counters positions inside the moderator. Optimization carried out using MCNP4C Monte Carlo code and Artificial Neural Network (ANN). Results show that the flatness of the sensitivity response of the introduced detector has been increased compared to the conventional detectors.