  We study the extinction of epidemics in a generalized
susceptible-infected-susceptible model, where a susceptible individual becomes
infected with the rate $\lambda$ when contacting $m$ infective individual(s)
simultaneously, and an infected individual spontaneously recovers with the rate
$\mu$. By employing the Wentzel-Kramers-Brillouin approximation for the master
equation, the problem is reduced to finding the zero-energy trajectories in an
effective Hamiltonian system, and the mean extinction time $\langle T\rangle$
depends exponentially on the associated action $\mathcal {S}$ and the size of
the population $N$, $\langle T\rangle \sim \exp(N\mathcal {S})$. Because of
qualitatively different bifurcation features for $m=1$ and $m\geq2$, we derive
independently the expressions of $\mathcal {S}$ as a function of the rescaled
infection rate $\lambda/\mu$. For the weak infection, $\mathcal {S}$ scales to
the distance to the bifurcation with an exponent $2$ for $m=1$ and $3/2$ for
$m\geq2$. Finally, a rare-event simulation method is used to validate the
theory.
