%!TEX program = xelatex \documentclass[12pt,a4paper,openany]{ctexbook} % ==================== 页面设置 ==================== \usepackage[top=2.5cm,bottom=2.5cm,left=3cm,right=2.5cm]{geometry} \usepackage{setspace} \onehalfspacing % 1.5倍行距 % ==================== 字体(河南理工规范) ==================== % 正文: 宋体(小四≈12pt) | 标题: 黑体 | 封面信息: 仿宋 % 数字和英文: Times New Roman (ctex 默认) \setCJKmainfont{STSong}[AutoFakeBold=2] % 宋体 \setCJKsansfont{Noto Sans SC} % 黑体替代 \setCJKmonofont{FangSong} % 仿宋 \setmainfont{Times New Roman} % 英文/数字 % ==================== 页眉页脚 ==================== \usepackage{fancyhdr} \usepackage{etoolbox} \pagestyle{fancy} \fancyhf{} \fancyhead[CO]{\zihao{-5}\songti 银发群体高温多时间尺度预警和服务优化可视化研究} % 奇数页 \fancyhead[CE]{\zihao{-5}\songti 河南理工大学本科毕业设计(论文)} % 偶数页 \fancyfoot[C]{\zihao{-5}\thepage} \renewcommand{\headrulewidth}{0.4pt} \fancypagestyle{plain}{ \fancyhf{} \fancyfoot[C]{\zihao{-5}\thepage} \renewcommand{\headrulewidth}{0pt} } % 摘要页页眉 \fancypagestyle{abstract}{ \fancyhf{} \fancyhead[C]{\zihao{-5}\songti 摘要} \fancyfoot[C]{\zihao{-5}\thepage} \renewcommand{\headrulewidth}{0.4pt} } \fancypagestyle{abstract-en}{ \fancyhf{} \fancyhead[C]{\zihao{-5}\songti ABSTRACT} \fancyfoot[C]{\zihao{-5}\thepage} \renewcommand{\headrulewidth}{0.4pt} } % ==================== 图表 ==================== \usepackage{graphicx} \usepackage{float} \usepackage{subcaption} \usepackage{booktabs} \usepackage{longtable} % 表标题在上方居中(五号黑体加粗) \usepackage{caption} \captionsetup[table]{ font={bf,small}, labelsep=quad, position=above, skip=2pt, } % 图标题在下方居中(五号宋体) \captionsetup[figure]{ font=small, labelsep=quad, position=below, skip=2pt, } % ==================== 参考文献 ==================== % ==================== 超链接 ==================== \usepackage[hidelinks]{hyperref} % ==================== 数学 ==================== \usepackage{amsmath,amssymb} \numberwithin{equation}{chapter} % 公式编号: 章.序号 % ==================== 代码 ==================== \usepackage{listings} \lstset{ basicstyle=\small\ttfamily, breaklines=true, frame=single, numbers=left, numberstyle=\tiny, } % ==================== 其他 ==================== \usepackage{tikz} \usetikzlibrary{positioning,arrows} % ==================== 标题格式(河南理工规范) ==================== % 一级标题(章): 小二号黑体(18pt) 加粗 居中 \ctexset{ chapter={ format={\centering\zihao{-2}\heiti\bfseries}, name={第,章}, number=\arabic{chapter}, beforeskip=20pt, afterskip=20pt, }, section={ format={\zihao{4}\heiti\bfseries}, % 四号黑体 beforeskip=12pt, afterskip=6pt, }, subsection={ format={\zihao{-4}\heiti\bfseries}, % 小四号黑体 beforeskip=8pt, afterskip=4pt, }, subsubsection={ format={\zihao{-4}\heiti}, beforeskip=6pt, afterskip=4pt, }, } \title{银发群体高温多时间尺度预警和服务优化可视化研究} \author{刘航宇} \date{\today} \begin{document} % ==================== 封面 ==================== \begin{titlepage} \thispagestyle{empty} \begin{center} \vspace*{2cm} {\zihao{1}\heiti\bfseries 本科毕业设计(论文)}\\[1.5cm] {\zihao{2}\heiti\bfseries 银发群体高温多时间尺度预警\\[0.2cm]和服务优化可视化研究}\\[3cm] {\zihao{4}\fangsong \begin{tabular}{rl} \textbf{学\hspace{2em}院:} & 计算机科学与技术学院 \\[0.3cm] \textbf{专\hspace{2em}业:} & 计算机科学与技术 \\[0.3cm] \textbf{姓\hspace{2em}名:} & 刘航宇 \\[0.3cm] \textbf{学\hspace{2em}号:} & \\[0.3cm] \textbf{指导教师:} & \\[1.5cm] \end{tabular} } \vfill {\zihao{4}\fangsong \today} \end{center} \end{titlepage} % ==================== 摘要 ==================== \input{chapters/abstract} % ==================== 目录 ==================== \pagestyle{fancy} \tableofcontents \newpage % ==================== 正文 ==================== \input{chapters/ch1-intro} \input{chapters/ch2-theory} \input{chapters/ch3-data} \input{chapters/ch4-model} \input{chapters/ch5-system} \input{chapters/ch6-results} \input{chapters/ch7-conclusion} % ==================== 参考文献 ==================== \begin{thebibliography}{99} \bibitem{gasparrini2015mortality} Gasparrini A, Guo Y, Hashizume M, et al. Mortality risk attributable to high and low ambient temperature[J]. The Lancet, 2015, 386: 369-375. \bibitem{chen2018heat} Chen R, Yin P, Wang L, et al. Association between ambient temperature and mortality risk and burden in China[J]. The Lancet Planetary Health, 2018, 2(8): e344-e352. \bibitem{hochreiter1997lstm} Hochreiter S, Schmidhuber J. Long Short-Term Memory[J]. Neural Computation, 1997, 9(8): 1735-1780. \bibitem{vaswani2017attention} Vaswani A, Shazeer N, Parmar N, et al. Attention Is All You Need[C]. NeurIPS, 2017, 30. \bibitem{chen2016xgboost} Chen T, Guestrin C. XGBoost: A Scalable Tree Boosting System[C]. ACM SIGKDD, 2016: 785-794. \bibitem{ipcc2023ar6} IPCC. Climate Change 2023: Synthesis Report[R]. Geneva: IPCC, 2023. \bibitem{lin2017focal} Lin T Y, Goyal P, Girshick R, et al. Focal Loss for Dense Object Detection[J]. IEEE TPAMI, 2020, 42(2): 318-327. \bibitem{bahdanau2014attention} Bahdanau D, Cho K, Bengio Y. Neural Machine Translation by Jointly Learning to Align and Translate[J]. arXiv:1409.0473, 2014. \bibitem{curriero2002temperature} Curriero F C, Heiner K S, Samet J M, et al. Temperature and Mortality in 11 Cities of the Eastern United States[J]. American Journal of Epidemiology, 2002, 155(1): 80-87. \bibitem{rothfusz1990heat} Rothfusz L P. The Heat Index Equation[R]. NWS Southern Region Technical Attachment, 1990. \bibitem{era5land} Copernicus Climate Change Service. ERA5-Land hourly data from 1950 to present[EB/OL]. 2024. \bibitem{china_census2020} 国家统计局. 第七次全国人口普查公报[EB/OL]. 2021. \bibitem{ma2015heat} Ma W, Chen R, Kan H. Temperature-related mortality in 17 large Chinese cities[J]. Environmental Health Perspectives, 2015, 123(10): 989-994. \bibitem{anderson2013heat} Anderson G B, Bell M L. Heat Waves in the United States: Mortality Risk[J]. Environmental Health Perspectives, 2011, 119(2): 210-218. \bibitem{guo2017heat} Guo Y, Gasparrini A, Armstrong B G, et al. Heat Wave and Mortality[J]. Environmental Health Perspectives, 2017, 125(8): 087006. \bibitem{wmo2024state} WMO. State of the Global Climate 2023[R]. Geneva: WMO, 2024. \bibitem{china_climate_bluebook2024} 中国气象局. 中国气候变化蓝皮书(2024)[R]. 北京: 中国气象局, 2024. \bibitem{zhou2021informer} Zhou H, Zhang S, Peng J, et al. Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting[C]. AAAI, 2021: 11106-11115. \bibitem{wu2021autoformer} Wu H, Xu J, Wang J, et al. Autoformer: Decomposition Transformers with Auto-Correlation[C]. NeurIPS, 2021. \bibitem{ke2017lightgbm} Ke G, Meng Q, Finley T, et al. LightGBM: A Highly Efficient Gradient Boosting Decision Tree[C]. NeurIPS, 2017. \end{thebibliography} % ==================== 致谢 ==================== \chapter*{致谢} \addcontentsline{toc}{chapter}{致谢} 值此论文完成之际,衷心感谢导师在选题方向确定、研究方法设计、实验方案优化和论文撰写修改等各个环节给予的悉心指导和宝贵建议。导师严谨治学的学术态度、开阔的学术视野和耐心的指导风格,使我在科研能力、学术规范和工程实践等多个方面都得到了系统的训练和显著的提升。 感谢河南理工大学计算机科学与技术学院四年来的培养,提供了完善的实验环境、丰富的数据资源和活跃的学术氛围。感谢学院各位老师在课堂内外传授的专业知识和科研方法,为本文的研究工作奠定了坚实的理论与实践基础。 感谢课题组同窗在数据下载策略优化、模型训练参数调试和LaTeX排版等方面的有益讨论和技术帮助。 感谢家人二十余年的养育之恩,以及在学业期间始终如一的理解、支持与鼓励,使我能够心无旁骛地专注于学术研究。 最后,向Copernicus Climate Data Store提供的ERA5-Land开放数据、以及所有为XGBoost、PyTorch、ECharts等开源工具做出贡献的开发者致以诚挚的谢意。开放科学的基础设施是本研究得以开展的重要前提。 % ==================== 附录 ==================== \appendix \ctexset{ chapter={ format={\centering\zihao{-2}\heiti\bfseries}, name={附录}, number=\Alph{chapter}, }, } \chapter{项目代码结构} 本研究核心代码已开源至 Gitea 仓库 \texttt{git@lhy-git.liuhangyv.top:Serendipity/elderly-heat-warning.git}。项目采用模块化结构(总规模约28个源文件,约3,500行Python代码,约800行前端HTML/CSS/JS代码): \begin{verbatim} src/ ├── data/ │ ├── download_era5.py # ERA5 数据下载(CDS API) │ ├── extract_zips.py # NetCDF ZIP 解压 │ ├── preprocess.py # 数据预处理管线 │ └── collect_mortality.py # 死亡率数据整理 ├── models/ │ ├── lstm_attention.py # LSTM-Attention 模型定义 │ ├── xgboost_baseline.py # XGBoost 基线 │ ├── train.py # 训练脚本 │ └── evaluate.py # 评估脚本 ├── web/ │ ├── app.py # Flask 后端 │ └── static/ │ └── index.html # ECharts 前端大屏 └── utils/ └── config.py # 全局配置 \end{verbatim} \chapter{系统运行说明} \section{环境配置} 本项目基于Python 3.13开发,使用uv进行虚拟环境和依赖管理。核心依赖及其版本号如下: \begin{table}[H] \centering \caption{核心依赖环境一览} \begin{tabular}{lll} \toprule \textbf{软件包} & \textbf{版本} & \textbf{用途} \\ \midrule Python & 3.13.13 & 编程语言 \\ PyTorch & 2.12.0+cu126 & 深度学习框架(GPU训练) \\ XGBoost & 2.0+ & 梯度提升模型 \\ Scikit-learn & 1.3+ & 评估指标和数据处理 \\ Flask & 3.0+ & Web后端框架 \\ xarray + h5netcdf & 2023+/1.8+ & NetCDF文件处理 \\ NumPy + Pandas & 1.26+/2.1+ & 数据处理 \\ Matplotlib & 3.8+ & 图表生成 \\ CDSAPI & 0.7.7 & ERA5数据下载 \\ \bottomrule \end{tabular} \end{table} \section{运行步骤} 以下步骤在项目根目录下依次执行: \begin{enumerate} \item \textbf{创建并激活虚拟环境}:\texttt{uv venv .venv \&\& .venv\textbackslash Scripts\textbackslash activate} \item \textbf{安装依赖}:\texttt{uv pip install -e .} \item \textbf{下载 ERA5 数据}(耗时约5天):\texttt{python -m src.data.download\_era5} \item \textbf{解压 ZIP 格式数据}(耗时<1秒):\texttt{python -m src.data.extract\_zips} \item \textbf{运行预处理}(耗时约27分钟):\texttt{python -m src.data.preprocess} \item \textbf{训练LSTM模型}(可选,耗时取决于epoch数):\texttt{python -m src.models.train} \item \textbf{评估模型(含XGBoost训练)}:\texttt{python -m src.models.evaluate} \item \textbf{启动可视化大屏}:\texttt{python -m src.web.app} \item \textbf{浏览器访问}:\texttt{http://localhost:5005} \end{enumerate} 注意:步骤3(ERA5下载)需在Copernicus CDS网站接受数据许可协议,并配置\texttt{\textasciitilde/.cdsapirc}文件(URL + API Key)。步骤4和5已内置于预处理管线,通常无需手动执行。 \chapter{模型配置参考} \section{LSTM-Attention关键超参数} \begin{table}[H] \centering \caption{LSTM-Attention模型超参数汇总} \begin{tabular}{ll} \toprule \textbf{参数} & \textbf{取值} \\ \midrule 输入维度 & 19 \\ 隐藏维度 & 128 \\ LSTM层数 & 2(双向) \\ 注意力头数 & 4 \\ 每头维度 & 32 \\ Dropout & 0.3 \\ 总参数量 & 983,628 \\ Focal Loss $\alpha$ & 0.5 \\ Focal Loss $\gamma$ & 2.0 \\ 优化器 & AdamW (lr=1e-3, wd=1e-4) \\ 学习率调度 & ReduceLROnPlateau (factor=0.5, patience=5) \\ 梯度裁剪 & max\_norm=1.0 \\ 早停 & patience=15 \\ Batch Size & 32 \\ 最大Epoch & 50 \\ 训练设备 & NVIDIA RTX 4060 Laptop (8GB) \\ \bottomrule \end{tabular} \end{table} \section{XGBoost关键超参数} \begin{table}[H] \centering \caption{XGBoost模型超参数汇总} \begin{tabular}{ll} \toprule \textbf{参数} & \textbf{取值} \\ \midrule 估计器数量 & 200 \\ 最大深度 & 6 \\ 学习率 & 0.05 \\ L2正则化($\lambda$) & 1.0 \\ 最小分裂增益($\gamma$) & 0.0 \\ 目标函数 & multi:softmax (4类) \\ 训练设备 & CUDA (GPU) \\ 输入特征维 & 266 (14×19展平) \\ \bottomrule \end{tabular} \end{table} \end{document}