AI to stop water pollution before it happens