Skip to content

iapex-org/search-api

search-api — AI-Powered Hybrid Search Engine for Patient Location

Python FastAPI PostgreSQL MongoDB dlib GPL v3

AI-driven search engine for locating missing patients in healthcare institutions using hybrid facial recognition and textual analysis.

Report Bug

🇬🇧 English · 🇪🇸 Español


About search-api

IAPEX (Inteligencia Artificial para la Localización de Pacientes Extraviados en Instituciones de Salud) is a validated and robust system designed to address a critical problem: identifying unlocated or unidentified patients within healthcare institutions.

This repository contains the Search API — the AI engine that combines facial recognition via CNN and advanced textual analysis to identify patients with high precision.

Ecosystem

Component Repository Stack
Search API (this) iapex-org/search-api FastAPI, Python 3.11, MongoDB
Mobile App iapex-org/mobile-app React, Ionic
Web Portal iapex-org/web-app Angular, Bootstrap
Core API iapex-org/core-api Spring Boot, PostgreSQL

Features

  • Facial Recognition — CNN based on dlib with 128-dimensional embeddings
  • Textual Analysis — Levenshtein and Jaro-Winkler algorithms for matches
  • Hybrid Search — combines facial recognition (75%) and textual analysis (25%)
  • Smart Cache — face encodings in MongoDB for fast comparisons
  • Ad-hoc Search — searches with manually entered data
  • Validated System — 100% sensitivity (zero false negatives) in 3,720 evaluations
  • Async API — async/await architecture for maximum performance
  • Interactive Docs — Swagger UI and ReDoc built-in

Search Modes

Mode Description Validated Precision
text Text-only (name, gender, physical description) 96.8% effectiveness
image Facial recognition only via CNN 100% precision
hybrid Optimal combination: text (25%) + image (75%) 100% precision

Quick Start

Prerequisites

  • Python 3.11+
  • PostgreSQL 14+
  • MongoDB 6.0+
  • CMake and C++ compilers (for dlib)

Setup

git clone https://github.com/iapex-org/search-api.git
cd search-api
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

Configure your values in .env, then:

python run.py

The API will be available at http://localhost:8000

Architecture

┌─────────────────────────────────────────────────┐
│                  Client Apps                     │
│  ┌─────────────┐  ┌─────────────────────────┐   │
│  │ Mobile App  │  │      Web Portal         │   │
│  └──────┬──────┘  └───────────┬─────────────┘   │
└─────────┼─────────────────────┼─────────────────┘
          │                     │
┌─────────▼─────────────────────▼─────────────────┐
│           API SEARCH (FastAPI)                    │
│  ┌──────────┐ ┌──────────┐ ┌────────────────┐   │
│  │ Facial   │ │  Text    │ │   Hybrid       │   │
│  │ Recog.   │ │  Matcher │ │   Engine       │   │
│  │ (dlib)   │ │(Levensh.)│ │  (75/25 mix)   │   │
│  └────┬─────┘ └────┬─────┘ └───────┬────────┘   │
│       │            │               │            │
│  ┌────▼────────────▼───────────────▼────────┐   │
│  │         Cache Layer (MongoDB)            │   │
│  └────────────────┬─────────────────────────┘   │
└───────────────────┼─────────────────────────────┘
                    │
          ┌─────────▼─────────┐
          │  PostgreSQL       │
          │  (Patient Data)   │
          └───────────────────┘

Contributing

Please read CONTRIBUTING.md for branch naming, commit conventions, and PR workflow.

License

This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.

Acknowledgments

Authors:

  • Altamirano Misrael Florentino
  • Ortiz Pérez Alejandro
  • Serrano Puertos Jorge Christian

Advisors:

  • Escobar García Arturo

Academic Support:

  • Universidad Tecnológica del Centro de Veracruz

About

AI-powered hybrid search engine for locating missing patients using facial recognition and textual analysis (FastAPI, Python, MongoDB, PostgreSQL)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Contributors