Upon detecting a suspect image, it takes action. The action isn't really part of the "algorithm". Depending on the score, Apple's whim of the day, and/or outside compulsion which would probably be applied to Apple, it refuses to allow the image to be sent in messages or to "the cloud", deletes the image, and/or reports the image to Apple (which would presumably report it further). They can change what it does at any time.
In other words, it examines data on your device, on behalf of others, in a way that you don't control, and uses the resulting information to your potential detriment, again on behalf of others and again in a way that you don't control.
Apple examining your data in a way you don't control, to implement policy that you don't control and may oppose, is spying. It doesn't matter whether they do the spying using you CPU or their CPU.
The only scenario where you don't need to accept things that are to your potential (and very real) detriment is if you don't live in society.
And no, what you described is not spying. Look up what it means: https://en.wikipedia.org/wiki/Espionage.
You are doing mental gymnastics. It's like calling a speeding fine "robbery", at best it's noise and not a useful contribution to discussion.
Where I live, police can't just randomly "check your documents" unless they already have some independent evidence supporting the idea that you might be involved in a crime. Which is how it should be.
It wouldn't be spying, though, since they'd be doing it openly and presumably not doing it on a continuing basis. It'd still be obscene authoritarian overreach.
> or speed/traffic camera is not "to your potential detriment",
These should of course be banned.
> or waiting in line to board the bus, etc.
This has nothing at all to do with anything and is just you trying to muddy the waters.
Yeah, then how about you match the description of a criminal. But it was an example and if you don't get the point then it's a waste of time.
> These should of course be banned.
Are you protesting them?
What if your kid gets run out by one of them speeders while walking out of school gates, will you still think speeding cameras are unnecessary?
> muddy the waters
These are all examples of having to suffer detriment due to living in a civilized society. You can pretend you don't but you do.
Why does this issue get techbros all up in arms-- I don't see them out protesting airport security checks etc. Somehow when their own lives are on the line then it's acceptable to require privacy invasive checks.
Spying by your own device is still spying.