If the grease will not allow light thru the specifed size bubble at 1/8", then you are not going to get vision to work. You would have to make the thickness of the viewing tube such that it was smaller than the maximum bubble size allowed. I can envision a flattened tube, very transparent, with a DC high contrast light source and a color vision system with "blob" tools to be quite feasible, however expensive.
You would need top notch lighting, some sort of enclosure probably, and a fast processor depending on the rate of flow of grease and blobs of air.
But so, you've now detected a bubble in the grease, what next? Stop production? Open a vent valve? Add a little more grease to the process? None of those are final solutions are they? I could be wrong, just Shored Bitless in the Land of Bugs Weeds and Toll Roads.
Sounds very challenging...one of those problems that makes you look at the whole application to see if eliminating the problem might be superior to sensing it and reacting.
Why air there bubbles in the 1st place and how can we prevent them?
Not having seen your application, one can assume you have already thought long and hard about that, and probably have tried solutions there.
Shirley, there is an air trap suitable for grease on the market? Maybe you can roll your own that fits your end of arm tooling.
If not, would it be possible to detect a sudden pressure (or volume) change when the air escapes at the point of delivery?
Without knowing the length of the tube, the type of supply pump and how it is fed and distributed, and the pressure, I can't really go much farther with my vision of how to detect the bubble.
Hmmmm...