The claim about 18 times more likely is published with more detail by Heather McDonald in the Washington Post article Academic research on police shootings and race 19 July 2016.
the per capita rate of officers being feloniously killed is 45 times higher than the rate at which unarmed black males are killed by cops. And an officer’s chance of getting killed by a black assailant is 18.5 times higher than the chance of an unarmed black getting killed by a cop
The 36 unarmed black male victims of police shootings in 2015 measured against the total black male population [nearly 19 million in mid-2014, per the Census Bureau] amounts to a per capita rate of 0.0000018 unarmed fatalities by police. By comparison, 52 law enforcement officers were feloniously killed in 2015 while engaged in such duties as traffic stops and warrant service, according to the National Law Enforcement Officers Memorial Fund. The FBI counted nearly 628,000 full-time law enforcement officers in the United States in 2014. Assuming that the number of officers did not markedly increase in 2015, the per capita rate of officers being feloniously killed is 0.000082, or 45 times the rate at which unarmed black males are killed by cops. The Memorial Fund does not have data on the race of cop-killers in 2015, but applying the historical average over the last decade in which 40 percent of all cop-killers were black would yield 21 cops killed by blacks in 2015. An officer’s chance of getting killed by a black person is 0.000033, which is 18.5 times the chance of an unarmed black person getting killed by a cop. After this year’s 72 percent increase in felonious killings of police officers, these ratios will be even more lopsided.
In other words, based upon past statistics, the chances of a cop being killed by a black male is 18.5 times greater than an unarmed black male being killed by a cop.
The Washington Post article is relying on data from the National Law Enforcement Officer's Memorial Fund 2015 Law Enforcement
Officer Fatalities Report which says:
Fifty-two officers were killed feloniously in 2015, a 15 percent decrease from 2014 when 61 officers died as a result of a criminal act. Of the 52 officers feloniously killed this year, 39 were shot and killed; 11 officers were killed in traffic-related incidents and two officers were killed in incidents unrelated to traffic or firearms. Of the 11 officers feloniously killed in traffic-related incidents, seven were struck, and four were killed in automobile crashes. One officer died as a result of a physical altercation with a suspect, and one officer was beaten to death.
The FBI gives somewhat lower numbers for officers feloniously killed. The number of officers feloniously killed in 2014 was 51 and in 2015 was 41 and in 2016 was 66 according to the FBI.
The "36 unarmed black male victims of police shootings" corresponds to this database for police shootings. This dropped to 16 in 2016 according to this database.
As far as the approximation that 40% of felonious killings of officers are by black males. According to the FBI, in the 2004-2013 time period, out of 565 such perpetrators, 243, or 43%, were black. Almost all were male. In more recent data, 2007-2016, 38% were black. The data are quite variable from year to year.
So, in conclusion, the statistic (for what, if anything, it is worth) is approximately true. The two main criticisms of the methodology are 1. using Officer's Memorial Fund statistics rather than FBI statistics, and 2. no attempt to justify equating the number of unarmed black males killed by officers to the number shot by officers. Additional black males may have been killed by other means.
(Note: when I answered the question, the phrase "are the police racist?" did not appear in the question. The statistic has no relevance to the subquestion "are the police racist?". This answer is only meant address the truth of the statistic itself, and does not attempt to address the issue of whether or not the police are racist.)