This paper presents a method for automatically diagnosing Helicobacter pylori (H. pylori) infection based on EfficientNet using gastric endoscopic images. We use the images cut in endoscopic videos before the release frames for an augmentation strategy in our method. Moreover, to prevent overfitting of the training process, we use the flooding version of cross-entropy loss. Our method achieves high diagnostic performance in a complex endoscopic image dataset containing two domains and eight different gastric positions.