Image sensors with artificial intelligence