Lung cancer is one of the prevalence diseases in the world which cause many deaths. Detecting early stages of lung cancer is so necessary. So, modeling and simulating some intelligent medical systems is an essential which can help specialist to accurately determine and diagnose the disease. So this paper contributes a new lung cancer detection model in CT images which use machine learning methods. There are three steps in this model: noise reduction (pre-processing), segmentation (middle-processing) and optimize segmentation for detect exact are of nodules. This article use some filters for noise reduction and then use Independent Recurrent Neural Networks (IndRNN) as deep learning methods for segmentation which optimize and tune by Genetic Algorithm. The results represented that the proposed method can detect exact area of nodules in CT images.