Caterpillar is investing millions of dollars in artificial intelligence technology to transform its factories and products.