Reminds me of some work done by my employers to try to bypass a tedious daily 'evaporation' test for circulating solids etc in inhaler filling lines...
Summarising several decades of oft-ingenious attempts, gallant failures and incremental improvements, really simple sensors could give a semi-quantitative approach, each product and each flow-rate requiring patient generation of an ad-hoc calibration graph. Trying to get beyond that was bollixed by managers' attempts to run lines beyond their 'sweet spot' speeds, random stops & starts producing erratic line data, plus a lot more lab-work due to the surfeit of 'micro-batches'...
The alternative of a flow-through density instrument cost far more than its data was worth...
IIRC, the sugar and sugar product industry refined 'refractive index' sensor design. The 'cleaning products' people cleaned up with conductivity, dielectric properties, Redox, pH, opalescence etc etc...
May I suggest you trawl old-ish reference library sources for ideas ? You may be able to miniaturise, stabilise and harden old tech using eg LEDs, lasers etc...