Cancer seems to have a vast number of deaths due to its heterogeneity, aggressiveness, and significant propensity for metastasis. The predominant categories of cancer that may affect males and females and occur worldwide are colon and lung cancer. A precise and on-time analysis of this cancer can increase the survival rate and improve the appropriate treatment characteristics. An efficient and effective method for the speedy and accurate recognition of tumours in the colon and lung areas is provided as an alternative to cancer recognition methods. Earlier diagnosis of the disease on the front drastically reduces the chance of death. Machine learning (ML) and deep learning (DL) approaches can accelerate this cancer diagnosis, facilitating researcher workers to study a vast majority of patients in a limited period and at a low cost. This research presents Histopathological Imaging for the Early Detection of Lung and Colon Cancer via Ensemble DL (HIELCC-EDL) model. The HIELCC-EDL technique utilizes histopathological images to identify lung and colon cancer (LCC). To achieve this, the HIELCC-EDL technique uses the Wiener filtering (WF) method for noise elimination. In addition, the HIELCC-EDL model uses the channel attention Residual Network (CA-ResNet50) model for learning complex feature patterns. Moreover, the hyperparameter selection of the CA-ResNet50 model is performed using the tuna swarm optimization (TSO) technique. Finally, the detection of LCC is achieved by using the ensemble of three classifiers such as extreme learning machine (ELM), competitive neural networks (CNNs), and long short-term memory (LSTM). To illustrate the promising performance of the HIELCC-EDL model, a complete set of experimentations was performed on a benchmark dataset. The experimental validation of the HIELCC-EDL model portrayed a superior accuracy value of 99.60% over recent approaches.