There was a soft hum.

I was writing notes on my computer when I heard it. At first, I thought it was an online ad from my browser or maybe someone’s cellphone in the room. But I couldn’t tell where it was coming from.

I stopped typing and listened. A medical student in the room paused as well. The sound was growing louder. It was a voice, coming from the hallway. A soulful tune filled with emotion.

It was a patient, singing on the psychiatric unit.

The “psych ward” remains among the most stigmatized places in modern medicine. Despite more-accepting public attitudes toward mental-health care, inpatient psychiatric units continue to evoke frightening images of patients strapped to beds, electroconvulsive therapy and rooms with padded walls.

After a Massachusetts psychiatric hospital closed, Anna Schuleit honored its past residents with an art installation that involved placing thousands of flowers throughout the aging institution. (COURTESY OF ANNA SCHULEIT)

These damaging stereotypes are everywhere. Films exploit psychiatric floors as stages for horror. Travel guides tout tours of “haunted” asylums. Companies still design Halloween rides around psychiatric care.

In San Francisco, where I live for my work as a resident in psychiatry, it’s not unusual to see tourists walking around wearing “Alcatraz Psycho Ward” apparel.

Psychiatric units continue to be the hidden corners of hospitals, the secluded floors that many hope to avoid. Patients openly chat with friends and family about trips to emergency departments, primary-care clinics and even operating rooms, but this isn’t so for stays on inpatient psychiatric units. These are the places that no one likes to talk about.

In recent years, inpatient psychiatric units have been in steep decline. According to data collected by the Organization for Economic Cooperation and Development, the number of psychiatric hospital beds in the United States fell from an estimated 153,517 in 1991 to 67,707 in 2014. As a result, distressed patients often languish in emergency departments, find themselves in jails or wander the streets, unable to get the care they need.

There are multiple explanations for this downward trend. The national policy effort known as deinstitutionalization has sought to move treatment of mentally ill people away from hospitals and toward community-based options over the past several decades. Mental-health care has historically garnered poor government funding and low insurance reimbursements, which may discourage construction of new units. When budgets are tight, mental-health services are frequent targets for cost-cutting. And shortages in mental-health providers have led some hospitals to close psychiatric units.

Misunderstanding of who gets treated on psychiatric units, what happens there and how inpatient care helps people compounds the problem. As a mental-health provider, I often struggle to reconcile the public perceptions of psychiatric units with the realities of my day-to-day work. I wonder how others might feel if they could see what I’ve seen behind those doors.

These are places where patients put their lives back together, picking up the pieces torn apart by such illnesses as depression, bipolar disorder and schizophrenia. Caregivers from doctors and nurses, to social workers and psychologists work to heal the sick, to guide patients out of the abyss. Families often reconcile with loved ones. Patients may find hope in one another, opening up in groups, sharing meals, discovering the comfort of shared experiences.

(Frick Libeue, Anna Schuleit Haber)

Despite public beliefs that we’re locking people away, many — if not most — patients sign into the hospital voluntarily, and inpatient stays usually last just days to a few weeks. There are long conversations about whether to take medications. Some meetings are filled with tears, some with laughter. Patients undergo physical exams and vital-signs checks, lab work and EKGs, just like anywhere else in the hospital.

I’ve seen patients dance with nurses, smiling for the first time in weeks. Patients playing musical instruments lift the spirits of those around them. Poetry fills those walls. Some patients create artwork that belongs in museums.

I won’t sugarcoat what it’s like to work on psychiatric units. There are moments of tension and conflict. There are moments when patients rave in the grips of psychosis, scream at the locked doors, throw chairs, harm themselves or threaten staff members. Indeed, there are moments when I’m afraid.

But in my experience, these flashes of turmoil are far less common than the moments of inspiration.

I wish people could see the kind of good that can be done for patients on psychiatric units. Will we ever see psychiatric units not as places of shadows and terror but as places of beauty and strength?

Those moments of healing are there every day, right in front of us. But they just don’t garner much attention. Patients getting better in psychiatric units don’t attract headlines the way that scandals or horror films do.

Overcoming the stigma against psychiatric units won’t be easy. But I think it’s possible.

Familiarizing the public with psychiatric care is a first step. Stereotypes against psychiatric units endure when these places remain unknown and out of sight. By opening up about the realities of mental-health treatment, providers and patients can address the pervading views of the “psych ward” as a place of torture and imprisonment. This kind of transparency can illuminate psychiatric care’s potential for healing rather than horror.

This means we also have to talk about psychiatry’s checkered past. We have to acknowledge the sometimes brutal history of mental-health care — shackles, cages, lobotomies of decades ago, as well as abuses that carry into today — to inspire better treatment moving forward. By learning from psychiatry’s mistakes, future generations of mental-health providers can give the kind of compassionate care that our patients deserve.

I think back to the Massachusetts Mental Health Center. Once named the Boston Psychopathic Hospital, Mass Mental, as it became known, faced a crossroads in the early 2000s. Its main building was outdated, slated for closure and demolition. As one columnist wrote, “With its black and white checkered tiles worn and exposed radiators rusting, the building had become a relic of mid-20th century psychiatric care.”

In November 2003, after the building closed, artist Anna Schuleit created an art installation dedicated to the past residents of the aging psychiatric institution. She placed thousands of blooming flowers throughout the facility. Pink heather lined a waiting room for patients, and blue African violets covered the floor of a long corridor. Orange begonias filled the entrances to doctor’s offices. White tulips overflowed in the child psychiatry unit.

After several days of public viewing, the installation was taken down and the flowers were donated to nearby hospitals, shelters and other locations. The building was later torn down, but Mass Mental didn’t disappear. The institution moved into newer facilities, where patients receive care today.

It’s where I first learned to treat psychiatric patients as a medical student. It’s where I fell in love with psychiatry, with caring for people with mental illness.

When it comes to mental illness, we all make choices. We can continue to stigmatize people who receive treatment for mental health issues. We can be afraid of psychiatric units, dress up like patients for Halloween and scream at asylums in horror movies. We can shrug at the decline of mental-health services and let funding fall by the wayside, ignoring the plight of millions of Americans.

Or we can decide to learn more. We can ask ourselves what might it be like to feel desperate, tormented and alone. We can work together toward better care for these patients, to ensure days filled with poetry and flowers rather than chains and neglect. We can wonder what lies behind those secluded hospital doors.

The music is there if we listen.

Morris is a resident physician in psychiatry at the Stanford University School of Medicine.