BackgroundFor knee osteoarthritis patients, analyzing alignment of lower limbs is essential for therapy, which is currently measured from standing long-leg radiographs of anteroposterior X-ray (LLR) manually. To address the time wasting, poor reproducibility and inconvenience of use caused by existing methods, we present an automated measurement model in portable devices for assessing knee alignment from LLRs.MethodWe created a model and trained it with 837 conforming LLRs, and tested it using 204 LLRs without duplicates in a portable device. Both manual and model measurements were conducted independently, then we recorded knee alignment parameters such as Hip knee ankle angle (HKA), Joint line convergence angle (JCLA), Anatomical mechanical angle (AMA), mechanical Lateral distal femoral angle (mLDFA), mechanical Medial proximal tibial angle (mMPTA), and the time required. We evaluated the model’s performance compared with manual results in various metrics.ResultIn both the validation and test sets, the average mean radial errors were 2.778 and 2.447 (P<0.05). The test results for native knee joints showed that 92.22%, 79.38%, 87.94%, 79.82%, and 80.16% of the joints reached angle deviation<1° for HKA, JCLA, AMA, mLDFA, and mMPTA. Additionally, for joints with prostheses, 90.14%, 93.66%, 86.62%, 83.80%, and 85.92% of the joints reached that. The Chi-square test did not reveal any significant differences between the manual and model measurements in subgroups (P>0.05). Furthermore, the Bland-Altman 95% limits of agreement were less than ± 2° for HKA, JCLA, AMA, and mLDFA, and slightly more than ± 2 degrees for mMPTA.ConclusionThe automatic measurement tool can assess the alignment of lower limbs in portable devices for knee osteoarthritis patients. The results are reliable, reproducible, and time-saving.