Skip to main content
Medical Disclaimer: This application is for educational and research purposes only. It is NOT a substitute for professional medical advice, diagnosis, or treatment.

Medical usage limitations

Not a diagnostic tool

This model has critical limitations that prevent its use as a clinical diagnostic device:
  • No regulatory approval for clinical use
  • Not validated through clinical trials
  • Does not meet medical device standards (FDA, CE, etc.)
  • Should never replace professional dermatological examination
  • Training dataset may not represent all populations equally
  • Potential bias in skin tone representation
  • Limited coverage of rare lesion variants
  • Dataset age and source not verified in production
  • Predictions should not influence medical treatment
  • Always consult qualified healthcare professionals
  • Developers assume no liability for medical outcomes
  • Tool may produce false positives or false negatives

Required disclaimers

Any deployment of this application must prominently display:
Required User Warnings:
  1. This tool is for educational purposes only
  2. Not intended for medical diagnosis or treatment decisions
  3. Consult a dermatologist for any skin concerns
  4. Do not delay seeking medical care based on results
  5. Accuracy is not guaranteed and varies by image quality

Technical limitations

Model accuracy constraints

The model’s predictive capability has inherent boundaries: Accuracy factors:
  • Image quality: Blurry, poorly lit, or low-resolution images reduce accuracy
  • Lesion positioning: Partial lesions or multiple lesions in frame affect results
  • Skin tone: Model performance may vary across different skin tones
  • Image artifacts: Filters, compression, or editing can distort predictions
  • Context missing: No patient history, lesion evolution, or clinical context
The model outputs a confidence percentage, but high confidence does not guarantee correctness. A 95% confidence prediction may still be wrong.

Classification limitations

The model is restricted to 7 specific lesion types:
  1. Actinic Keratoses
  2. Basal Cell Carcinoma
  3. Benign Keratoses
  4. Dermatofibroma
  5. Melanoma
  6. Melanocytic Nevus
  7. Vascular Lesion
What the model cannot detect:
  • Lesion types not in the training set
  • Normal skin (will force-classify into one of 7 categories)
  • Non-skin objects (will still produce a prediction)
  • Multiple lesions simultaneously (processes whole image)
The model uses softmax output, meaning it always assigns probabilities summing to 100% across the 7 classes, even for completely irrelevant images.

Input constraints

Image requirements:
  • Format: JPEG, PNG, WebP, or other browser-supported formats
  • Size: Any size (automatically resized to 75×100)
  • Color: RGB color images (grayscale may produce unpredictable results)
  • Content: Single lesion centered in frame for best results
Unsupported inputs:
  • Video files (only static images)
  • Dermoscopic images (model trained on standard photography)
  • Infrared or specialized medical imaging
  • Multi-spectral imaging
The model resizes all inputs to 75×100 pixels using nearest neighbor interpolation:
tensorImg = tf.browser.fromPixels(imgtag)
            .resizeNearestNeighbor([75, 100])
            .toFloat().expandDims();
Implications:
  • High-resolution details are lost during downsampling
  • Aspect ratio distortion if original image is not 3:4 ratio
  • Nearest neighbor interpolation may introduce aliasing
  • Very small lesions (less than 10% of image) may lose critical features

Browser and platform limitations

Compatibility constraints

Browser requirements

Modern browsers only (Chrome 57+, Firefox 52+, Safari 11+, Edge 79+)

JavaScript required

Application fails completely if JavaScript is disabled

WebGL recommended

Significantly slower without WebGL support (10x slower on CPU)

Memory requirements

May crash on devices with less than 2 GB RAM

Mobile device constraints

Performance issues:
  • Slower inference (400-1000 ms vs 50-150 ms on desktop)
  • Battery drain during repeated predictions
  • Large initial download (99 MB) on cellular connections
  • May not work on older mobile browsers
Camera integration:
  • Current implementation uses file upload only
  • No real-time camera feed analysis
  • No multi-shot or burst mode support

Network dependencies

First-time load requires internet connection:
  • 99.3 MB model download required
  • Model won’t load on slow/unstable connections
  • Users on metered connections incur data charges
  • Offline use only possible after initial cached load

Privacy and security limitations

Data handling

Current implementation processes images entirely client-side: Privacy positives:
  • Images never uploaded to server
  • No image storage or logging
  • Predictions computed locally
  • HIPAA-compliant processing (no data transmission)
Privacy concerns:
  • No audit trail or prediction logging
  • Cannot review past predictions
  • No data for model improvement or debugging
  • Browser history/cache may retain images locally

Security considerations

Browser-based execution introduces security risks:
  • Model tampering: Malicious actors could modify model.json or weights
  • XSS attacks: Vulnerable if application doesn’t sanitize inputs
  • Supply chain: Dependency on TensorFlow.js CDN integrity
  • No authentication: Anyone can access and use the model
Mitigation strategies:
  • Serve model files over HTTPS only
  • Implement Subresource Integrity (SRI) for TensorFlow.js
  • Use Content Security Policy (CSP) headers
  • Regular security audits of dependencies
Current implementation lacks access controls:
  • Anyone can use the model unlimited times
  • No abuse prevention or rate limiting
  • No usage analytics or monitoring
  • Cannot block malicious users
For production deployments, consider adding authentication and usage tracking.

Image quality limitations

Optimal image characteristics

For best results, images should meet these criteria:
CharacteristicOptimalAcceptablePoor
LightingBright, even, natural lightIndoor lightingDark, shadowy, extreme glare
FocusSharp, clear lesion edgesSlight blurOut of focus, motion blur
DistanceLesion fills 30-70% of frame10-90% of frameLess than 10% or more than 95% of frame
AnglePerpendicular to skin surfaceUp to 30° angleExtreme angles, side views
BackgroundPlain skin surfaceSome hair/skin textureClothing, objects in frame
ResolutionMore than 500px on shortest side200-500pxLess than 200px
The model was trained on dermatological images with specific characteristics. Real-world smartphone photos may differ significantly in quality and composition.

Common image problems

  • Too dark: Cannot distinguish lesion features
  • Too bright: Washed out colors and lost texture
  • Shadows: Creates false boundaries and color variations
  • Flash reflection: Specular highlights obscure lesion
Recommendation: Use natural daylight or soft, diffuse indoor lighting
Heavy JPEG compression can distort lesion characteristics:
  • Blocky artifacts alter texture perception
  • Color banding affects pigmentation analysis
  • Edge distortion impacts border irregularity detection
Recommendation: Use high-quality JPEG (90+) or PNG format
The model’s 75×100 input size creates aspect ratio constraints:
  • Images are stretched/squished to 3:4 aspect ratio
  • Circular lesions may appear elliptical
  • Affects shape-based features in classification
Recommendation: Crop images to ~3:4 aspect ratio before upload

Functional limitations

Missing features

The current implementation lacks several important capabilities: No batch processing:
  • Can only analyze one image at a time
  • No comparison between multiple images
  • Cannot track lesion changes over time
No result history:
  • Predictions disappear on page reload
  • Cannot review or export past results
  • No tracking of prediction confidence trends
No additional context:
  • Cannot input patient age, sex, or history
  • No lesion size measurement
  • No anatomical location consideration
  • No symptom information (itching, bleeding, etc.)
Limited output information:
  • Only provides class name and confidence
  • No explanation of features detected
  • No visualization of what model “sees”
  • No alternative diagnoses or differential considerations

Error handling limitations

Basic error handling may not cover all edge cases:
try {
    if(imgtag.src == ""){
        alert("Select an Image to Classify")
        return
    }
    // ... prediction code
} catch(error) {
    alert("Error Classifying Image")
}
Unhandled scenarios:
  • Model load failure (shows generic error)
  • Out of memory errors on low-end devices
  • Corrupted or malformed image files
  • Very large images causing browser freeze
  • Network timeout during model download

Ethical and bias limitations

Algorithmic bias concerns

Machine learning models can perpetuate biases present in training data.
Potential bias sources:
  • Skin tone: Model may perform better on lighter skin tones if training data is imbalanced
  • Demographics: Age, sex, and ethnicity representation in training set unknown
  • Geographic: Lesions more common in certain populations may be underrepresented
  • Image source: Medical vs. consumer photos may have different characteristics
Transparency limitations:
  • Training dataset composition not documented in codebase
  • No per-demographic accuracy metrics available
  • Cannot verify fairness across protected groups

Responsible AI considerations

Deployment of this model requires careful consideration:
Current implementation may exclude users:
  • No screen reader support for predictions
  • Color-dependent UI may not work for colorblind users
  • No keyboard navigation support
  • Requires manual file upload (no voice input)
  • English-only interface and class names
Legal Disclaimer: Using this tool for medical diagnosis may violate healthcare regulations in many jurisdictions.

Compliance requirements for medical use

To legally deploy as a medical device, would require:
  • FDA 510(k) clearance or De Novo classification (USA)
  • CE marking under MDR (European Union)
  • Clinical validation studies
  • Quality management system (ISO 13485)
  • Post-market surveillance and adverse event reporting
  • Labeling and instructions for use
Current status: None of the above are implemented

Liability and risk

Developers and deployers may face legal liability if:
  • Application is marketed as a diagnostic tool
  • Users delay medical care based on predictions
  • Misdiagnosis leads to patient harm
  • Privacy breaches occur (even if client-side)
  • Regulatory requirements are not met

Future improvements

Recognized limitations that could be addressed in future versions:
  1. Model validation: Comprehensive accuracy testing across demographics
  2. Explainability: Grad-CAM or attention maps showing decision factors
  3. Uncertainty quantification: Bayesian approaches to estimate prediction confidence
  4. Expanded classes: Support for more lesion types and “unknown” category
  5. Quality checks: Automatic image quality assessment before prediction
  6. Temporal analysis: Track lesion changes over multiple images
  7. Accessibility: WCAG 2.1 AA compliance for interface
  8. Mobile optimization: Native apps with camera integration
  9. Offline-first: Service worker for full offline capability
  10. Federated learning: Privacy-preserving model improvements from user data
Contributions and improvements are welcome. See the project repository for development guidelines.

Build docs developers (and LLMs) love