There's no way to identify the real physical screen size, at least from information browsers give you. How do you know if the display is a colossal display used by the stage at a concert, or a desktop monitor? There may be no difference in the resolution or device pixel ratio in either case.
On mobile devices, your best bet is probably just to rely on the screen size reported by Platform Info. That is in CSS pixels so does not vary with the device pixel ratio, and so you can probably work on the assumption CSS pixels are about the same physical size across devices, and so the screen size is a rough indication of the display size.