A Python-based system for detecting nasal asymmetry using smartphone photos and symptom assessment.
π Try it live β nosecheckai-v2.onrender.com
NoseCheck is a research project that aims to detect Deviated Nasal Septum (DNS) using:
- Computer Vision Analysis: Automated facial landmark detection and nasal asymmetry measurements
- Symptom Assessment: Self-reported symptom questionnaire
- Calibration System: Validated against 3D-printed models with known deviations
πΈ How It Works
Upload a frontal face photo β answer a short symptom questionnaire β get a deviation score with severity classification (Normal / Mild / Moderate / Severe).
Photo Upload β MediaPipe Face Landmarks β Asymmetry Metrics β Deviation Score β Result
- Automated facial landmark detection using MediaPipe
- Quantitative nasal asymmetry measurements
- Multi-metric deviation scoring system
- Symptom questionnaire integration
- Calibration with 3D-printed reference models
- Statistical analysis and visualization
- Mobile-friendly web interface
nosecheck/
βββ src/
β βββ image_processing/ # Photo capture and preprocessing
β βββ landmark_detection/ # Facial landmark detection using MediaPipe
β βββ measurement/ # Nasal asymmetry calculations
β βββ scoring/ # Deviation score algorithm
β βββ questionnaire/ # Symptom checklist module
β βββ data_management/ # Data storage and retrieval
β βββ analysis/ # Statistical analysis and visualization
βββ data/
β βββ calibration_models/ # Known deviations of 3D models
β βββ images/ # Captured photos
β βββ results/ # Measurement data and scores
βββ models/ # MediaPipe model files (face_landmarker.task)
βββ notebooks/ # Jupyter notebooks for analysis
βββ tests/ # Unit tests
βββ docs/ # Documentation and research notes
βββ scripts/ # Utility scripts
- Python 3.8+ (Python 3.9.6+ recommended)
- pip (Python package manager)
-
Clone or download this repository
git clone https://github.com/lakshman1213/nosecheck.git cd nosecheck -
Create a virtual environment
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
For full development (includes pandas, matplotlib, scikit-learn for analysis):
pip install -r requirements.txt
For minimal web app only (production-like):
pip install -r requirements-production.txt
-
Download the MediaPipe Face Landmarker model
The model will auto-download on first run, but you can download it manually:
mkdir -p models curl -L -o models/face_landmarker.task \ "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task"
After installation, start the Flask web server:
Option 1: Using the convenience script
python run_server.pyOption 2: Using Python module
python -m src.appOption 3: Using Flask CLI
python -m flask --app src.app run --host 0.0.0.0 --port 5001The server will start on http://localhost:5001
- Open your browser and navigate to
http://localhost:5001 - The web interface provides a mobile-friendly UI for photo upload, symptom questionnaire, and results display
- Press
Ctrl+Cto stop the server
requirements.txt: Full development dependencies including pandas, matplotlib, scikit-learn, jupyter. Use this for local development, calibration scripts, and data analysis.requirements-production.txt: Minimal dependencies for web app only. Use this for production deployments or if you only need the web interface.
- Start the server:
python run_server.py - Open
http://localhost:5001in your browser - Upload a frontal face photo
- Complete the symptom questionnaire
- View your screening result with deviation score and classification
from src.landmark_detection.detector import detect_landmarks
from src.measurement.asymmetry_calculator import calculate
from src.scoring.score_calculator import calculate_score
# Process an image
image_path = "path/to/nose/photo.jpg"
landmarks = detect_landmarks(image_path)
if landmarks:
measurements = calculate(landmarks)
result = calculate_score(measurements)
print(f"Deviation Score: {result['deviation_score']}")
print(f"Classification: {result['classification']}")The system calculates the following nasal asymmetry metrics:
- Lateral Deviation: Distance from nose tip to facial midline
- Septal Angle: Angle of nasal septum from vertical
- Nostril Asymmetry: Left vs. right nostril size/shape differences
- Bridge Alignment: Straightness of nasal bridge
- Computer Vision: OpenCV, MediaPipe
- Data Processing: NumPy, Pandas
- Statistical Analysis: SciPy, scikit-learn
- Visualization: Matplotlib, Seaborn
- Web Interface: Flask
- Database: SQLite (via SQLAlchemy)
- Development: Jupyter, pytest, black
pytest tests/black src/Port 5000 already in use (macOS)
- macOS AirPlay Receiver uses port 5000 by default
- NoseCheck uses port 5001 to avoid conflicts
- If port 5001 is also in use, change it in
run_server.pyorsrc/app/__main__.py
Model download fails
- Check your internet connection
- Download manually:
mkdir -p models curl -L -o models/face_landmarker.task \ "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task"
Import errors
- Ensure virtual environment is activated:
source venv/bin/activate - Reinstall dependencies:
pip install -r requirements.txt - Check Python version:
python3 --version(should be 3.8+)
Face detection fails
- Ensure photo is frontal (face camera directly)
- Check lighting (even, not too dark or overexposed)
- Photo should show full face with nose clearly visible
- Try a different photo with better quality
Module not found errors
- Make sure you're in the project root directory
- Verify
src/directory exists and contains all modules - Check that
__init__.pyfiles exist in each package directory
This tool is designed for research purposes to:
- Validate correlation between calculated scores and known deviations
- Assess repeatability of measurements
- Evaluate classification accuracy across severity categories
- Serve as an educational tool for adolescent health awareness
- Quantitative Validation: High correlation (rΒ²) between known and calculated deviations
- Repeatability: Coefficient of variation < 10% for repeated measurements
- Classification Accuracy: Reliable distinction between normal/mild/moderate/severe categories
This is a research project. For questions or collaboration inquiries, please contact the research team.
[To be determined based on research institution requirements]
This tool is for research and educational purposes only. It is not intended for clinical diagnosis or medical decision-making. Always consult qualified healthcare professionals for medical advice.
[To be added upon publication]