The study is aimed at evaluating the application value of ultrasound combined with gastroscopy in diagnosing gastrointestinal bleeding (GIB) caused by Helicobacter pylori (HP). An ultrasound combined with a gastroscopy diagnostic model based on improved
K
-means Singular Value Decomposition (N-KSVD) was proposed first. 86 patients with Peptic ulcer (PU) and GIB admitted to our Hospital were selected and defined as the test group, and 86 PU patients free of GIB during the same period were selected as the control group. The two groups were observed for clinical manifestations and HP detection results. The results showed that when the noise
ρ
was 10, 30, 50, and 70, the Peak Signal to Noise Ratio (PSNR) values of N-KSVD dictionary after denoising were 35.55, 30.47, 27.91, and 26.08, respectively, and the structure similarity index measure (SSIM) values were 0.91, 0.827, 0.763, and 0.709, respectively. Those were greater than those of DCT dictionary and Global dictionary and showed statistically significant differences versus the DCT dictionary (
P
<
0.05
). In the test group, there were 60 HP-positives and 26 HP-negatives, and there was significant difference in the numbers of HP-positives and HP-negatives (
P
<
0.05
), but no significant difference in gender and age (
P
>
0.05
). Of the subjects with abdominal pain, HP-positives accounted for 59.02% and HP-negatives accounted for 37.67%, showing significant differences (
P
<
0.05
). Finally, the size of the ulcer lesion in HP-positives and HP-negatives was compared. It was found that 71.57% of HP-positives had ulcers with a diameter of 0-1 cm, and 28.43% had ulcers with a diameter of ≥1 cm. Compared with HP-negatives, the difference was statistically significant (
P
<
0.05
). In conclusion, N-KSVD-based ultrasound combined with gastroscopy demonstrated good denoising effects and was effective in the diagnosis of GIB caused by HP.