So you came here with zero technical expertise or knowledge about the situation, and asking for specific steps on how to do this in order to make a product? 😂🤣🤦 Hope there was some profit sharing involved somewhere.
How would ML detect ads? Do you know the difference between ML and CV? You may want to start there.
Get a Pihole or AdGuard endpoint and hope for the best if all you want is to remove ads.