Let me guess: the issue appeared with the 10.10.3 update? Well, then I am 98% certain it is a bug in OS X Yosemite. Your issue is related with this one.
Users report erratic kernel panics and some users have graphics glitches like you. The only common feature is having a Intel HD 4000 GPU.
On MacBook Pros with dual GPU you can avoid the problem by disabling Automatic Graphics Switching (System Preferences > Energy Saver).
Please contribute to the thread in the apple discussion forum and file a bug report (with link to the thread).