Computational intelligence techniques have emerged as a promising approach for diagnosing various medical conditions, including memory impairment. Increased abuse of psychoactive drugs poses a global public health burden, as repeated exposure to these substances can cause neurodegeneration, premature aging, and negatively affect memory impairment. Many studies in the literature relied on statistical studies, but they remained inaccurate. Some studies relied on physical data because the time factor was not considered, until Artificial Intelligence (AI) techniques came along that proved their worth in this diagnosis. The variable deep neural network method was used to adapt to the intermediate results and re-process the intermediate in case the result is undesirable. Computational intelligence was used in this study to classify a brain image from MRI or CT scans and to show the effectiveness of the dose ratio on health with treatment time, and to diagnose memory impairment in users of psychoactive substances. Understanding the neurotoxic profiles of psychoactive substances and the underlying pathways is hypothesized to be of great importance in improving the risk assessment and treatment of substance use disorders. The results proved the worth of the proposed method in terms of the accuracy of recognition rate as well as the possibility of diagnosis. It can be concluded that the diagnostic efficiency is increased by increasing the number of hidden layers in the neural network and controlling the weights and variables that control the deep learning algorithm. Thus, we conclude that good classification in this field may save human life or early detection of memory impairment.