the java side for pain recognition project