An integrated platform for early lung cancer detection and patient-physician collaborative care, powered by YOLOv12.
- Patient Registration and Login
- AI-Powered Lung Cancer Detection using YOLOv12
- Patient Dashboard for viewing results and history
- Admin Dashboard for physicians
- Patient-Physician Communication Platform
- Node.js 16.x or higher
- npm or yarn
- Clone the repository:
git clone <your-repo-url>
cd YOLO12ELCDPPCC-1- Install dependencies:
npm install- Create a
.envfile from the example:
cp .env.example .env- Update the
.envfile with your API endpoints.
Run the development server:
npm startThe app will open at http://localhost:3000.
Create a production build:
npm run build- Install Vercel CLI:
npm install -g vercel- Deploy:
vercel- Push your code to GitHub
- Go to vercel.com
- Click "Import Project"
- Select your repository
- Vercel will auto-detect it's a Create React App
- Click "Deploy"
Add these environment variables in your Vercel project settings:
REACT_APP_API_URL- Your backend API URLREACT_APP_YOLO_API_URL- Your YOLOv12 model API URL
YOLO12ELCDPPCC-1/
├── public/ # Static files
│ └── index.html # HTML template
├── src/ # Source files
│ ├── components/ # React components
│ ├── App.js # Main app with routing
│ ├── index.js # Entry point
│ ├── PneumAIUI.jsx # Landing page
│ ├── Login.jsx # Login page
│ ├── AdminDashboard.jsx
│ ├── PatientDashboard.jsx
│ ├── PatientRegistration.jsx
│ └── PatientPlatform.jsx
├── docs/ # Documentation
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
└── package.json # Dependencies
/- Landing page/login- User login/register- Patient registration/admin- Admin dashboard/patient- Patient dashboard/platform- Patient platform
- React 18.2.0
- React Router DOM 6.16.0
- React Scripts 5.0.1
- Lucide React 0.263.1 (Icons)
The application integrates with a YOLOv12 backend API for lung cancer detection from CT scans. The frontend includes:
- API Service (src/services/yoloApi.js) - Handles all API communication
- Upload Component (src/components/ScanUpload.jsx) - File upload with progress tracking
- Results Component (src/components/ScanResults.jsx) - Visualizes scan results and detections
Use the provided example backend for development:
# Navigate to docs folder
cd docs
# Install dependencies
pip install fastapi uvicorn python-multipart opencv-python pillow numpy
# Run the mock server
uvicorn backend_example:app --host 0.0.0.0 --port 8000 --reload- Train or obtain a YOLOv12 model for lung cancer detection
- Install dependencies:
pip install fastapi uvicorn ultralytics opencv-python pillow numpy- Update backend_example.py:
from ultralytics import YOLO
# Load your trained model
model = YOLO('path/to/your/yolov12_lung_cancer.pt')
MODEL_LOADED = True- Implement the API endpoints as specified in BACKEND_API_REQUIREMENTS.md
Update your .env file:
REACT_APP_YOLO_API_URL=http://localhost:8000For production:
REACT_APP_YOLO_API_URL=https://your-backend-api.com- Import the components in your page:
import ScanUpload from './components/ScanUpload';
import ScanResults from './components/ScanResults';- Add the upload component:
const [scanResult, setScanResult] = useState(null);
<ScanUpload
onScanComplete={(result) => setScanResult(result)}
onError={(error) => console.error(error)}
/>
{scanResult && <ScanResults scanData={scanResult} />}- DICOM (.dcm)
- NIFTI (.nii, .nii.gz)
- JPEG (.jpg, .jpeg)
- PNG (.png)
Maximum file size: 100MB
The backend should implement these endpoints:
POST /api/v1/scan/analyze- Upload and analyze scanGET /api/v1/scan/:scanId- Get scan resultsGET /api/v1/patient/:patientId/scans- Get patient's scansPOST /api/v1/scan/batch-analyze- Batch analysisGET /api/v1/config/thresholds- Get detection thresholdsGET /health- Health check
Full API specification: docs/BACKEND_API_REQUIREMENTS.md
The API returns detection results with:
- Risk Level: high, medium, low, or none
- Confidence Score: 0.0 to 1.0
- Detections: Array of found nodules/masses with:
- Class (nodule, mass, opacity)
- Bounding box coordinates
- Characteristics (size, shape, density)
For production deployment:
- Deploy backend API to cloud platform (AWS, GCP, Azure, etc.)
- Update CORS settings in backend to include your Vercel domain
- Set
REACT_APP_YOLO_API_URLenvironment variable in Vercel - Ensure backend has sufficient GPU resources for YOLO inference
- Implement proper authentication and data security
The platform includes comprehensive AWS S3 integration for secure image storage:
- Image Hashing: SHA-256 hashing for deduplication and integrity verification
- Thumbnail Generation: Automatic thumbnail creation for fast previews
- Presigned URLs: Secure, time-limited access to stored images
- Duplicate Detection: Prevent redundant uploads of the same image
- Create S3 Bucket:
aws s3 mb s3://pneumai-scans --region us-east-1- Configure IAM Permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::pneumai-scans/*"
}
]
}- Set Environment Variables:
REACT_APP_S3_BUCKET=pneumai-scans
REACT_APP_S3_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key- Install Dependencies:
npm install crypto-jsThe S3 service provides:
hashImage(file)- Generate SHA-256 hashgenerateThumbnail(file)- Create image thumbnailuploadImageComplete(file, onProgress)- Complete upload workflowcheckDuplicateImage(hash)- Check for existing uploads
See s3_backend_example.py for backend implementation.
The platform includes comprehensive security utilities in src/utils/security.js:
- XSS Prevention: HTML tag removal and special character escaping
- SQL Injection Prevention: Input sanitization for database queries
- Caesar Cipher: Basic data obfuscation (use AES-256 for production)
- Rate Limiting: Client-side request throttling
- File Validation: Type and size checking for uploads
import { sanitizeInput, sanitizeSQLInput, validateFileUpload } from './utils/security';
// Sanitize user input
const cleanInput = sanitizeInput(userInput);
// Prevent SQL injection
const safeData = sanitizeSQLInput(formData);
// Validate file before upload
const { valid, error } = validateFileUpload(file, ['.jpg', '.png'], 100);- Never trust user input - Always sanitize on both client and server
- Use parameterized queries - Prevent SQL injection
- Implement HTTPS - Encrypt data in transit
- Use strong encryption - AES-256 for sensitive data, not Caesar cipher
- Regular security audits - Keep dependencies updated
- Rate limiting - Prevent abuse and DDoS attacks
- HIPAA compliance - For handling medical data
See docs/IMPROVEMENTS.md for the full security roadmap.
Check docs/IMPROVEMENTS.md for:
- Current implementation status
- Planned features and enhancements
- Technical debt and known issues
- Timeline and milestones
- Deployment checklist
Private Project