# Machine Learning in Recognition of Basic Pulmonary Pathologies
###### Abstract  
Nowadays, during the diagnosis process, the doctor is able to obtain access to much information describing the patient's condition using appropriate tools. However, there are always two sides to the coin. The doctor has certain limitations regarding the amount of data they can process at once. Information technology comes to the rescue, which with the help of computers is able to quickly and effectively separate important information from redundant information and support the doctor in making a diagnosis. In this work, a decision-making system was created to diagnose common lung pathologies in digital radiography images. Here, we consider four basic pulmonary diseases: pneumothorax, pneumonia, pulmonary consolidation, and lung lesions. Our objective is to develop a new automatic detection method of lung pathologies on chest X-ray radiographs using python programming language and its libraries. The approach uses solutions in the field of artificial intelligence, such as deep learning, convolutional neural network and segmentation to make a diagnosis that aims to help the radiologist at work. In the first sections, this work describes the fundamentals of the present form of diagnosis, a proposal to improve this process, the method of operation of the algorithms used, data acquisition, segmentation and processing methods. Then, the results of the operation of four different models and their implementation in a practical window program were presented. The best model, which detects pulmonary consolidation, achieves accuracy higher than 91%, which is a satisfactory result because they are not intended to replace radiologists but to improve their work. In the future, this type of program can be further developed by adding models that recognize other conditions. lesions) in digital radiography images based on chest X-ray radiography. The program uses a previously trained deep neural network model and a lung segmentation algorithm. Based on the uploaded photo, the algorithm will provide the probability of predicting the presence of each of the four mentioned pathologies. The application has a graphical user interface that allows radiologists to operate it intuitively [12; 13; 14]. Beneath, we shortly describe four basic pulmonary diseases considered in our approach. Pneumothorax is one of the most critical pathologies that a radiologist must correctly and effectively recognize on X-ray images of the chest. Classic features of pneumothorax visible on X-ray are the presence of the parietal pleura (noticeable as a white line in the pulmonary field), which is always invisible in standard images because it is covered by the ribs at the chest wall. Laterally to this line, there is no trace of lung tissue--just clear, black space. Additionally, as part of the differentiation of pathology, the radiologist must assess whether the entire mediastum has moved. In the case of large pneumothoraxes, the picture is quite characteristic. However, the clinical problem may be caused by small pneumothoraxes, which cause symptoms in patients, and in chest X-ray pictures, they may be barely noticeable, or the pleural line may be imitated by other pathologies or, the most common error, by the medial side of the spatula, which is why the correct diagnosis is so important. The second disease is pneumonia whose radiological picture is highly variable and depends on the etiology of the infection. The diagnosis can be made when the radiologist recognizes homogeneous densities in typical locations, e.g., the entire lobe or a segment of one of the lungs, sharply ending at the interlobar fissures. In other cases, densities may have the so-called patchy pattern, which also suggests inflammation. In atypical infections, the densities are located peripherally. Next, we consider pulmonary consolidation. Diagnostics of the consolidations differ from the diagnostics of pneumonia.