We define an invariant of welded virtual knots from each finite crossed module by considering crossed module invariants of ribbon knotted surfaces which are naturally associated with them. We elucidate that the invariants obtained are non-trivial by calculating explicit examples. We define welded virtual graphs and consider invariants of them defined in a similar way.