Welcome to Just answer !
Well first and foremost please do not use the word ' mental ' for self as it is a very crude and rutheless way to describe your genuine condition through which you have been struggling for quite sometime now. I am sure that you must be have tried hard to change this compulsive behvaiour but to no avail and each time you must have felt guilty after doing so.So i empathize with you.
Well i agree that you are suffering from a psychological condition where in you have this urge to carry out the act of masturbation in public galore , may be it is thrill or it is the satisfaction / relief that you get after carrying out this act , and this kind of behaviour is best described as a type of Obsessive compulsive disorder. Another second possible diagnosis of your condition can be what is called as Paraphilia that is sexual perversion, but to me it looks like it is the fomrer diagnosis which describes your condition.
Now the solution to your problem is a combination of counseling and drug therapy.
1) Evaluation from an expert : Yes the first step is to get yourself evaluated thoroughly by an expert such as either a psychiatrist or a clinical psychologist so as to have a confirmed diagnosis of your condition which wil help us to deal with your condition better.
2) Counseling -- Upon confirmation of your diagnosis , whether it is a type of Obsessive compulsive disorder or a type of Sexual perversion, irrespective of it , the treatment of your condition will be more or less same in the form of counseling which is not any other counseling that you have to get started on but it is a specialized type of counseling called as CBT ( Cognitive behaviour therapy ) which is to be obtained in the form of one to one interview session from a Clinical psychologist. This therapy / counseling will teach you coping skills and strategies to fight against your inner urges/ impulses to carry out masturbation in public thereby enabling you to develop inner control over self and thus prevent such a behaviour.
This CBT will definitely help you to alter your thinking pattern which compels you to do this act thereby leading to modification of this behaviour and prevent any further embarrassment and negative vibes from others.
Drug therapy-- You see CBT will surely do it's work in helping you to gain control over your urges and impulses thereby helping you to overcome this kind of behaviour but to speed up the process of recovery from this condition use of a formidable and effective drug therapy is essential. So i will suggest that you get in touch with your family doctor , explain to him this situation, and ask him to get you started on a combination of 2 drugs such as -- lexapro ( escitalopram) at dose of 10 mg -20 mg / day and klonopin ( clonazepam) at dose of 0.5 -1 mg twice a day.
You see as such you should seek a referral for a psychiatrist from your family doctor to presribe you these medications as a psychiatrist will be the best person to appreciate the value of these drugs and their effects on your condition , but if for someone a psychiatrist referral is not possible atleast persuade your doctor to prescribe these drugs. These drugs will work internally on your brain to bring out control over your impulses thus preventing you from carrying out this behaviour.
So all in all i wil summarize by saying ..
-- Yes you are having a psychological condition which at the moment can be most possible either a type of Obsessive compulsive behaviour or a paraphila ( called as sexual perversion ). But at this point we can know as much as this about your underlying condition , so for confirmation of your diagnosis you got to get yourself evaluated by an expert such as either a psychiatrist preferrable or a clinical psychologist.
-- There is hope and scope for you to beat this problem but for that to happen you got to be perseverant on two treatment strategies -- drug therapy and CBT counseling .
-- Take help of your family physician / doctor for appropriate referrals for a psychiatrist / psycholgist.
I hope this helps.,,
Wish you all the best.
Please kindly leave a Positive rating if you are satisfied with the answer as only then will i be credited for my service.