An important piece of information for planning public transportation is the number of passengers using the system. Several initiatives have started to explore the Wi-Fi packets generated by passengers’ smartphones as means to obtain this information. A sensing device located inside the bus can intercept and collect these packets. By applying filters, e.g., verifying if the signal strength is higher than a threshold, the sensor can infer passengers' presence/absence. However, such limits are set arbitrarily, leading to errors, for example, when close to bus stops. To address this issue, this article proposes a method (UAI-FI) based on an artificial intelligence technique (Support Vector Machine) to classify the origin of packets as inside or outside the bus. To validate UAI-FI, we applied and compared our approach to other methods in a bus line in Goiânia/Brazil. The results suggest that UAI-FI outperformed existing methods. Furthermore, it successfully classified the packet’s origin, obtaining 83.3% and 88.5% of the total number of passengers boarding and alighting the line. Despite the overall similarity, we highlight that UAI-FI’s counting curve presented a delay compared to the manual count indicating that the frequency that Wi-Fi packets are sent can cause the presence/absence of passengers to be perceived at different stops.