Magnetic vehicle detector is a rising traffic flow data collection technology in recent years. In the related research field, vehicle speed estimation based on single sensor is one of the hot spots. This paper introduced the magnetic vehicle detection technology. The distribution statistics of vehicle length on urban road network was analyzed. Under certain reasonable assumptions, the vehicle class composition identification based mean speed estimation algorithm was then put forward. In the algorithm, the OTSU method was used to classify vehicles into small and large ones. On urban road network, small vehicles appeared mostly and the vehicle lengths distribution was centralized. According to the statistical characteristics, mean vehicle speed was calculated based on only small vehicles data in the algorithm. Finally, field experiment was conducted on road section in Beijing and the algorithm was verified on the Matlab platform. It was concluded that, the algorithm was with high accuracy and stability. The accuracy of calculated mean vehicle speed exceeded 85. © 2010 China Association for Science and Technology.