The Internet of Things (IoT) has tremendously spread worldwide, and it influenced the world through easy connectivity, interoperability, and interconnectivity using IoT devices. Numerous techniques have been developed using IoT-enabled health care systems for cancer detection, but some limitations exist in transmitting the health data to the cloud. The limitations can be accomplished using the proposed chronological-based social optimization algorithm (CBSOA) that effectively transmits the patient's health data using IoT network, thereby detecting lung cancer in an effective way. Initially, nodes in the IoT network are simulated such that patient's health data are collected, and for transmission of such data, routing is performed in order to transmit the health data from source to destination through a gateway based on cloud service using CBSOA.The fitness is newly modeled by assuming the factors like energy, distance, trust, delay, and link quality. Finally, lung cancer detection is carried out at the destination point. At the destination point, the acquired input data is fed to preprocessing phase to make the data acceptable for further mechanism using data normalization. Once the feature selection is done using Canberra distance, then the lung cancer detection is performed using shepard convolutional neural network (ShCNN). The process of routing as well as training of ShCNN is performed using the CBSOA algorithm, which is devised by the inclusion of the chronological concept into the social optimization algorithm. The proposed approach has achieved a maximum accuracy of 0.940, maximum sensitivity of 0.941, maximum specificity of 0.928, and minimum energy of 0.452.