Tuberculosis (TB) is still one of the most serious health issues today with a high fatality rate. While attempts are being made to make primary diagnosis more reliable and accessible in places with high tuberculosis rates, Chest X-rays has become a popular source. However, specialist radiologists are required for the screening process, which could be a challenge in developing countries. For early diagnosis of tuberculosis utilizing CXR images, a complete automatic system of tuberculosis detection can decrease the need for trained staff. Various deep learning and machine learning technologies have been introduced in recent years for examining digital chest radiographs for TB-related variances with the goal of reducing inter-class reader variability and reproducibility, as well as providing radiologic services in areas where radiologists are not available. Tuberculosis is sometimes misclassified as other conditions with similar radiographic patterns as a result of CXR images, resulting in inefficient therapy. The current approach, however, is limited to Computer-Aided Detection (CAD), which has only been evaluated with non-deep learning models. Deep neural networks open potentially new avenues for tuberculosis treatment. There are no peer-reviewed studies comparing the effectiveness of various deep learning systems in detecting TB anomalies, and none compare multiple deep learning systems with human readers. In this paper, the aim of the proposed method is to develop an efficient tuberculosis detection system based on stochastic learning with artificial neural network (ANN) model by random variations using Chest X-ray images. This approach can able to incorporate random functions into the network, either by assigning stochastic transfer functions to the network or by assigning stochastic weights to the network. This proposed method is to learn features from CXR images and optimize the parameters of an ANN model by randomly mixing the training dataset before each iteration, resulting in varied ordering of model parameter updates. Furthermore, in a neural network, model weights are frequently initialized at a random beginning point. By focusing on randomness functions with optimization, the proposed technique achieved great accuracy. The motivation of the proposed method is to detect abnormalities in CXR with the different levels of complexity of TB by strong or weak evidence with different deep geometric contexts such as shape, size, cavitation, and density. ANN's primary benefit is extracting hidden linear and non-linear relationships of high-dimensional and complex data. The proposed method was thoroughly tested with the Shenzhen and Montgomery datasets using metrics such as sensitivity, specificity, and accuracy, and it was discovered that the proposed method attained better accuracy when compared to state-of-the-art methods. The proposed method shows an improved efficiency with sensitivity of 96.12%, specificity of 98.01%, accuracy 98.45% and F-Score 95.88% respectively.