This paper presents the application of deep convolutional and transformer models for automated classification of chest X-ray images aimed at lung cancer detection. A cascaded system is proposed, where the first stage separates healthy from pathological images, and the second stage further divides pathological cases into oncological and non-oncological. The models were fine-tuned on a dataset of 20,000 images of various origins, using augmentation and class balancing techniques. The results show high sensitivity in detecting diseased cases and reliable differentiation of oncological changes, indicating the potential of the system as an assistive tool in radiological diagnostics.