Boosting AI Collaboration in Smart Devices with Quality-Driven Computation