【2026年90%导师认可】基于Hadoop+Spark的青光眼数据可视化分析系统详解 毕业设计/选题推荐/毕设选题/数据分析

38 阅读10分钟

计算机编程指导师

⭐⭐个人介绍:自己非常喜欢研究技术问题!专业做Java、Python、小程序、安卓、大数据、爬虫、Golang、大屏、爬虫、深度学习、机器学习、预测等实战项目。

⛽⛽实战项目:有源码或者技术上的问题欢迎在评论区一起讨论交流!

⚡⚡如果遇到具体的技术问题或计算机毕设方面需求,你也可以在主页上咨询我~~

⚡⚡获取源码主页--> space.bilibili.com/35463818075…

青光眼数据可视化分析系统- 简介

基于Hadoop+Spark的青光眼数据可视化分析系统是一个集成大数据处理与医疗数据分析于一体的综合性平台。该系统利用Hadoop分布式文件系统(HDFS)存储大规模青光眼患者数据,通过Spark分布式计算框架实现高效的数据处理和分析。系统采用Python作为主要开发语言,结合Django框架构建稳定的后端服务,前端使用Vue+ElementUI+Echarts技术栈打造直观的用户交互界面。在数据分析层面,系统运用Spark SQL进行复杂查询,配合Pandas和NumPy进行精确的数值计算和统计分析。功能涵盖患者人口学特征分析、核心临床指标关联分析以及疾病诊断风险因素分析三大维度,能够对眼压(IOP)、杯盘比(CDR)、OCT检查结果等关键医疗指标进行深度挖掘。系统通过多维度数据可视化展示,帮助医疗工作者直观了解青光眼患者群体特征,识别高风险人群,为临床诊断和治疗决策提供数据支撑。整个系统架构设计合理,技术栈成熟稳定,具备良好的扩展性和实用性。  

青光眼数据可视化分析系统-技术 框架

开发语言:Python或Java(两个版本都支持)

大数据框架:Hadoop+Spark(本次没用Hive,支持定制)

后端框架:Django+Spring Boot(Spring+SpringMVC+Mybatis)(两个版本都支持)

前端:Vue+ElementUI+Echarts+HTML+CSS+JavaScript+jQuery

详细技术点:Hadoop、HDFS、Spark、Spark SQL、Pandas、NumPy

数据库:MySQL 

青光眼数据可视化分析系统- 背景

青光眼作为全球第二大致盲性眼病,其隐匿性强、不可逆性的特点使得早期筛查和精准诊断显得尤为重要。随着医疗信息化程度不断提高,各大医院积累了大量青光眼患者的检查数据,包括眼压测量、视野检查、OCT扫描等多维度信息。这些数据蕴含着丰富的医学价值,但传统的数据处理方式往往局限于简单的统计分析,难以发现数据间的深层关联和潜在规律。与此同时,大数据技术的快速发展为医疗数据分析带来了新的机遇,Hadoop和Spark等分布式计算框架能够高效处理海量医疗数据,挖掘出传统方法无法识别的有价值信息。医疗机构迫切需要一套能够整合多源异构数据、实现智能化分析的青光眼数据分析平台,以提升疾病诊断的准确性和效率。在这样的背景下,开发基于大数据技术的青光眼数据可视化分析系统成为了一个具有实际需求和技术可行性的课题。

本课题的研究意义体现在多个层面的实际应用价值。从医疗实践角度来看,系统能够通过大数据分析技术揭示青光眼患者群体的流行病学特征,帮助医生更好地理解疾病发展规律,为制定个性化的诊疗方案提供参考依据。通过对眼压、杯盘比、OCT检查结果等关键指标的关联性分析,系统可以辅助医生识别高风险患者,提高早期筛查的精准度。从技术应用角度来说,系统展示了大数据技术在医疗健康领域的具体应用场景,为相关技术的推广和普及提供了实践案例。从教育培养角度考虑,本项目将大数据处理、数据可视化、医疗信息学等多个知识领域有机结合,为计算机专业学生提供了一个综合性的学习平台,有助于培养学生解决实际问题的能力。虽然作为毕业设计项目,系统在功能完整性和技术复杂度上相对有限,但其所体现的跨学科思维和技术整合能力对于培养复合型人才具有积极意义。  

青光眼数据可视化分析系统-视频展示

www.bilibili.com/video/BV1Ve…

青光眼数据可视化分析系统-图片展示

登录.png

封面.png

核心临床指标分析.png

患者群体画像分析.png

疾病风险因素分析.png

青光眼数据.png

青光眼亚型分析.png

数据大屏上.png

数据大屏下.png

用户.png

症状用药分析.png  

青光眼数据可视化分析系统-代码展示

from pyspark.sql.functions import col, count, avg, when, desc, asc, sum as spark_sum
from pyspark.sql.types import StructType, StructField, StringType, IntegerType, DoubleType
import pandas as pd
import numpy as np
from django.http import JsonResponse
from django.views import View
import json

spark = SparkSession.builder.appName("GlaucomaAnalysis").master("local[*]").getOrCreate()

class PatientDemographicsAnalysis(View):
    def post(self, request):
        try:
            data = json.loads(request.body)
            analysis_type = data.get('analysis_type', 'age_distribution')
            df = spark.read.option("header", "true").option("inferSchema", "true").csv("hdfs://localhost:9000/glaucoma_data/patient_data.csv")
            if analysis_type == 'age_distribution':
                age_groups = df.withColumn("age_group", 
                    when(col("Age") < 30, "青年").
                    when(col("Age") < 50, "中年").
                    otherwise("老年"))
                age_stats = age_groups.groupBy("age_group", "Diagnosis").agg(count("*").alias("count")).collect()
                result_data = []
                for row in age_stats:
                    result_data.append({
                        'age_group': row['age_group'],
                        'diagnosis': row['Diagnosis'],
                        'count': row['count']
                    })
                total_patients = df.count()
                age_distribution = age_groups.groupBy("age_group").agg(count("*").alias("total")).collect()
                for row in age_distribution:
                    percentage = (row['total'] / total_patients) * 100
                    for item in result_data:
                        if item['age_group'] == row['age_group']:
                            item['percentage'] = round(percentage, 2)
            elif analysis_type == 'gender_diagnosis':
                gender_stats = df.groupBy("Gender", "Diagnosis").agg(count("*").alias("count")).collect()
                result_data = []
                for row in gender_stats:
                    result_data.append({
                        'gender': row['Gender'],
                        'diagnosis': row['Diagnosis'],
                        'count': row['count']
                    })
                total_by_gender = df.groupBy("Gender").agg(count("*").alias("total")).collect()
                gender_dict = {row['Gender']: row['total'] for row in total_by_gender}
                for item in result_data:
                    total = gender_dict.get(item['gender'], 1)
                    item['rate'] = round((item['count'] / total) * 100, 2)
            else:
                medical_history_stats = df.groupBy("medical_history", "Diagnosis").agg(count("*").alias("count")).collect()
                result_data = []
                for row in medical_history_stats:
                    if row['medical_history'] and row['medical_history'] != 'None':
                        result_data.append({
                            'medical_history': row['medical_history'],
                            'diagnosis': row['Diagnosis'],
                            'count': row['count']
                        })
                history_totals = df.filter(col("medical_history").isNotNull() & (col("medical_history") != "None")).groupBy("medical_history").agg(count("*").alias("total")).collect()
                history_dict = {row['medical_history']: row['total'] for row in history_totals}
                for item in result_data:
                    total = history_dict.get(item['medical_history'], 1)
                    item['prevalence_rate'] = round((item['count'] / total) * 100, 2)
            return JsonResponse({
                'status': 'success',
                'data': result_data,
                'analysis_type': analysis_type
            })
        except Exception as e:
            return JsonResponse({'status': 'error', 'message': str(e)})

class ClinicalIndicatorAnalysis(View):
    def post(self, request):
        try:
            data = json.loads(request.body)
            analysis_type = data.get('analysis_type', 'iop_cdr_correlation')
            df = spark.read.option("header", "true").option("inferSchema", "true").csv("hdfs://localhost:9000/glaucoma_data/clinical_data.csv")
            if analysis_type == 'iop_cdr_correlation':
                filtered_df = df.filter((col("Intraocular_Pressure_IOP").isNotNull()) & (col("Cup_to_Disc_Ratio_CDR").isNotNull()))
                correlation_data = filtered_df.select("Intraocular_Pressure_IOP", "Cup_to_Disc_Ratio_CDR").collect()
                iop_values = [row['Intraocular_Pressure_IOP'] for row in correlation_data]
                cdr_values = [row['Cup_to_Disc_Ratio_CDR'] for row in correlation_data]
                correlation_coefficient = np.corrcoef(iop_values, cdr_values)[0, 1]
                iop_ranges = filtered_df.withColumn("iop_range",
                    when(col("Intraocular_Pressure_IOP") < 12, "正常偏低").
                    when(col("Intraocular_Pressure_IOP") < 21, "正常范围").
                    when(col("Intraocular_Pressure_IOP") < 30, "轻度升高").
                    otherwise("显著升高"))
                range_stats = iop_ranges.groupBy("iop_range").agg(
                    avg("Cup_to_Disc_Ratio_CDR").alias("avg_cdr"),
                    count("*").alias("patient_count")
                ).orderBy("avg_cdr").collect()
                result_data = {
                    'correlation_coefficient': round(correlation_coefficient, 4),
                    'range_analysis': []
                }
                for row in range_stats:
                    result_data['range_analysis'].append({
                        'iop_range': row['iop_range'],
                        'avg_cdr': round(row['avg_cdr'], 3),
                        'patient_count': row['patient_count']
                    })
            elif analysis_type == 'diagnosis_comparison':
                diagnosis_stats = df.groupBy("Diagnosis").agg(
                    avg("Intraocular_Pressure_IOP").alias("avg_iop"),
                    avg("Cup_to_Disc_Ratio_CDR").alias("avg_cdr"),
                    avg("RNFL_Thickness").alias("avg_rnfl"),
                    count("*").alias("patient_count")
                ).collect()
                result_data = []
                for row in diagnosis_stats:
                    result_data.append({
                        'diagnosis': row['Diagnosis'],
                        'avg_iop': round(row['avg_iop'], 2) if row['avg_iop'] else None,
                        'avg_cdr': round(row['avg_cdr'], 3) if row['avg_cdr'] else None,
                        'avg_rnfl': round(row['avg_rnfl'], 1) if row['avg_rnfl'] else None,
                        'patient_count': row['patient_count']
                    })
                glaucoma_patients = df.filter(col("Diagnosis") == "青光眼确诊")
                normal_patients = df.filter(col("Diagnosis") == "正常")
                if glaucoma_patients.count() > 0 and normal_patients.count() > 0:
                    glaucoma_avg_iop = glaucoma_patients.agg(avg("Intraocular_Pressure_IOP").alias("avg")).collect()[0]['avg']
                    normal_avg_iop = normal_patients.agg(avg("Intraocular_Pressure_IOP").alias("avg")).collect()[0]['avg']
                    iop_difference = round(glaucoma_avg_iop - normal_avg_iop, 2)
                    for item in result_data:
                        if item['diagnosis'] == "青光眼确诊":
                            item['iop_elevation'] = iop_difference
            else:
                pachymetry_analysis = df.filter((col("Pachymetry").isNotNull()) & (col("Intraocular_Pressure_IOP").isNotNull()))
                pachymetry_ranges = pachymetry_analysis.withColumn("pachymetry_range",
                    when(col("Pachymetry") < 520, "偏薄").
                    when(col("Pachymetry") < 580, "正常").
                    otherwise("偏厚"))
                pachymetry_stats = pachymetry_ranges.groupBy("pachymetry_range").agg(
                    avg("Intraocular_Pressure_IOP").alias("avg_iop"),
                    avg("Pachymetry").alias("avg_pachymetry"),
                    count("*").alias("count")
                ).collect()
                result_data = []
                for row in pachymetry_stats:
                    result_data.append({
                        'pachymetry_range': row['pachymetry_range'],
                        'avg_iop': round(row['avg_iop'], 2),
                        'avg_pachymetry': round(row['avg_pachymetry'], 1),
                        'patient_count': row['count']
                    })
                correlation_data = pachymetry_analysis.select("Pachymetry", "Intraocular_Pressure_IOP").collect()
                pachymetry_values = [row['Pachymetry'] for row in correlation_data]
                iop_values = [row['Intraocular_Pressure_IOP'] for row in correlation_data]
                pachymetry_iop_correlation = np.corrcoef(pachymetry_values, iop_values)[0, 1]
                result_data.append({
                    'correlation_coefficient': round(pachymetry_iop_correlation, 4)
                })
            return JsonResponse({
                'status': 'success',
                'data': result_data,
                'analysis_type': analysis_type
            })
        except Exception as e:
            return JsonResponse({'status': 'error', 'message': str(e)})

class RiskFactorAnalysis(View):
    def post(self, request):
        try:
            data = json.loads(request.body)
            analysis_type = data.get('analysis_type', 'family_history')
            df = spark.read.option("header", "true").option("inferSchema", "true").csv("hdfs://localhost:9000/glaucoma_data/patient_risk_data.csv")
            if analysis_type == 'family_history':
                family_history_stats = df.groupBy("Family_History", "Diagnosis").agg(count("*").alias("count")).collect()
                result_data = []
                total_with_history = df.filter(col("Family_History") == "有").count()
                total_without_history = df.filter(col("Family_History") == "无").count()
                glaucoma_with_history = df.filter((col("Family_History") == "有") & (col("Diagnosis") == "青光眼确诊")).count()
                glaucoma_without_history = df.filter((col("Family_History") == "无") & (col("Diagnosis") == "青光眼确诊")).count()
                prevalence_with_history = (glaucoma_with_history / total_with_history * 100) if total_with_history > 0 else 0
                prevalence_without_history = (glaucoma_without_history / total_without_history * 100) if total_without_history > 0 else 0
                relative_risk = prevalence_with_history / prevalence_without_history if prevalence_without_history > 0 else 0
                result_data.append({
                    'family_history': '有',
                    'total_patients': total_with_history,
                    'glaucoma_cases': glaucoma_with_history,
                    'prevalence_rate': round(prevalence_with_history, 2)
                })
                result_data.append({
                    'family_history': '无',
                    'total_patients': total_without_history,
                    'glaucoma_cases': glaucoma_without_history,
                    'prevalence_rate': round(prevalence_without_history, 2)
                })
                result_data.append({
                    'relative_risk': round(relative_risk, 2),
                    'risk_interpretation': '高风险' if relative_risk > 2 else '中等风险' if relative_risk > 1.5 else '低风险'
                })
            elif analysis_type == 'medical_history':
                medical_conditions = ['糖尿病', '高血压', '心脏病', '甲状腺疾病']
                result_data = []
                for condition in medical_conditions:
                    with_condition = df.filter(col("medical_history").contains(condition))
                    total_with_condition = with_condition.count()
                    if total_with_condition > 0:
                        glaucoma_with_condition = with_condition.filter(col("Diagnosis") == "青光眼确诊").count()
                        prevalence_rate = (glaucoma_with_condition / total_with_condition) * 100
                        without_condition = df.filter(~col("medical_history").contains(condition))
                        total_without_condition = without_condition.count()
                        glaucoma_without_condition = without_condition.filter(col("Diagnosis") == "青光眼确诊").count() if total_without_condition > 0 else 0
                        control_prevalence = (glaucoma_without_condition / total_without_condition) * 100 if total_without_condition > 0 else 0
                        odds_ratio = (glaucoma_with_condition / (total_with_condition - glaucoma_with_condition)) / (glaucoma_without_condition / (total_without_condition - glaucoma_without_condition)) if glaucoma_without_condition > 0 and (total_without_condition - glaucoma_without_condition) > 0 else 0
                        result_data.append({
                            'medical_condition': condition,
                            'total_patients': total_with_condition,
                            'glaucoma_cases': glaucoma_with_condition,
                            'prevalence_rate': round(prevalence_rate, 2),
                            'control_prevalence': round(control_prevalence, 2),
                            'odds_ratio': round(odds_ratio, 2)
                        })
            else:
                cataract_analysis = df.groupBy("Cataract_Status", "Diagnosis").agg(count("*").alias("count")).collect()
                angle_closure_analysis = df.groupBy("Angle_Closure_Status", "Diagnosis").agg(count("*").alias("count")).collect()
                result_data = {
                    'cataract_analysis': [],
                    'angle_closure_analysis': []
                }
                cataract_totals = df.groupBy("Cataract_Status").agg(count("*").alias("total")).collect()
                cataract_dict = {row['Cataract_Status']: row['total'] for row in cataract_totals}
                for row in cataract_analysis:
                    total = cataract_dict.get(row['Cataract_Status'], 1)
                    glaucoma_rate = (row['count'] / total * 100) if row['Diagnosis'] == "青光眼确诊" else 0
                    result_data['cataract_analysis'].append({
                        'cataract_status': row['Cataract_Status'],
                        'diagnosis': row['Diagnosis'],
                        'count': row['count'],
                        'rate': round(glaucoma_rate, 2) if row['Diagnosis'] == "青光眼确诊" else None
                    })
                angle_totals = df.groupBy("Angle_Closure_Status").agg(count("*").alias("total")).collect()
                angle_dict = {row['Angle_Closure_Status']: row['total'] for row in angle_totals}
                for row in angle_closure_analysis:
                    total = angle_dict.get(row['Angle_Closure_Status'], 1)
                    glaucoma_rate = (row['count'] / total * 100) if row['Diagnosis'] == "青光眼确诊" else 0
                    result_data['angle_closure_analysis'].append({
                        'angle_closure_status': row['Angle_Closure_Status'],
                        'diagnosis': row['Diagnosis'],
                        'count': row['count'],
                        'rate': round(glaucoma_rate, 2) if row['Diagnosis'] == "青光眼确诊" else None
                    })
                closed_angle_glaucoma = df.filter((col("Angle_Closure_Status") == "闭合") & (col("Diagnosis") == "青光眼确诊")).count()
                open_angle_glaucoma = df.filter((col("Angle_Closure_Status") == "开放") & (col("Diagnosis") == "青光眼确诊")).count()
                total_closed = df.filter(col("Angle_Closure_Status") == "闭合").count()
                total_open = df.filter(col("Angle_Closure_Status") == "开放").count()
                closed_angle_risk = (closed_angle_glaucoma / total_closed * 100) if total_closed > 0 else 0
                open_angle_risk = (open_angle_glaucoma / total_open * 100) if total_open > 0 else 0
                result_data['risk_comparison'] = {
                    'closed_angle_risk': round(closed_angle_risk, 2),
                    'open_angle_risk': round(open_angle_risk, 2),
                    'risk_ratio': round(closed_angle_risk / open_angle_risk, 2) if open_angle_risk > 0 else 0
                }
            return JsonResponse({
                'status': 'success',
                'data': result_data,
                'analysis_type': analysis_type
            })
        except Exception as e:
            return JsonResponse({'status': 'error', 'message': str(e)})

 

青光眼数据可视化分析系统-结语

GitHub热门项目启发:青光眼大数据可视化分析系统完整源码解析

2026届计算机专业注意:大数据方向毕设选这个项目准没错

选题难+技术难+答辩难?青光眼数据可视化分析系统帮你解决三大问题

如果你觉得本文有用,一键三连+关注,就是对我最大支持~~

也期待在评论区或私信看到你的想法和建议,一起交流探讨!

⚡⚡获取源码主页--> space.bilibili.com/35463818075…

⚡⚡如果遇到具体的技术问题或计算机毕设方面需求,你也可以在主页上咨询我~~