The Yellow Peril was a slogan representative of a mix of politics and science in its day. Historians look back and call social Darwinism pseudo-science, yet portions of the usual prophetic fear-mongering typically said to be based on science were based on a form of scientism that is still around. Some of the history:
Heinz Gollwitzer...traces the origin and spread of the “Yellow Peril” slogan in Europe and America from the 1860’s to 1914. He first suggests the cultural context in which the slogan arose: “mass society,” psychologically unstable and prone to hysteria; a cliché-hungry yellow journalism; social Darwinism; cultural pessimism; and the need of labor and business (high-tariff) lobbies to find broadly appealing rationalizations for their interests. [...](Reviewed: Die Gelbe Gefahr: Geschichte eines Schlagworts: Studien zum Imperialistischen Denken by Heinz Gollwitzer
Among the intellectuals, the Yellow Peril syndrome shows a common pattern, its categories derived from the still respectable racialism, the dominant social Darwinism, and such pseudo-scientific or political phenomena as “prophetic Malthusianism”...
Reviewed by Johanna M. Menzel
The Journal of Modern History Vol. 36, No. 2 (Jun., 1964) :216)
The history of artistic representation of the Yellow Peril:
(Reviewed: The Yellow Peril: Chinese-Americans in American Fiction 1850-1940 by William F. Wu
In most fiction the Chinese in America are portrayed as exotic, heathen, filthy, crime-ridden, and violent, and “positive” portrayals are usually condescending. By the end of the century, Chinatown and the Chinese are little more than alien artifacts under the maker’s eye.
One of the key elements of Wu’s examination of this period is his reading of anti-Chinese xenophobia as incorporated into American literary naturalism...
Naturalism presented the Yellow Peril in terms of an inevitable clash of western civilization and alien forces from the East, a lurid, apocalyptic conflict set in the near future. As Wu informs us, the imaginative freedom of a futuristic setting meant for most writers freedom from the burden of responsible portrayal; historical and cultural ignorance, distortions, and inaccuracies were commonplace...
Reviewed by Neil Nakadate
MELUS Vol. 10, No. 3, Varieties of Ethnic Criticism (Autumn, 1983) :93)
On the other hand, there was reason for fear, even if it was often incorrectly stated in the language of the scientific racism of the day or other forms of racism. E.g.,
(The New York Times; Sept. 18, 1904, pg. 2)
There was "peril," although it was not based on biological race or some viral "Yellow Peril." E.g.
"Japan's mission is to lead the world spiritually and intellectually." I was wholly unprepared for such a statement when I went to interview Yosuke Matsuoka, chief of the Japanese delegation defending Japan against China's charge of agression before the League of Nations.
His youthful appearance, his gentle voice and suave manners do not disguise the forceful personality of this envoy...who recieved part of his education in America. Leaning back, he removed his glasses in silence, replaced them thoughtfully, and said "Japan can offer spirituality to America and the entire Western World. Japan, I am convinced, will be the cradle of a new Messiah."...
(Matsuoka Claims for Japan "A World Spiritual Mission"
By Lady Drummond-Hay
The New York Times; Jan 8, 1933 pg. XX4)
What is tiresome to me is the tendency among modern progressives to try to treat science as if it is all that is good and holy and religion as if it blasphemes against science. History as well as the history of science do not support such judgments and such views are self-refuting, as one cannot claim that religion is evil without admitting that things like Good and Evil exist in a way that are applicable enough to condemn people's "religions" as evil.