> As I asked before, if I implemented the same logic in an FPGA, would that make it patentable?

No. Like software, anything which you can implement in an FPGA is pretty obviously math. It's literally a mathematical (boolean logic) equation. Possibly a recurrent one when you consider registers and state machines, but still 100% math. An FPGA is no different from a general-purpose computer in this regard. And FWIW, the same would be true of logic implemented as an ASIC or discrete logic circuits.

What is not just software is the overall process, particularly the physical sensors and actuators and the relationships between them. The ice cream dispenser example is getting a bit ridiculous, so let's talk anti-lock brakes instead. The individual components to sense the car's motion, braking force, and the rotation of the tires are obviously not software. The same goes for the actuators which interface with the braking system and create the pulsing effect to un-lock the tires. The software itself which describes how these parts are related ought not be patentable, and an equivalent implementation outside the context of an actual ABS system (in a simulator, for example) ought not infringe on any patent even if the code is functionally identical to the code in the ABS unit. The ABS system as a whole, in the context of a vehicle, is not merely software, so a patent on a system which detects certain conditions via physical sensors in a vehicle and brings it to a safe stop by physically interfacing with the brake controls would not be a software patent, even if some software is used to implement the claims. Accomplishing the same effect with an FPGA or discrete logic, or even mechanical linkages, would be covered by the same patent, since the software is not part of the claims. (On the flip side, merely replacing discrete logic, ASICs, or FPGAs with software having the same effect—or vice-versa—would not qualify for a new patent for exactly the same reason.)

Going back to the ice cream example… IMHO that would be a really hard sell, mostly because all the "value" (using the term loosely) comes from the ML. It's not really much of an improvement over connecting the fluid switch to a mechanical scale, which could easily be accomplished without any software. You didn't invent the camera or the switch or even the ML system (ignoring for a moment the fact that the ML system on its own is pure math). Maybe you could claim something about how all these weighted inputs from the pixels in the camera combine to control the actuation of the switch. That seems like a really complicated patent application due to the input of inputs, and since it's ML-based and self-trained you can only explain how it works, not why. I'd be inclined to reject it simply based on the fact that such a disclosure really wouldn't benefit the public at all, if by some miracle patent clerks were allowed to represent the interests of the public in that manner. But assuming the patent were granted, it would only cover the use of this logic in the context of an ice cream dispenser. Applying the same ML system to classify images according to BMI in another context would not infringe on the patent, since it was not the ML system (the math or its evaluation in software) which was the subject of the patent, but rather its application in controlling the dispenser.