If you want to identify different varieties of dragonfruit this way, that seems quite hard to me (basically the domain of experts). If you want to identify dragonfruit cacti vs. other cacti, the answer is relatively easy and you can get most of the way there by looking for 3-sided stems.