Anthony Weiner will probably be viewed as a pedophile and therefore a major target for violence by other inmates ... and THAT'S why he wants to avoid serving time in a hardcore Brooklyn prison.

Weiner's lawyer damn near begged the judge NOT to send him to the notorious Metropolitan Detention Center. Our sources say Weiner is freaked out because inmates there dole out their own brand of justice against convicts serving time for crimes against children. The disgraced former congressman, of course, pled guilty to sexting a 15-year-old girl.

The MDC's no joke. It houses drug dealers and organized criminals, and beatdowns and sexual assaults are rampant. As one source put it, Weiner would be taken to the brink.

We're told Weiner will likely serve time at a low or medium-security facility. 

One possibility is Otisville in New York ... considered a cakewalk because of its dormitory-style housing. The Bureau of Prisons will ultimately have the final say where Weiner gets locked up.

He must surrender by Nov. 6.

We reached out to Weiner's attorney, Erin Monju, who declined to comment.