MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

Performance analysis in math skills especially for the gender difference using fMRI image data.

Created 7/17/2025
Updated 4 days ago
Repository documentation and setup instructions

MCP-fMRI: Ethical Analysis of Mathematical Abilities Using Generative AI

Performance analysis in mathematical skills with emphasis on gender similarities using fMRI neuroimaging data and generative AI techniques - focused on Japanese populations

License: MIT Python 3.8+ Code style: black

🎯 Research Objectives

This project investigates the neural mechanisms underlying mathematical cognition using advanced generative AI techniques applied to functional MRI (fMRI) data. Our approach emphasizes similarities over differences and promotes ethical AI practices in neuroimaging research.

Primary Goals

  • Investigate neural mechanisms underlying mathematical cognition in Japanese populations
  • Emphasize gender similarities rather than differences in mathematical abilities
  • Apply generative AI to enhance fMRI analysis capabilities and address small dataset challenges
  • Integrate cultural context specific to Japanese sociocultural factors
  • Establish ethical guidelines for AI-based gender difference research in neuroimaging

Research Philosophy

We follow evidence-based approaches showing that gender similarities dominate mathematical cognition at the neural level, particularly in early development stages.

🌊 NEW: Wavelet Analysis for Brain Activation Detection

🧠 Advanced Time-Frequency Analysis

We've added comprehensive wavelet analysis capabilities specifically designed for detecting brain regions activated during mathematical tasks:

Key Features:

  • Multi-scale time-frequency decomposition of BOLD signals using Morlet wavelets
  • Frequency band analysis targeting cognitive networks:
    • Very slow (0.01-0.03 Hz): Default mode network
    • Slow (0.03-0.06 Hz): Executive control
    • Medium (0.06-0.12 Hz): Attention networks
    • Fast (0.12-0.25 Hz): Task-related activity
  • Statistical significance mapping with ethical reporting
  • Interactive 3D brain visualizations showing activation patterns
  • Cross-frequency coupling analysis for network connectivity

Quick Start with Wavelet Analysis:

from src.wavelet_analysis import WaveletfMRIAnalyzer
from src.brain_visualization import BrainActivationVisualizer

# Initialize analyzer with ethical reporting
analyzer = WaveletfMRIAnalyzer(wavelet='morlet', ethical_reporting=True)

# Load fMRI data (NIfTI file or synthetic demo data)
time_series = analyzer.load_fmri_data(nifti_path='your_data.nii.gz')

# Analyze mathematical task activation
results = analyzer.analyze_math_activation(
    task_onsets=[30, 80, 130, 180],  # When math problems were presented
    baseline_duration=10.0,           # Baseline period (seconds)
    activation_duration=15.0          # Analysis window (seconds)
)

# Detect activated brain regions
regions = analyzer.detect_math_regions(threshold_percentile=95)

# Create comprehensive visualizations
analyzer.visualize_results()

# Generate interactive 3D brain map
visualizer = BrainActivationVisualizer()
brain_3d = visualizer.create_interactive_3d_brain(results)
brain_3d.show()

Command Line Interface:

# Basic wavelet analysis with synthetic data
python run_wavelet_analysis.py --output results/ --visualize

# Analysis with real fMRI data
python run_wavelet_analysis.py --input data.nii.gz --mask brain_mask.nii.gz --output results/

# Full analysis with interactive visualizations
python run_wavelet_analysis.py --input data.nii.gz --output results/ --visualize --interactive

# Custom parameters for Japanese mathematical cognition study
python run_wavelet_analysis.py \
    --onsets 30,80,130,180 \
    --baseline 15 \
    --duration 20 \
    --threshold 95 \
    --export-json \
    --save-report

Example Notebook:

📓 Complete Wavelet Analysis Tutorial


🧠 Scientific Background

Current Research Context

Recent meta-analyses and neuroimaging studies provide compelling evidence:

  • Gender similarities hypothesis: Large-scale studies show more similarities than differences in mathematical cognition (Hyde et al., 2008)
  • Neural similarity findings: fMRI studies in children (3-10 years) show no significant gender differences in mathematical brain activation (Kersey et al., 2019)
  • Cultural factors: Japanese children may acquire gender stereotypes later than Western populations, suggesting environmental influences (Tatsuno et al., 2022)
  • Generative AI potential: Recent advances in neuroimaging AI show promise for understanding brain function (DuPre & Poldrack, 2024)

Key Findings from Literature

  1. Behavioral similarities: Meta-analyses of 242 studies (1.3M participants) show minimal gender differences in math performance
  2. Neural similarities: Whole-brain analyses reveal more commonalities than differences
  3. Cultural influence: Sociocultural factors significantly impact observed patterns
  4. Individual variation: Individual differences exceed group-level differences

🔬 Methodology

Enhanced Analysis Framework with Wavelet Decomposition

graph TD
    A[fMRI Data Collection] --> B[Ethical Preprocessing]
    B --> C[Wavelet Time-Frequency Analysis]
    C --> D[Multi-Band Activation Detection]
    D --> E[Similarity Detection Models]
    E --> F[Cultural Context Integration]
    F --> G[Generative AI Enhancement]
    G --> H[Interactive Visualization]
    H --> I[Ethical Reporting]

Technical Approach

  1. Data Preprocessing

    • Standard fMRI preprocessing pipelines
    • Quality control with bias detection
    • Cultural demographic integration
  2. Wavelet Analysis Pipeline

    • Continuous wavelet transform using Morlet wavelets
    • Multi-frequency band decomposition
    • Statistical significance testing
    • Cross-frequency coupling analysis
  3. Similarity-Focused Models

    • Variational Autoencoders (VAE) for feature learning
    • Similarity detection neural networks
    • Connectivity-based analysis
  4. Generative AI Components

    • Data augmentation to address small sample sizes
    • Synthetic data generation for validation
    • Transfer learning across populations
  5. Ethical AI Framework

    • Bias mitigation techniques
    • Interpretability-first design
    • Cultural sensitivity integration

📊 Live Research Dashboard & Results Summary

🎌 View Japan-Focused Interactive Dashboard

Our sophisticated research dashboard provides real-time quantitative insights focused on Japanese populations:

| 🧠 Neural Similarity | 📊 Performance Overlap | 🎯 Cultural Context | 🤖 AI Classification | |:------------------------:|:---------------------------:|:------------------------:|:------------------------:| | 89.1% | 91.2% | 0.724 | 53.8% | | p = 0.734 (NS) | High similarity | p < 0.05 | Near chance |


🔬 Key Research Findings Summary

🎌 Japan-Specific Results

  • PIAAC Numeracy Score: 291 (3rd globally)
  • Gender Gap: d = 0.15 (small effect)
  • Neural Similarity: 89.1% across brain regions
  • STEM Participation: 17% female (structural barriers)
  • Cultural Influence: Significant (p = 0.028)

🌍 International Context

  • Japan vs Finland: Similar abilities, different outcomes
  • Collectivist culture shows unique patterns
  • Late stereotype acquisition (vs Western countries)
  • High mathematical competence, low career participation
  • Environmental > biological factors

📈 Statistical Evidence Dashboard

🧠 NEURAL ANALYSIS          📊 BEHAVIORAL MEASURES        🎌 CULTURAL FACTORS
┌─────────────────────┐    ┌─────────────────────────┐    ┌─────────────────────┐
│ Similarity: 89.1%   │    │ Performance Overlap:    │    │ Collectivist Score: │
│ p-value: 0.734      │    │ 91.2%                   │    │ 0.724 (p < 0.05)    │
│ Effect Size: d=0.05 │    │ PIAAC Score: 291        │    │ Education System:   │
│ AI Accuracy: 53.8%  │    │ Gender Gap: 12 points   │    │ High similarity     │
└─────────────────────┘    └─────────────────────────┘    └─────────────────────┘

🎯 Research Impact Indicators

| Metric | Value | Significance | Interpretation | |:-----------|:---------:|:----------------:|:-------------------| | 🧠 Gender Similarity Index | 0.891 | p > 0.05 (NS) | High neural similarity | | 📊 Individual:Group Variation | 3.2:1 | p < 0.001 *** | Individual differences dominate | | 🎌 Cultural Influence Score | 0.724 | p < 0.05 * | Significant environmental factors | | 🤖 AI Classification Rate | 53.8% | Near chance | Minimal distinguishable patterns | | 📈 Performance Overlap | 91.2% | - | Substantial capability similarity |

NS = Non-significant, * p < 0.05, *** p < 0.001

Dashboard features sophisticated visualizations emphasizing the scientific value of null findings and gender similarities in Japanese mathematical cognition research.

Expected Outcomes

Based on current literature, we expect to find:

  • Minimal gender differences in mathematical cognition neural patterns
  • High individual variability exceeding group differences
  • Cultural factors influencing any observed patterns
  • Generative AI benefits for small neuroimaging datasets

Deliverables

  • 📈 Interactive research dashboard with quantitative metrics
  • 📊 Similarity-focused analysis pipeline
  • 🌊 Wavelet analysis toolkit for brain activation detection
  • 🤖 Generative AI models for fMRI enhancement
  • 📋 Ethical guidelines for gender difference research
  • 🎌 Cultural context framework for Japanese populations
  • 📄 Reproducible analysis workflows

🚀 Getting Started

Prerequisites

# Python 3.8+ required
python --version

# Install dependencies (including wavelet analysis libraries)
pip install -r requirements.txt

# Or using conda
conda env create -f environment.yml
conda activate mcp-fmri

Installation

# Clone the repository
git clone https://github.com/Tatsuru-Kikuchi/MCP-fMRI.git
cd MCP-fMRI

# Install package in development mode
pip install -e .

# Run tests
pytest tests/

Quick Start Example

from src.analysis.gender_analysis import fMRIGenderAnalysis

# Initialize with ethical guidelines
analyzer = fMRIGenderAnalysis(ethical_guidelines=True)

# Load your fMRI data
brain_data, demographics = analyzer.load_fmri_data(
    subject_files=your_nifti_files,
    demographics=your_demographics_df
)

# Focus on similarities
model, history = analyzer.analyze_gender_similarities()

# Generate ethical report
report = analyzer.generate_report()

🎌 Cultural Considerations: Japanese Context

Specific Factors

  • Educational system: Emphasis on collective achievement over individual competition
  • Gender role evolution: Changing perceptions of STEM careers for women
  • Stereotype acquisition: Later development of gender-math stereotypes compared to Western populations
  • Collectivist culture: Impact on individual vs. group identity in mathematical performance

Research Implications

  • Consider collectivist vs. individualist cultural frameworks
  • Integrate Japanese educational philosophy in interpretation
  • Account for changing social norms around gender roles
  • Include socioeconomic and regional diversity within Japan

📖 Ethical Guidelines

Core Principles

🔸 Similarity Emphasis: Prioritize identification of commonalities over differences 🔸 Bias Mitigation: Implement technical and methodological bias reduction 🔸 Individual Focus: Emphasize individual variation over group generalizations 🔸 Cultural Sensitivity: Integrate cultural context in all analyses 🔸 Transparency: Ensure all methods and assumptions are clearly documented 🔸 Non-discrimination: Results should never justify educational or occupational discrimination

Implementation

  • All models trained with similarity-detection objectives
  • Bias testing integrated into analysis pipeline
  • Cultural factors included as covariates
  • Results interpreted with individual differences emphasized
  • Reporting templates emphasize ethical considerations

🛠️ Technical Architecture

System Components

📁 MCP-fMRI/
├── 🧠 Neural Models (VAE, Similarity Networks)
├── 🌊 Wavelet Analysis (Time-frequency decomposition, activation detection)
├── 📊 Data Processing (fMRI preprocessing, quality control)
├── 🎯 Analysis Framework (Similarity detection, cultural integration)
├── 🎨 Visualization (Brain plots, similarity metrics, interactive 3D)
├── 📋 Ethical Tools (Bias detection, reporting templates)
└── 🔬 Validation (Statistical testing, reproducibility)

Key Technologies

  • PyWavelets: Wavelet analysis and time-frequency decomposition
  • Nilearn: Neuroimaging analysis and brain visualization
  • TensorFlow/Keras: Deep learning models
  • Scikit-learn: Traditional ML algorithms
  • Plotly/Matplotlib: Interactive visualizations
  • Pandas/NumPy: Data manipulation

📚 References & Literature

Key Papers Supporting Similarity-Focused Approach

  1. Kersey, A.J., et al. (2019). "Gender similarities in the brain during mathematics development." npj Science of Learning, 4(1), 1-10.

  2. Hyde, J.S., et al. (2008). "Gender similarities characterize math performance." Science, 321(5888), 494-495.

  3. Chen, L., et al. (2025). "Understanding gender differences in reasoning using meta-analysis of neuroimaging." Frontiers in Behavioral Neuroscience, 18:1457663.

  4. Chang, H., et al. (2022). "Uncovering sex/gender differences of arithmetic in the human brain: Insights from fMRI studies." Brain and Behavior, 12(10), e2775.

Cultural Context References

  1. Tatsuno, T., et al. (2022). "Gender stereotypes about intellectual ability in Japanese children." Scientific Reports, 12(1), 1-12.

Generative AI in Neuroimaging

  1. DuPre, E., & Poldrack, R.A. (2024). "The future of data analysis: Integrating generative AI in neuroimaging methods development." Imaging Neuroscience, 2, 1-8.

🤝 Contributing

We welcome contributions that align with our ethical research principles:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/ethical-enhancement)
  3. Commit changes (git commit -am 'Add similarity-focused analysis')
  4. Push to branch (git push origin feature/ethical-enhancement)
  5. Submit a Pull Request

Contribution Guidelines

  • All contributions must align with ethical AI principles
  • Code should emphasize similarities over differences
  • Documentation must include cultural considerations
  • Tests should include bias detection

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Neuroimaging community for open science practices
  • Ethical AI researchers for bias mitigation frameworks
  • Japanese research institutions for cultural context insights
  • Open source contributors for neuroimaging tools

📞 Contact & Support


🔍 Quick Navigation


⚠️ Important Note: This research emphasizes gender similarities in mathematical cognition and should not be used to justify any form of discrimination or stereotype reinforcement. All findings should be interpreted within their cultural context and with emphasis on individual differences over group generalizations.

Quick Setup
Installation guide for this server

Installation Command (package not published)

git clone https://github.com/Tatsuru-Kikuchi/MCP-fMRI
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.

Cursor configuration (mcp.json)

{ "mcpServers": { "tatsuru-kikuchi-mcp-fmri": { "command": "git", "args": [ "clone", "https://github.com/Tatsuru-Kikuchi/MCP-fMRI" ] } } }