High-Performance Computational Framework for Skin Diffusion Modeling
Advanced numerical simulation using Generalized Finite Differences for biomedical applications
- Overview
- Features
- Installation & Setup
- Quick Start
- Visualizations
- Project Architecture
- Mathematical Model
- Dataset Structure
- Performance Benchmarks
- Research Team
- Citation & License
- Contact
This repository presents a state-of-the-art computational framework for modeling substance diffusion in biological tissues using the Generalized Finite Differences (GFD) method. The simulator provides high-performance solutions for studying drug delivery, cosmetic penetration, and biomedical transport phenomena in skin layers.
- 🧬 Biological Modeling: 2D transient diffusion equation solver for skin tissue simulation
- ⚡ High-Performance Computing: Numba JIT compilation for maximum computational efficiency
- 🎯 Scientific Accuracy: GFD method implementation for irregular mesh handling
- 🔄 Automated Dataset Generation: Parallel processing for large-scale parameter studies
- 📊 Advanced Visualization: Comprehensive plotting and analysis tools
| Field | Application | Use Case |
|---|---|---|
| Pharmacology 💊 | Drug Delivery | Transdermal absorption studies, dosage optimization |
| Cosmetics 💄 | Skin Penetration | Formulation analysis, safety assessment |
| Dermatology 🏥 | Clinical Research | Pathological transport, treatment efficacy |
| Biomedical Engineering ⚙️ | Device Design | Patch development, delivery system optimization |
| Machine Learning 🤖 | AI Training | Dataset generation, pattern recognition |
- 2D Transient Diffusion Solver: GFD implementation with 9-point stencil
- Flexible Boundary Conditions: Mixed Dirichlet-Neumann conditions for realistic modeling
- Adaptive Time Stepping: CFL condition enforcement for numerical stability
- Irregular Mesh Support: GFD method handles complex geometries
- Numba JIT Compilation: Just-in-time optimization for critical functions
- Vectorized Operations: NumPy-based efficient array computations
- Memory Optimization: Efficient data structures for large-scale simulations
- Parallel Processing: Multi-core support for dataset generation
- Massive Dataset Creation: 360,000+ simulation images
- Parameter Space Exploration: Systematic variation of diffusion coefficients and initial conditions
- Automated Data Management: Hierarchical organization and compression
- Scientific Visualization: Advanced plotting with Matplotlib
- Skin Layer Modeling: Realistic tissue geometry representation
- Substance Transport: Drug, cosmetic, and chemical diffusion simulation
- Clinical Validation: Framework for experimental data comparison
- Predictive Modeling: Machine learning dataset preparation
| Component | Minimum | Recommended |
|---|---|---|
| Python | 3.8+ | 3.9+ |
| RAM | 8 GB | 16 GB+ |
| CPU | 4 cores | 8+ cores |
| Storage | 5 GB | 25 GB+ (for datasets) |
| OS | Windows/Linux/macOS | Linux (optimal performance) |
# Core scientific computing
numpy >= 1.19.0 # Numerical computations
scipy >= 1.7.0 # Scientific algorithms
matplotlib >= 3.3.0 # Scientific plotting
numba >= 0.54.0 # JIT compilation
tqdm >= 4.62.0 # Progress bars# Method 1: Direct installation
git clone https://github.com/gstinoco/Skin-Diffusion-GFD.git
cd GFD-Skin-ML
pip install -r requirements.txt
# Method 2: Virtual environment (recommended)
python -m venv skin_diffusion_env
source skin_diffusion_env/bin/activate # On Windows: skin_diffusion_env\Scripts\activate
pip install -r requirements.txt
# Method 3: Conda environment
conda create -n skin_gfd python=3.9
conda activate skin_gfd
pip install -r requirements.txt# Test installation
python -c "import numpy, scipy, matplotlib, numba; print(':white_check_mark: Installation successful!')"
# Run quick demo
python GFD_skin.py# Run basic skin diffusion simulation
python GFD_skin.py# Generate complete training datasets
python create_dataset.py# Custom mesh resolution (modify in GFD_skin.py)
# Available meshes: skin224.mat, skin256.mat
# Parameter exploration
# Modify diffusion coefficient (nu) and initial concentration (ci) in main()
# Memory optimization for large datasets
# Adjust batch sizes in create_dataset.py# Standard resolution meshes
region/skin224.mat # 224×224 nodes, ~50K points
region/skin256.mat # 256×256 nodes, ~65K points
# Original skin layer
region/skin_base.png # Base for the geometriesConcentration Initial = 100 | Different Diffusion Coefficients
Low Diffusion Coefficient (
Medium Diffusion Coefficient (
High Diffusion Coefficient (
📊 Dataset Scale: Over 360,000 simulations across 100 initial conditions and 900 diffusion coefficients for two mesh resolutions
:package: GFD-Skin-ML/
├── GFD_skin.py # Main simulator module
│ ├── difusion_skin_jit() # JIT-optimized solver
│ ├── difusion_skin() # Vectorized solver
│ ├── Gammas() # GFD coefficient calculator
│ └── main() # Workflow orchestrator
│
├── create_dataset.py # Automated dataset generation
│ ├── Parallel processing support # Multi-core optimization
│ ├── Parameter space exploration # Systematic variation
│ ├── Automated data management # File organization
│ └── Memory optimization # Efficient resource usage
│
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
│
├── region/ # Computational mesh library
│ ├── skin224.mat # Standard resolution mesh ($224 \times 224$)
│ ├── skin256.mat # High resolution mesh ($256 \times 256$)
│ ├── skin_base.png # Geometry visualization
│ └── red files/ # Mesh generation files
│
├── Dataset/ # Generated simulation datasets
│ ├── skin224_ci/ # $224 \times 224$, varying initial concentration
│ ├── skin224_nu/ # $224 \times 224$, varying diffusion coefficient
│ ├── skin256_ci/ # $256 \times 256$, varying initial concentration
│ └── skin256_nu/ # $256 \times 256$, varying diffusion coefficient
│
└── docs/ # Documentation and examples
└── visualizations/ # Sample visualization gallery
├── comparison_nu_1e8_ci100.png # Low diffusion coefficient example
├── comparison_nu_450e8_ci100.png # Medium diffusion coefficient example
└── comparison_nu_900e8_ci100.png # High diffusion coefficient example
The simulator solves the 2D transient diffusion equation:
Where:
-
$u(x,y,t)$ : Concentration field [mg/L] -
$\nu$ : Diffusion coefficient [m²/s] -
$\nabla^2$ : Laplacian operator -
$t$ : Time [s]
| Component | Method | Description |
|---|---|---|
| Spatial Discretization | Generalized Finite Differences (GFD) | 9-point stencil for irregular meshes |
| Temporal Integration | Explicit Euler | First-order time stepping |
| Boundary Conditions | Mixed Dirichlet-Neumann | Inlet concentration + zero-flux boundaries |
| Stability | CFL Condition | Automatic time step adjustment |
-
Inlet (Dirichlet):
$u = c_i$ (prescribed concentration) -
Boundaries (Neumann):
$\frac{\partial u}{\partial n} = 0$ (zero flux) -
Initial Condition:
$u(x,y,0) = 0$ (clean tissue)
The generated datasets follow a hierarchical organization:
Dataset/
├── skin224_ci/ # $224 \times 224$ mesh, varying initial concentration
│ ├── ci_001/ # Initial concentration = 0.01 (900 images)
│ │ ├── nu_0.00000001.png
│ │ ├── nu_0.00000002.png
│ │ └── ... (900 files)
│ ├── ci_002/ # Initial concentration = 0.02 (900 images)
│ ├── ...
│ └── ci_100/ # Initial concentration = 1.00 (900 images)
├── skin224_nu/ # $224 \times 224$ mesh, varying diffusion coefficient
│ ├── nu_0.00000001/ # Diffusion coefficient = 1×10⁻⁸ (100 images)
│ │ ├── ci_001.png
│ │ ├── ci_002.png
│ │ └── ... (100 files)
│ ├── nu_0.00000002/ # Diffusion coefficient = 2×10⁻⁸ (100 images)
│ ├── ...
│ └── nu_0.00000900/ # Diffusion coefficient = 900×10⁻⁸ (100 images)
├── skin256_ci/ # $256 \times 256$ mesh, varying initial concentration
│ ├── ci_001/ # Initial concentration = 0.01 (900 images)
│ ├── ci_002/ # Initial concentration = 0.02 (900 images)
│ ├── ...
│ └── ci_100/ # Initial concentration = 1.00 (900 images)
└── skin256_nu/ # $256 \times 256$ mesh, varying diffusion coefficient
├── nu_0.00000001/ # Diffusion coefficient = 1×10⁻⁸ (100 images)
├── nu_0.00000002/ # Diffusion coefficient = 2×10⁻⁸ (100 images)
├── ...
└── nu_0.00000900/ # Diffusion coefficient = 900×10⁻⁸ (100 images)
- Total Images: 360,000 PNG files
- Storage: ~15-20 GB uncompressed
-
Parameters: 100 initial concentrations
$\times$ 900 diffusion coefficients per resolution -
Resolutions:
$224 \times 224$ and$256 \times 256$ pixels
| Use Case | Dataset Type | Description |
|---|---|---|
| Machine Learning Training 🤖 | Complete Dataset | 360K images for deep learning |
| Parameter Studies 📈 | Subset Analysis | Specific parameter ranges |
| Validation ✅ | Test Sets | Independent validation data |
| Benchmarking 🏆 | Reference Solutions | Standard test cases |
| Mesh Size | Nodes | Time Steps | JIT Solver | Vectorized Solver | Memory Usage |
|---|---|---|---|---|---|
| 50,176 | 1,000 | ~4.5s | ~12.3s | ~2.1 GB | |
| 50,176 | 10,000 | ~45s | ~123s | ~2.1 GB | |
| 65,536 | 1,000 | ~6.5s | ~18.7s | ~2.8 GB | |
| 65,536 | 10,000 | ~65s | ~187s | ~2.8 GB |
Benchmarks: Intel i7-8700K @ 3.70GHz, 32GB RAM, Python 3.9
| Optimization | Speedup | Description |
|---|---|---|
| Numba JIT | 3-4x | Just-in-time compilation of critical loops |
| Vectorization | 2-3x | NumPy array operations |
| Memory Layout | 1.5x | Contiguous array storage |
| Parallel Processing | Nx | Multi-core dataset generation |
# Performance scaling with problem size
Nodes vs Time: O(N log N) # Near-linear scaling
Memory vs Nodes: O(N) # Linear memory usage
Parallel Efficiency: 85-90% # Multi-core performance|
Dr. Gerardo Tinoco Guerrero 🇲🇽
|
Dr. Francisco Javier Domínguez Mota 🇲🇽
|
Dr. José Alberto Guzmán Torres 🇲🇽
|
Ángel Emeterio Calvillo Vázquez 🇲🇽
- 🎯 Graduate Student
- 🏛️ Universidad Michoacana de San Nicolás de Hidalgo
- 🔬 Computational Biology & Numerical Simulation
- 📧 1025501x@umich.mx
- 🌐 ORCID
- 💼 Research Focus: Skin diffusion modeling and machine learning applications
- Tinoco-Guerrero, G., Domínguez-Mota, F. J., Guzmán-Torres, J. A., & Tinoco-Ruiz, J. G. (2022). "Numerical Solution of Diffusion Equation using a Method of Lines and Generalized Finite Differences." Revista Internacional de Métodos Numéricos para Cálculo y Diseño en Ingeniería, 38(2). DOI: 10.23967/j.rimni.2022.06.003
- 360,000+ Simulation Dataset: Largest publicly available skin diffusion dataset
- High-Performance Implementation: 3-4x speedup with Numba JIT optimization
- Open Source Framework: MIT licensed for academic and commercial use
- Cross-Platform Compatibility: Windows, Linux, macOS support
If you use this software in your research, please cite:
@software{gfd_skin_simulator_2025,
title={Skin Diffusion Simulator with GFD: High-Performance Computational Framework
for Biomedical Transport Modeling},
author={Tinoco-Guerrero, Gerardo and
Domínguez-Mota, Francisco Javier and
Guzmán-Torres, José Alberto and
Calvillo-Vázquez, Ángel Emeterio},
year={2025},
institution={Universidad Michoacana de San Nicolás de Hidalgo},
organization={SIIIA MATH: Soluciones en ingeniería},
url={https://github.com/gstinoco/Skin-Diffusion-GFD},
note={Advanced computational framework for skin diffusion modeling using
Generalized Finite Differences method}
}Primary Funding:
- 🎓 Universidad Michoacana de San Nicolás de Hidalgo (UMSNH)
- 🏢 SIIIA MATH: Soluciones en ingeniería
This project is licensed under the MIT License - see the full license text below:
MIT License
Copyright (c) 2025 Gerardo Tinoco-Guerrero, Francisco Javier Domínguez-Mota,
José Alberto Guzmán-Torres, Ángel Emeterio Calvillo-Vázquez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Academic Use: This software is developed for research and educational purposes. Commercial use is permitted under the MIT License terms.
Primary Contact:
- Dr. Gerardo Tinoco Guerrero
- 📧 gerardo.tinoco@umich.mx
- 🏢 SIIIA MATH: Soluciones en ingeniería
- 🏛️ Universidad Michoacana de San Nicolás de Hidalgo
- 📍 Morelia, Michoacán, México
For technical questions and issues:
- GitHub Issues: Create an issue for bug reports or feature requests
- Email Support: Contact the research team for complex technical inquiries
- Academic Collaboration: Reach out for research partnerships and joint projects
We welcome collaborations in:
- Biomedical Engineering: Transdermal delivery systems, medical device design
- Machine Learning: AI-driven analysis of diffusion patterns, predictive modeling
- Numerical Methods: Advanced discretization techniques, solver optimization
- Clinical Research: Validation with experimental data, clinical applications
- Pharmaceutical Research: Drug delivery optimization, formulation studies
- Graduate Programs: Contact Dr. Tinoco for research opportunities
- Undergraduate Projects: Available thesis topics in computational biology
- Internships: Summer research programs in scientific computing
- SIIIA MATH: Soluciones en ingeniería
- UMSNH: Universidad Michoacana de San Nicolás de Hidalgo
- Research Group: Numerical Methods and Scientific Computing
⭐ If this project helps your research, please consider giving it a star! ⭐
Advancing biomedical science through computational innovation


