Inspiration
The project was inspired by the 2019 OSMI (Open Sourcing Mental Illness) survey, which highlights the challenges tech employees face regarding mental health at work. In many workplaces, mental health is still considered a taboo topic, and employees often suffer in silence due to fear of judgment or job repercussions. We wanted to explore how data and machine learning can help raise awareness, foster conversation, and provide gentle nudges toward seeking help — in a private, anonymous, and non-judgmental way. I have developed this model with vibe coding so that I can identify mistakes efficiently and correct my model accordingly.
What it does
The Workplace Mental Health Predictor is a web-based application that predicts the likelihood of a user currently experiencing a mental health disorder, based on their workplace environment and comfort discussing mental health. Users answer a short questionnaire about their work culture and support systems. The app processes the inputs using a trained machine learning model. It outputs a prediction (low or high likelihood) and a confidence score. The tool also provides gentle advice depending on the prediction.
How we built it
Dataset: We used the OSMI 2019 Mental Health in Tech Survey as our data source. Model: A RandomForestClassifier was trained using features related to company size, support systems, and attitudes toward mental health. Preprocessing: All features were treated as categorical. Used SimpleImputer(strategy='most_frequent') for missing values. Applied OneHotEncoder for categorical encoding. Pipeline: Built using scikit-learn's Pipeline and ColumnTransformer. Deployment: Frontend was built using Streamlit, allowing users to interact with the model in real-time. Model Saving: Used joblib to serialize the model for reuse.
Challenges we ran into
Handling Categorical Data: All features were string-based, requiring careful preprocessing to avoid errors like applying median imputation to non-numeric columns. Inference-Time Errors: The Streamlit app initially crashed because the input data wasn’t formatted identically to the training data. Fixing this involved ensuring strict consistency in feature order and types. Data Imbalance: The dataset was slightly skewed toward one class, so we had to balance the train/test split carefully to maintain model accuracy. UI Simplicity vs. Depth: Designing a UI that is simple yet informative without overwhelming users with too many questions was a balancing act.
Accomplishments that we're proud of
Successfully built an end-to-end machine learning pipeline from data to deployment. Created a fully functional, user-friendly Streamlit app that can make real-time predictions. Learned how to handle complex pipelines and categorical preprocessing without breaking the model. Tackled a sensitive topic with respect and responsibility.
What we learned
How to use scikit-learn pipelines for robust preprocessing and modeling. The importance of feature consistency between training and inference in ML deployments. How to use Streamlit to create fast, beautiful UIs for machine learning models. Gained a deeper understanding of mental health challenges in the tech industry.
What's next for Work Place Mental Health Predictor
Add More Features: Incorporate additional questions about lifestyle, stress, and company policies to increase prediction accuracy. Multilingual Support: Make the app accessible to non-English speakers. Mobile Responsiveness: Improve UI/UX on mobile devices. Visual Analytics: Add charts or visual feedback on how the user compares to broader trends. Privacy Enhancements: Add a disclaimer and anonymization options to reassure users about data safety. Resource Integration: Link users to professional mental health resources or support groups based on their results.
Built With
- python
- streamlit
Log in or sign up for Devpost to join the conversation.