基于生成对抗网络的白矮主序双星光谱分解研究
姜斌, 曲美霞, 李青苇, 曹书画, 钟云鹏*
山东大学(威海)机电与信息工程学院, 山东 威海 264209
*通讯联系人 e-mail: whkunyushan@163.com

作者简介: 姜 斌, 1977年生, 山东大学(威海)机电与信息工程学院副教授 e-mail: jiangbin@sdu.edu.cn

摘要

白矮主序双星是一类双星系统, 主星是一颗白矮星, 伴星是一颗小质量的主序星。 白矮主序双星对研究致密双星的演化特别是公共包层的演化有着重要的意义。 通过研究白矮主序双星的光谱, 可以获取许多物理参数如有效温度、 金属丰度、 表面重力加速度等。 这些物理参数的准确测量, 不仅可以解决白矮主序双星等密近双星的分类问题, 而且为研究双星理论模型提供了基础数据。 白矮主序双星的光谱是复合光谱, 由主星和伴星的光谱构成。 其光谱存在两大局限性, 一是噪声的干扰; 二是蓝端和红端分别被主星和伴星的光谱特征抑制。 通过分析白矮主序双星光谱, 将光谱进行分解, 分别获得白矮星和伴星的光谱是一个非常有意义的课题。 目前主流的分解方法是使用大量的白矮星和M型恒星模板光谱对白矮主序双星光谱进行拟合, 并用最好的一组光谱组合代表白矮星和伴星的光谱, 由此获得恒星的各种物理参数。 由于这种方法需要遍历所有的光谱组合, 通过模板进行 χ2最小化进行匹配, 导致算法需要消耗大量的计算资源。 生成对抗网络在信号重构上有较好的效果和应用, 基于生成对抗网络, 通过搭建一个用于分解白矮主序双星光谱的神经网络来实现光谱分解, 通过网络直接生成白矮星和伴星的光谱。 该网络模型是一个无监督的学习模型, 模型训练时只需要白矮主序双星光谱、 白矮星模板光谱、 M型恒星模板光谱三种光谱数据进行训练, 不需要其他分解方法的中间结果。 所提出的模型易于优化, 部分网络模型可以用卷积神经网络、 循环神经网络等替换, 那些可用于对抗神经网络的改进和优化方法也同样适用于该网络模型。 该实验模型使用PyTorch深度学习框架进行搭建, 并用GPU加速训练。 使用该方法对SDSS的1 746条白矮主序双星光谱进行分解, 并与其他方法进行比较, 结果表明训练好的网络模型在消耗较少的计算资源的情况下, 可以给出与其他方法相近的结果, 说明此模型有较好的分解光谱的能力。 该方法也可以应用于其他双星光谱的分解。

关键词: 白矮主序双星; 生成对抗网络; 光谱分解
中图分类号:TP29 文献标志码:A
Study on Spectra Decomposition of White Dwarf Main-Sequence Binary Stars Based on Generation Antagonistic Network
JIANG Bin, QU Mei-xia, LI Qing-wei, CAO Shu-hua, ZHONG Yun-peng*
School of Mechanical, Electrical & Information Engineering, Shandong University, Weihai, Weihai 264209, China
*Corresponding author
Abstract

White dwarf main sequence binary star (WDMS) is a kind of binary star system, the main star is a white dwarf star, and the companion star is a small mass main-sequence star.WDMS has an important meaning to study the evolution of close binary stars, especially the evolution of the common envelope. Many physical parameters, such as effective temperature, metal abundance, and surface gravity acceleration can be obtained by studying the spectra of WDMS. The accurate measurement of these physical parameters can not only solve the classification problem of WDMS but also provide basic data for the study of binary star theoretical model.The spectra of WDMS is synthetic spectra, which consists of the spectra of the main star and companion star. WDMS spectra have two major limitations, one is noise interference, and the second is that the blue and red parts are suppressed by the spectral characteristics of the host and companion stars respectively.It is very meaningful to obtain the spectra of white dwarf and companion star by analyzing the spectra of WDMS. At present, the main decomposition method is to use a large number of the white dwarf and M-type star template spectra to fit the WDMS spectra and use the best combination of a group of spectra to represent the spectra of white dwarf and companion star, so as to obtain various physical parameters of stars. This method needs to traverse all spectral combinations and will consume many computing resources due to the matching by the template. Generative adversarial network (GAN) has a good effect and application in signal reconstruction.Based on GAN, this paper constructs a neural network to decompose the spectra of WDMS and directly generates the spectra of white dwarf and companion star through the network. The network model in this paper is an unsupervised learning model, and only three kinds of spectra including WDMS spectra, white dwarf and M-type template spectra, are required for model training, without the intermediate results of other decomposition methods.The model proposed in this paper is easy to be optimized, and some network models can be replaced by CNN and RNN etc. The improvement and optimization methods that can be used to the neural network are also applicable to the network model in this paper.The experimental model in this paper was built with PyTorch deep learning framework and use GPU for accelerated training.This method is used to decompose 1 746 WDMS spectra of SDSS. Compared with other methods, the results show that the trained network model can give similar results with less computational resources. It proves that this model has a good ability to decompose spectra. This method can also be applied to the decomposition of other binary star spectra.

Keyword: WDMS; GAN; Spectra decomposition
引言

白矮主序双星[1](white dwarf-main sequence, WDMS)的光谱为复合光谱, 由主星和伴星构成[2]。 白矮星(white dwarf, WD)控制光谱蓝端特征, 以巴尔末线系(Balmer series)的吸收线为主[3]; 伴星控制光谱红端特征, 呈现小质量主序星特别是M型矮星的特征[4]。 通过光谱分解得到其中的白矮星与M型恒星的信息对研究WDMS有着重要的意义。 Heller[5]等利用模板进行χ 2最小化匹配来得到恒星的温度等信息。 这种方法需要遍历所有的白矮星模板光谱与M型恒星模板光谱, 找出使得χ 2最小的组合作为WDMS中的白矮星和M型恒星的光谱, 并进一步得到物理参数。 方法的时间复杂度为O(n* m* k* L), 其中n, m, k分别为WDMS实测光谱、 白矮星和M型模板光谱的数量, L为光谱的维度。 这种算法时间复杂度导致该方法需要消耗较大的计算资源。

生成对抗网络(generative adversarial nets, GAN)是Goodfellow[6]等提出的一种网络模型。 GAN由一个生成器和一个判别器组成, 生成器负责模仿训练数据, 判别器负责判断数据的真假, 通过生成器和判别器的相互对抗同时提升生成器和判别器的性能。 最终的结果是生成器生成的数据足够逼真以至于判别器无法判断真假, 即最后判别器会认为生成器生成的数据为真的概率为0.5。

Stark[7]等根据GAN设计了PSFGAN用于分离星系图像中的类星体点源。 Fussell[8]等研究使用GAN生成天体图像。 Arjovsky[9]等研究了GAN的不足, 提出了WGAN(wasserstein generative adversarial networks), 可以很好地克服GAN在训练当中遇到的一些问题[10]

针对传统的WDMS光谱分解方法计算量太大的问题, 本文基于GAN设计了一个用于分解WDMS光谱的神经网络模型, 分别使用SDSS(the sloan digital sky survey)中发现的WDMS光谱、 Koster的白矮星模板光谱[11]、 MARCS模板库[12]的M型恒星模板光谱进行训练。 根据网络模型生成的白矮星与M型恒星的光谱, 同时遍历两种模板光谱, 寻找最接近的模板光谱以获取恒星参数信息。 遍历可以并行, 因此使用此方法的时间复杂度为O(n* (m+k)* L)。

这是一个比GAN更大更复杂的对抗网络。 将模型生成的数据与使用χ 2最小方法得出的部分结果进行了对比, 得到了较好的结果。

1 基于GAN的神经网络模型
1.1 网络模型搭建

如图1所示, 本文实验使用DNN模型, 网络由编码网络Q(Encoder), 解码网络PaPb(Decoder a 和 Decoder b), 判别网络Da, Db, Dx(Discriminator a, Discriminator b, Discriminator x)组成。 本文使用PaPb作为生成器, Pa模仿生成数据a, Pb模仿生成数据bDaDb分别负责判别对应的数据。 Dx保证编码不会坍缩在一起。

图1 网络结构示意图Fig.1 Network structure diagram

x表示WDMS光谱, xRn, 使用xa表示a类数据, 使用xb表示b类数据, xaRn, xbRnn为维度, 三类数据有相同的数据维度, 用ncode表示编码的维度。

x输入到网络中, 通过已有的经验知识判断PaPb是否适合进行训练, 同时用WD模板光谱训练PaDa, 用M型恒星模板光谱训练PbDb, 最终得到分解网络Q, PaPb

该网络的时间复杂度由模型的具体架构决定, 例如一层普通BP神经网络的时间复杂度为O(Dout* (Din+oAF)), 其中DoutDin分别为网络层的输出和输入的维度, oAF为激活函数的时间复杂度。 而单层卷积层的时间复杂度为O(M2* K2* Cin* Cout), 其中M为卷积核输出特征图的边长, K为卷积核的边长, CinCout为输入输出的通道数。

1.2 损失函数

网络通过如式(1)和式(2)损失函数进行训练

minGmaxDV(D, G)=Ex~Pdata(x)[logD(x)]+Ez~Pz(z)[log(1-D(G(z)))](1)

minPamaxDaV(Da, Pa)+λminPbmaxDbV(Db, Pb)s.t.xaVa, xbVb, zRncode(2)

其中λ 是一个可调的平衡系数, 用于平衡由于数据规模复杂程度引起的损失不平衡, 通常值为1。 z是一组随机数据, z应当在函数Q的值域内, 取值范围一般与网络输出层的激活函数相关。

定义函数C来表示原数据与合成后的数据应当有的关系

x=C(a, b), x=a+b(3)

使用如式(4)损失函数

minQ, Pa, Pbml(x, c)c=C(Pa(Q(x)), Pb(Q(x)))(4)

式(4)中, l(x, y)为欧氏距离: l(x, y)=‖ x-y2

Dx用于防止网络Q的输出坍缩, 使其输出有一个较好的分布。

2 算法

使用符号Θ (· )表示(· )的学习参数, 记L(a, b)=-loga-log(1-b)。 使用Ian Goodfellow等使用的训练方法。 对于网络DaDb, 使用式(5)更新参数

ΘDaΘDa-αΘDaL(Da(xa), Da(Ga(z)))ΘDbΘDb-αλ1ΘDbL(Db(xb), Db(Gb(z)))
s.t.xaVa, xbVb, zRncode
(5)

式(5)中, ∇θ f(x; θ )表示对参数θ 求偏导的偏导矩阵, α > 0表示学习率。

对于PaPb, 使用式(6)更新参数

ΘPaΘPa+αΘPa[logDa(Pa(Q(x)))-λ2l(x, c)ΘPbΘPb+αΘPb[λ1logDb(Pb(Q(x)))-λ2l(x, c)](6)

对于Dx, 使用式(7)更新参数

ΘDxΘDx+αΘDxL(Dx(x), Dx(z))(7)

对于Q, 使用式(8)更新参数

ΘQΘQ+αΘQ[logDa(Pa(Q(x)))+λ1logDb(Pb(Q(x)))-λ2l(x, c)+λ3log(1-Dx(Q(x)))](8)

以上公式使用了标准梯度下降(GD)的方式, 在实际运行时应选用适合的优化器, 如随机梯度下降(SGD)、 自适应矩估计(Adam)等。 可调参数λ 2用于调节生成光谱的正确性和分解的准确性。 算法整体描述如下:

算法

1: 初始化神经网络

2: for i=1 to k do

3: 通过(5)更新DaDb的参数

4: 通过(6)更新PaPb的参数

5: 通过(7)更新Dx的参数

6: 通过(8)更新Q的参数

7: end for

3 结果与讨论

从SDSS光谱库中选取1 746条WDMS光谱, 截取波长4 000~9 000 Å 的部分并将其插值到16 220维, 见图2。 对M型恒星和白矮星的模板光谱均截取同样波长的部分并插值到16 220维, 见图3和图4。

图2 WDMS光谱Fig.2 WDMS spectra before processing

图3 M型恒星模板光谱Fig.3 M-star template spectra

图4 白矮星模板光谱Fig.4 White dwarf template spectra

根据光谱数据建立的网络模型结构见表1。 四项参数为: 网络名称、 网络层次、 神经元数量、 激活函数。

表1 网络模型结构 Table 1 The structure of the network model

光谱分解效果见图5。

图5 WDMS光谱分解图Fig.5 Decomposed WDMS spectra

图5中从上到下依次是WDMS实测光谱、 网络模型生成的白矮星、 M型恒星光谱, 三种光谱均归一化到[0, 1]。

将网络生成的光谱数据与模板光谱进行比较, 用最接近的光谱的恒星数据代替, 并与χ 2最小方法进行了比较, 部分结果见表2

表2 两种方法结果对比 Table 2 The comparison of the two methods

表2中的temp为有效温度。 模型给出了与χ 2最小化方法相近的结果。 综合比较结果和方差分布见图6和图7。

图6 分解结果对比Fig.6 Comparisons of decomposition results

图7 方差分布Fig.7 Distribution of variance

4 结论

研究对抗神经网络在光谱处理领域的应用, 基于GAN设计了一个用于分解WDMS光谱的无监督神经网络, 通过训练神经网络模型使其获得分解WDMS光谱的能力, 并将网络模型生成的光谱数据与其他分解方法进行了对比, 证明了方法的可行性。 实验结果表明, 在与传统方法准确率相近的情况下, 该方法将时间复杂度从O(n* m* k* L)降到了O(n* (m+k)* L)。 在实际实验中, 通过使用GPU加速, 网络生成光谱的速度非常快, 以至于这个时间可以忽略不计, 而网络训练需要的时间不应当被计入算法的时间。 该方法从理论上和实际操作中都可以极大地减少计算量。

本文模型基于Goodfellow等提出的模型, 而此后被提出的各种GAN的变种和改进可以用于改进模型和损失函数等。 本文方案也可以作为一个框架, 在实际实现的时候可以用更合适的方法代替其中的一部分结构。

在未来工作中, 我们将继续改进模型来提高模型对光谱细节的学习能力, 提高光谱分解的准确率。 同时, 让模型变得更加普适, 以适应其他类型的复合光谱如激变变星等双星的分解。

参考文献
[1] Zasowski G, Johnson Jennifer A, Frinchaboy P M, et al. The Astronomical Journal, 2013, 146(4): 81. [本文引用:1]
[2] Jiang Bin, Luo Ali, Zhao Yongheng, et al. Monthly Notices of the Royal Astronomical Society, 2013, 430(2): 986. [本文引用:1]
[3] Ren J J, Rebassa Mansergas A, Parsons S G, et al. Monthly Notices of the Royal Astronomical Society, 2018, 477: 4641. [本文引用:1]
[4] JIANG Bin, ZHAO Zi-liang, HUANG Hao, et al(姜斌, 赵梓良, 黄灏, ). Spectroscopy and Spectral Analysis(光谱学与光谱分析), 2019, 39(6): 1829. [本文引用:1]
[5] Heller R, Homeier D, Dreizler S, et al. Astronomy & Astrophysics, 2009, 496: 191. [本文引用:1]
[6] Ian J Goodfellow, Jean Pouget Abadie, Mehdi Mirza, et al. Generative Adversarial Nets, arXiv: 1406. 2661. [本文引用:1]
[7] Dominic Stark, Barthelemy Launet, Kevin Schawinski, et al. PSFGAN: a Generative Adversarial Network System for Separating Quasar Point Sources and Host Galaxy Light, arXiv: 1803. 08925. [本文引用:1]
[8] Levi Fussell, Ben Moews. Forging New Worlds: High-Resolution Synthetic Galaxies with Chained Generative Adversarial Networks, arXiv: 1811. 03081. [本文引用:1]
[9] Martin Arjovsky, Soumith Chintala, Leon Bottou. Wasserstein Generative Adversarial Networks, 2018 the 24th International Conference on Pattern Recognition (ICPR). arXiv: 1701. 07875. [本文引用:1]
[10] Goodfellow I, McDaniel P, Papernot N. Communications of the ACM, 2018, 61(7): 56. [本文引用:1]
[11] Koester D. MmSAI, 2010, 81: 921. [本文引用:1]
[12] Gustafsson B, Edvardsson B, Eriksson K, et al. Astronomy & Astrophysics, 2008, 486: 951. [本文引用:1]