Lung cancer is the leading cause of cancer mortality worldwide, and it is urgently necessary to diagnose it as early as possible. Usually, the diagnostic process begins with a radiological examination which, when a possible tumour is present, is followed by a biopsy to extract tissue samples from the patient's lungs. Therefore, the purpose of this study is the development of an artificial intelligence algorithm that will analyse the Whole Slide Image (WSI) generated by the digitisation of the glass slides obtained from the extracted samples and detect if there is a tumour. The developed learning algorithms as well as the tested neural networks (NNs) were trained on a dataset composed of previously annotated WSI tiles, classified as Tumour or Non-Tumour. From these, four developed convolutional neural networks stood out and were selected to be compared with each other and with the tested NNs. When the best result of each of the developed architectures was compared to the highest result of the tested NNs, it was possible to denote that version 4 of CancerDetecNN achieved an average accuracy of 89.749 \% and an average loss of 0.220. Furthermore, the results for the four selected versions are in agreement with the results reported in the literature, however, the limited size of the given dataset must be considered. Given the results obtained, the fourth version has the potential to optimise the lung cancer diagnosis process.