Gastric cancer is the second most common cancer in the world. Due to the time-consuming diagnosis of the disease, it is essential to use new methods (e.g., computer science) for early diagnosis. Among various computer-based detection methods, artificial intelligence algorithms have attracted great attention today. The present study aimed to increase the accuracy of gastric cancer diagnosis by using a combination of deep neural network, support vector machine, and deep convolutional neural network (CNN) based on the surface and color features of the tongue. The proposed method was evaluated in seven CNN architectures. According to the results, using the DenseNet architecture in the proposed method had a higher accuracy compared to the other architectures, and 91 % accuracy was observed in the diagnosis of gastric cancer.