Neural Network-Based Approach for Adaptive Density Control and Reliability in Wireless Sensor Networks