Machine Learning Based Automatic Mode-Locking of a Dual-Wavelength Soliton Fiber Laser

: Recent years have witnessed growing research interest in dual-wavelength mode-locked fiber lasers for their pivotal role in diverse applications and the exploration of nonlinear dynamics. Despite notable progress in their development, achieving reliable mode-locked dual-wavelength operation typically necessitates intricate manual adjustments of the cavity’s polarization components. In this article, we present the realization of automatic mode-locking in a dual-wavelength soliton fiber laser. To provide guidance for the algorithm design, we systematically investigated the impact of polarization configurations and initial states on the laser’s operation through numerical simulations and linear scan experiments. The results indicate that operational regimes can be finely adjusted around the wave plate position supporting the mode-locked dual-wavelength solution. Furthermore, the laser exhibits multiple stable states at the mode-locked dual-wavelength point, with critical dependence on the initial conditions. Accordingly, we developed a two-stage genetic algorithm that was demonstrated to be effective for realizing automatic dual-wavelength mode-locking. To further improve the performance of the algorithm, a feedforward neural network was trained and integrated into the algorithm, enabling accurate identification of the dual-wavelength states. This study provides valuable insights into understanding how polarization configurations and initial conditions impact the operational regimes of dual-wavelength mode-locked fiber lasers. The algorithm developed can be extended to optimize other systems with multiple stable states supported at the same parameter point.


Introduction
Dual-wavelength mode-locked fiber lasers have attracted intense interest due to their promising applications in dual-comb spectroscopy [1].The two mode-locked pulse trains share the same cavity environment and, thus, provide high mutual coherence due to common-mode noise cancellation [2,3].Moreover, dual-wavelength mode-locked fiber lasers are valuable platforms for studying the nonlinear dynamics of multi-color solitons, which involve the complex interplay of nonlinearity and dispersion, and gain and loss [4].The inherent periodic collisions between the solitons in most dual-wavelength modelocked systems can lead to a number of interesting and intricate nonlinear phenomena such as collision-induced dispersive wave shedding [5], periodic soliton explosions [6], and Hopf-type bifurcation reversible transitions [7].
There are a variety of techniques for realizing a dual-wavelength mode-locked fiber laser.Active mode-locking techniques have been implemented for dual-wavelength modelocking, which usually have the advantage of high repetition rates [8,9].Nevertheless, the pulses generated by active mode-locking lasers typically exhibit low peak power, and the inclusion of intra-cavity modulators adds to both the cost and system complexity [10].As a result, passive mode-locking techniques have been extensively explored for realizing dual-wavelength operations in recent years.In general, in the configuration of these lasers, a comb filter such as the Lyot filter [11][12][13], Mach-Zehnder interferometer [14,15], or Sagnac loop filter [16] are usually utilized to achieve a dual-wavelength operation.In particular, dual-wavelength mode-locking can be obtained from a rather compact laser system that leverages both the birefringence-induced filtering effect and the dual-peak gain profile of the Erbium-doped fiber at proper pump strength [17,18].While progress in the development of mode-locked dual-wavelength fiber lasers is noteworthy, achieving reliable dual-wavelength operation typically requires meticulous manual adjustment of the cavity's (polarization) components.In addition, the mode competition between the two-color solitons in the gain fiber [11] makes the attainment of dual-wavelength operation even more challenging compared to its single-wavelength counterpart.Moreover, achieving global optimization for a dual-wavelength operation necessitates exploring the entire parameter space, which is often high dimensional [19], making the process rather timeconsuming.Therefore, an intelligent searching algorithm is desirable for achieving reliable automatic dual-wavelength mode-locking.
Machine learning techniques have emerged as a powerful tool for advancing technologies in the field of ultrafast photonics [20][21][22].They have been applied to predictions including temporal peaks from modulation instability spectra [23] and "noise-like pulse" lasers [24], characterization of ultrashort pulses [25], control of white-light continuum generation [26], and predicting complex ultrafast nonlinear propagation [27].Machine learning techniques have also been applied to the control and optimization of mode-locked fiber lasers [19,22,28].Automatic mode-locking has been achieved with various algorithms such as genetic algorithms [29][30][31], human-like algorithms [32], and reinforcement learning [33,34].Machine learning techniques have also been used for the on-demand generation of soliton molecules [35], generation of breathing solitons [36], and bandwidth optimization of a broadband noise-like pulse laser [37].Very recently, an intelligent single cavity dual comb has been developed, where a memory-aided intelligent searching algorithm was implemented [38].A temporal pulse count strategy was used for achieving dual-wavelength mode-locking of a fiber laser that incorporates a piece of polarization-maintaining fiber to form a Lyot filter.Although such a configuration facilitates direct and rapid searches, an algorithm solely based on temporal pulse train information may pose challenges when applied to molecules or multiple-pulse operation regimes that are particularly valuable for studying complex collision dynamics.Moreover, a fixed length of polarization-maintaining fiber in the cavity would lead to a fixed separation of the wavelengths between the twocolor solitons [39,40], which may not be desirable for applications requiring tunability of the repetition rate difference [1].
In this article, a compact mode-locked dual-wavelength fiber laser was constructed, which leveraged both the weak birefringence within the cavity and the gain profile of the Erbium-doped fiber, without using a polarization-maintaining fiber based Lyot filter.A two-stage searching algorithm was developed for achieving automatic dual-wavelength mode-locking, which can be easily extended to multi-wavelength operations without significant changes to the algorithm.We first performed systematic numerical simulations and a linear scan experiment to provide guidance for developing the algorithm.Subsequently, a two-stage genetic algorithm was developed, employing a compound fitness function that combined both the radiofrequency intensity and the spectrum of the output pulse.To further improve the performance of the algorithm, a feedforward neural network was trained and integrated into the algorithm for accurate recognition of the dual-wavelength regimes.

Laser Setup and Numerical Model
We first used numerical modeling to illustrate the impact of the polarization configurations and the initial conditions on the operation regimes of our dual-wavelength fiber laser.Our numerical model used the same parameters as that of the experiment.The laser setup, which adopts a unidirectional ring cavity design, is depicted in Figure 1.Segment AB Photonics 2024, 11, 47 3 of 14 comprises a 2 m Er-doped fiber (EDF, LIEKKITM Er80-8/125, London, UK).Segment BC includes a motorized polarization controller (PC1), a manual polarization controller (PC2), and a polarization-sensitive isolator (PS-ISO), functioning as an artificial saturable absorber.At point D, 10% of intracavity power is extracted through an output coupler.A 980 nm laser diode (LD) is used to pump the EDF via a 980/1550 nm wavelength-division multiplexer (WDM).Segments BC, CD, and DA primarily consist of Corning SMF-28, with lengths of 8.16 m, 2.0 m, and 1.82 m, respectively.The total cavity length is 13.98 m.The fiber laser employs the nonlinear polarization evolution (NPE) technique for mode-locking.An optical spectrum analyzer (YOKOGAWA, AQ6370D, Tokyo, Japan), a digital oscilloscope (RIGOL, DHO4044, Beijing, China), a power meter (THORLABS, PM100D, Newton, NJ, USA), and a fast photodiode (THORLABS, DET08CFC, Newton, NJ, USA) are used to diagnose the output pulse.
laser.Our numerical model used the same parameters as that of the experiment.The laser setup, which adopts a unidirectional ring cavity design, is depicted in Figure 1.Segment AB comprises a 2 m Er-doped fiber (EDF, LIEKKITM Er80-8/125, London, UK).Segment BC includes a motorized polarization controller (PC1), a manual polarization controller (PC2), and a polarization-sensitive isolator (PS-ISO), functioning as an artificial saturable absorber.At point D, 10% of intracavity power is extracted through an output coupler.A 980 nm laser diode (LD) is used to pump the EDF via a 980/1550 nm wavelength-division multiplexer (WDM).Segments BC, CD, and DA primarily consist of Corning SMF-28, with lengths of 8.16 m, 2.0 m, and 1.82 m, respectively.The total cavity length is 13.98 m.The fiber laser employs the nonlinear polarization evolution (NPE) technique for mode-locking.An optical spectrum analyzer (YOKOGAWA, AQ6370D, Tokyo, Japan), a digital oscilloscope (RIGOL, DHO4044, Beijing, China), a power meter (THORLABS, PM100D, Newton, NJ, USA), and a fast photodiode (THORLABS, DET08CFC, Newton, NJ, USA) are used to diagnose the output pulse.

Numerical Model
A vector model was employed to characterize the nonlinear polarization evolution of the pulse within the laser cavity.We use an iterative map to simulate the pulse circulating inside the cavity, which incorporates suitable transfer functions for each cavity element [41,42].The propagation of the two polarization components was described using the coupled nonlinear Schrödinger equation [43][44][45]: where u and v represent the complex envelope of the two polarization components.The

Numerical Model
A vector model was employed to characterize the nonlinear polarization evolution of the pulse within the laser cavity.We use an iterative map to simulate the pulse circulating inside the cavity, which incorporates suitable transfer functions for each cavity element [41,42].The propagation of the two polarization components was described using the coupled nonlinear Schrödinger equation [43][44][45]: where u and v represent the complex envelope of the two polarization components.The weak (bend-induced) birefringence in the cavity is included via the parameter ∆β 0 = 2π/L B , where L B is the beat length.Here, a value of L B = 5.0 m was used for all segments.This is an estimate of the birefringence induced by the bending of the fibers in the cavity [46,47], which is consistent with the previous studies [44,48,49].We have checked that similar simulation results can also be obtained with a slight variation of the L B .The group index term was calculated with the approximation ∆β 1 ≈ ∆β 0 /ω 0 [44,50].The pulse propagation in the BC section was simplified and modeled by propagating the pulse through an equal length of the fiber and then sequentially passing through a quarter wave plate (QWP1, α 1 ), a half wave plate (HWP1, α 2 ), a polarizer (α p ), a second half wave plate (HWP2, α 3 ), and a second quarter wave plate (QWP2, α 4 ) [45].As will be shown later, results obtained from such a simplified model agree well with the experiment, and the dimension of the parameter space searched was significantly reduced.The angle of the transmission axis of the polarizer α p was set to zero in all the simulations [45].
The gain term ĝ(ω) is switched on only in the EDF segment and is modeled by ĝ(ω) = g 0 /(1 + E/E sat )G(ω), where g 0 = 1.72 m −1 represents the small-signal gain, E = (|u| 2 + |v| 2 ) dτ represents the intracavity pulse energy, and E sat = 0.06 nJ is the gain saturation energy.We model the gain spectral profile with a superposition of two Gaussian functions given by with the coefficients c 1 = 0.505, c 2 = 1.1 × 10 13 rad/s, c 3 = 1.4 × 10 13 rad/s, c 4 = 0.495, c 5 = −1.1 × 10 13 rad/s, c 6 = 1.4 × 10 13 rad/s.The gain profile depicted in Figure 2a closely resembles the one observed in the experiment [45], albeit with a more pronounced dual-peak structure centered at 1572 nm and 1592 nm, respectively.We note that dual-peak gain profiles were commonly used in the simulation of the dual-wavelength mode-locking [5,17,18].All the splicing and connection loss are considered at Point C with 1.55 dB, and the coupling loss at Point D is 0.45 dB.In the simulation, we set the central wavelength to 1582 nm.The group velocity dispersion β 2 for the standard single-mode fiber (SMF) is −22.8 ps 2 /km, and it is −20.0 ps 2 /km for the erbium-doped fiber (EDF) [51][52][53].
Additionally, the corresponding nonlinear parameters γ are 0.0011 W −1 m −1 for SMF and 0.0013 W −1 m −1 for EDF.We employed 2 13 grid points and a time window of 500 ps in the simulation.The propagation equations were solved with the split-step Fourier method with adaptive step size [44].

Impact of Polarization Configurations and the Initial States
Mode-locked dual-wavelength solutions can be obtained at certain polarization configurations with proper initial seeds.We first illustrate the impact of the polarization configurations and the initial states on the operation regimes of the laser, which is valuable for understanding the intracavity pulse propagation dynamics and can provide guidance for developing an automatic dual-wavelength searching algorithm.
In the simulation, the wave plate angles were scanned to search for mode-locking solutions.We monitored the spectrum and temporal pulse profile at Point D (output coupler) of the cavity.Once a correct polarization configuration (a set of wave plate angles) was found, it then typically took several hundreds of roundtrips for the iteration to converge.The steady mode-locked spectra at several different polarization configurations are shown in Figure 2b, and the corresponding wave plate angles {α 1 , α 2 , α 3 , α 4 } are {0.4313,1.0329, 1.0799, 1.4637}, {0.4313, 1.0329, 0.7657, 1.4637} and {0.4313, 1.0329, 0.5772, 1.4637} rad from the bottom to the top panel in Figure 2b.The dark curves represent spectra obtained with the same initial condition (two-color hyperbolic secant pulses centered around the gain peaks, each with a peak power of 25 W).Notably, despite the same initial seed being used, they evolved into different final mode-locked states.A steady-state dual-wavelength solution (the dark curve in the middle panel of Figure 2b) was obtained, for which the gain and the birefringence-induced loss were balanced equally at the mode-locked wavelengths of ~1572 nm and ~1591 nm.When the wave plate angles are adjusted away, the wavelength with higher net gain will dominate and finally evolve to a single-color soliton, as shown in the bottom and top panels of Figure 2b.
at Point D is 0.45 dB.In the simulation, we set the central wavelength to 1582 nm group velocity dispersion β₂ for the standard single-mode fiber (SMF) is -22.8 ps 2 and it is -20.0 ps 2 /km for the erbium-doped fiber (EDF) [51][52][53].Additionally, the c sponding nonlinear parameters γ are 0.0011 W −1 m −1 for SMF and 0.0013 W −1 m −1 for We employed 2 13 grid points and a time window of 500 ps in the simulation.The pr gation equations were solved with the split-step Fourier method with adaptive step [44].Thus, achieving a mode-locked dual-wavelength state hinges on identifying the appropriate polarization configurations (wave plate angles).However, even when a correct set of wave plate angles is found, this does not ensure the attainment of the two-color mode-locked solutions.This uncertainty arises from both the nonlinear nature of the laser system and the competition in gain between the two-color solitons.Consequently, the final steady states critically depend on the initial values.This can be seen from the middle panel of Figure 2b, where the dark and green curves were obtained at the same set of system parameters but with different initial seeds.Specifically, the spectrum depicted by the green curve was obtained by adding an extra random phase to the initial field.It is worth noting that other mode-locking states, such as soliton molecules centered at either ~1572 nm or ~1592 nm (not shown here), can still be obtained with alternative random seeds.Consequently, multiple stable states can be supported at the wave plate angles that support dual-wavelength mode-locking.This fact makes searching for a dual-wavelength mode-locked solution much more difficult than its single-wavelength counterpart which, in the experiment, requires meticulous manual adjustment of the polarization controllers.As will be explained later, it is to overcome this difficulty that we developed a two-stage search algorithm.

Pulse Evolution Dynamics of the Mode-Locked Dual-Wavelength Solution
Before introducing the experimental results, it is beneficial to show the evolution dynamics of the mode-locked two-wavelength solution.The spectral evolution over 300 roundtrips is shown in Figure 2c.It shows good overall stability except around roundtrip-30 (RT-30), RT-140, and RT-250, where the two-color solitons collide, and the increased nonlinearity causes a distortion of the steady spectrum.However, the spectrum restores rapidly after collision, as can be seen from Figure 2c.We note that the period of the collision is ~110 RTs in the simulation, which is much shorter than that observed in the experiment.This discrepancy arises because the time window used in the simulation (500 ps) is much shorter than the actual roundtrips time (~70 ns), which is determined by the cavity length of ~14 m.Therefore, in reality, the two solitons will have a much longer time to restore before the next collision occurs.
To gain a more comprehensive understanding of pulse propagation dynamics, the intracavity spectral and temporal evolutions at RT-200 (corresponding to the white dashed line in Figure 2c) are shown in Figure 3.The spectral evolution versus intracavity distance is shown in Figure 3a on a linear scale, where the propagation starts from the EDF (point A in Figure 1).The two solitons experience amplification in the EDF, with a gain of ~6.3 dB.The spectral profile at the coupler is shown in Figure 3d, which manifests as two hyperbolic secant profiles with notable narrow resonant sidebands [45,54].The corresponding temporal evolutions of the two-color solitons are separately shown in Figure 3b,c for improved visualization, considering their significant temporal separation and short durations.Because the reference moving frame was chosen at 1582 nm, and the central wavelengths of the two solitons are ~1572 nm and ~1591 nm, respectively, there is a considerable shift of the pulse center over one cavity length for each pulse, as evident in Figure 3b,c.The walk-off time τ(∆ω) of two pulses with an angular frequency difference ∆ω over one cavity length is given by where the summation is over all fiber segments within the cavity, and β i and L i denote the dispersion and length of the ith fiber segment.With Equation (3), we can calculate the shift of the temporal center of each pulse (with respect to the reference frame at 1582 nm) over one cavity length, which gives −2.37 ps for the blue soliton (at 1572 nm) and 2.06 ps for the red soliton (at 1591 nm).This agrees very well with the corresponding −2.38 ps and 2.07 ps obtained directly from the numerical results.Hence, the slower soliton shown in Figure 3b has a central wavelength of 1591 nm, while the faster-traveling soliton in Figure 3c has a central wavelength of 1572 nm.The corresponding temporal profiles are shown in Figure 3e,f, respectively.In each plot, the filled curve (left axis) represents the simulated pulse profile, while the dashed dark curve represents a hyperbolic secant fitting.The chirp of each pulse was also calculated and is represented by the green curve (right axis) in the corresponding plot.Note that the chirp was obtained by averaging the chirps of the u and v components, which are nearly identical except for a slight difference at the pulse center.The soliton around ~83 ps exhibits a chirp of about −1 THz, consistent with the inferred central wavelength of 1591 nm based on its slower speed in the context above.The peak power of the pulse is ~180 W with a duration T 0 of 282 fs.In contrast, the pulse shown in Figure 3f has a positive chirp corresponding to a central wavelength of 1572 nm, and thus propagates faster.The peak power of the blue soliton is ~200 W, slightly higher than the red one, which leads to a shorter duration of 269 fs.

Linear Scan of the Wave Plate Angles
The overall design of our laser system has been described in Figure 1.In the experiment, we used a motorized polarization controller (Thorlabs, MPC320) with three paddles that can be electrically driven to control the polarization state of the input pulse.When the pump power was increased to 68.01 mW, mode-locked single soliton operations could be easily achieved by adjustment of the polarization controllers.The corresponding fundamental repetition frequency is ~14.4MHz.We observed that, for many polarization configurations, the central wavelength of the soliton can be continuously tuned by rotating the paddles of the polarization controllers.When the pump power was increased to 139.5 mW, by carefully adjusting the polarization controllers, mode-locked dual-wavelength operations could be achieved.Once the dual-wavelength mode-locking was obtained, it could be sustained until the pump power was decreased to ~95 mW.
To confirm the predictions from the numerical simulations shown in Figure 2 and provide further guidance for designing an automatic searching algorithm, we measured the operation regimes of the laser as a function of the wave plate angles.Specifically, a mode-locked dual-wavelength operation was first achieved by random rotations of the polarization controllers.Then we employed a linear scan strategy to identify the operation states of the laser around the wave plate angle where the mode-locked dual-wavelength operation was achieved.We simultaneously recorded the output power, spectrum, and temporal pulse train at a two-dimensional grid of the wave plate angles.We denote the angles of the three paddles of the motorized PC by {α 1 , α 2 , α 3 }, each of which can be adjusted from 0 ° to 170 °.Without loss of generality, we scanned α 2 and α 3 in increments of 3.4° while keeping α 1 fixed at 149.7°.
The measured power map as a function of the wave plate angles (α 2 , α 3 ) is shown in

Linear Scan of the Wave Plate Angles
The overall design of our laser system has been described in Figure 1.In the experiment, we used a motorized polarization controller (Thorlabs, MPC320) with three paddles that can be electrically driven to control the polarization state of the input pulse.When the pump power was increased to 68.01 mW, mode-locked single soliton operations could be easily achieved by adjustment of the polarization controllers.The corresponding fundamental repetition frequency is ~14.4MHz.We observed that, for many polarization configurations, the central wavelength of the soliton can be continuously tuned by rotating the paddles of the polarization controllers.When the pump power was increased to 139.5 mW, by carefully adjusting the polarization controllers, mode-locked dual-wavelength operations could be achieved.Once the dual-wavelength mode-locking was obtained, it could be sustained until the pump power was decreased to ~95 mW.
To confirm the predictions from the numerical simulations shown in Figure 2 and provide further guidance for designing an automatic searching algorithm, we measured the operation regimes of the laser as a function of the wave plate angles.Specifically, a mode-locked dual-wavelength operation was first achieved by random rotations of the polarization controllers.Then we employed a linear scan strategy to identify the operation states of the laser around the wave plate angle where the mode-locked dual-wavelength operation was achieved.We simultaneously recorded the output power, spectrum, and temporal pulse train at a two-dimensional grid of the wave plate angles.We denote the angles of the three paddles of the motorized PC by {α 1 , α 2 , α 3 }, each of which can be adjusted from 0 • to 170 • .Without loss of generality, we scanned α 2 and α 3 in increments of 3.4 • while keeping α 1 fixed at 149.7 • .
The measured power map as a function of the wave plate angles (α 2 , α 3 ) is shown in Figure 4a.Notably, the power map reveals several peaks and valleys.Typically, the peaks correspond to high-power continuous wave (CW) operations, while the valleys indicate either no lasering or very weak lasering, characterized by an amplified spontaneous emission (ASE)-like spectrum.In contrast, the mode-locked single soliton or dual-wavelength states usually have moderate powers.The wave plate position (α 2 , α 3 ) = (96.7 • , 70.7 • ) where we previously obtained a dual-wavelength mode-locking state manually is highlighted with a red point in Figure 4a.We note that the operation state at this parameter point obtained from the linear scan process was not a dual-wavelength operation, which confirmed that multiple steady-states were supported at the mode-locked dual-wavelength point (DW point).To further investigate the operation regimes near the DW point of (96.7 • , 70.7 • ), we made another finer linear scan around the DW point with an increment of 1 • .The measured spectral evolution (blue curves) with α 2 is shown in Figure 4b with the other two wave plate angles fixed at α 1 = 149.7 • and α 3 = 70.7 • .The α 2 ranges from 91.7 • to 101.7 • from the top to the bottom panel.Remarkably, the experimentally measured spectral evolution closely mirrors the numerical results shown in Figure 2b.In particular, the spectrum of the mode-locked soliton can be tuned by simply changing the wave plate angles.The red curve shown in the middle panel of Figure 4b represents the spectrum obtained manually before the linear scan at the same wave plate angles.Therefore, although the system parameters are the same, the laser finally operated in different regimes, which highlights the critical impact of the initial conditions.hotonics 2024, 11, 47 8 of 1 correspond to high-power continuous wave (CW) operations, while the valleys indicat either no lasering or very weak lasering, characterized by an amplified spontaneous emis sion (ASE)-like spectrum.In contrast, the mode-locked single soliton or dual-wavelength states usually have moderate powers.The wave plate position (α 2 , α 3 ) = (96.7°,70.7°where we previously obtained a dual-wavelength mode-locking state manually is high lighted with a red point in Figure 4a.We note that the operation state at this paramete point obtained from the linear scan process was not a dual-wavelength operation, which confirmed that multiple steady-states were supported at the mode-locked dual-wave length point (DW point).To further investigate the operation regimes near the DW poin of (96.7°, 70.7°), we made another finer linear scan around the DW point with an incremen of 1°.The measured spectral evolution (blue curves) with α 2 is shown in Figure 4b with the other two wave plate angles fixed at α 1 = 149.7°and α 3 = 70.7°.The α 2 ranges from 91.7° to 101.7° from the top to the bottom panel.Remarkably, the experimentally meas ured spectral evolution closely mirrors the numerical results shown in Figure 2b.In par ticular, the spectrum of the mode-locked soliton can be tuned by simply changing th wave plate angles.The red curve shown in the middle panel of Figure 4b represents th spectrum obtained manually before the linear scan at the same wave plate angles.There fore, although the system parameters are the same, the laser finally operated in differen regimes, which highlights the critical impact of the initial conditions.To develop an automatic searching algorithm for the mode-locked dual-wavelength state, it is critical to design a proper merit function which should assign higher scores t states that more closely resemble the target state.Here we propose using the Pearson cor To develop an automatic searching algorithm for the mode-locked dual-wavelength state, it is critical to design a proper merit function which should assign higher scores to states that more closely resemble the target state.Here we propose using the Pearson correlation coefficient, which ranges between −1 and 1, as a merit function.Specifically, we first chose a reference spectrum which is a typical mode-locked dual-wavelength spectrum.Then the Pearson correlation coefficient ρ 01 between the reference spectrum S 0 (λ) and the test spectrum S 1 (λ) is given by where the summation is over all sampling points of the wavelength λ i , and < S(λ) > represents the sample mean of the spectrum.In this manner, a spectrum that is more like the target dual-wavelength spectrum will have a higher score.We note that the measured spectrum was preprocessed before it was substituted into Equation (4).Specifically, the measured logarithmic spectrum was first processed by thresholding with truncation, setting the intensities below the threshold (−62 dBm) to the threshold value, while intensities equal to or above the threshold remained unchanged.Subsequently, the spectrum was convolved with a 0.3 nm Gaussian filter to mitigate the influence of the resonant sidebands.After sampling at 0.9 nm increments, the spectrum within the range of 1540 nm to 1630 nm was used for calculation of its merit function.
The calculated correlation coefficient ρ(α 2 , α 3 ) map versus the wave plate angles is shown in Figure 4c, where the dual-wavelength spectrum shown in Figure 4b is used as a reference spectrum.The DW point is also indicated by a red point.Notably, the correlation coefficient map exhibits high values at a crater structure around the DW point.We note that almost all the measured spectra at these points exhibit a near dual-wavelength mode-locking profile with a CW component located at one gain peak and a mode-locked component centered at the other gain peak.Thus, the correlation coefficient is a simple and effective merit function for searching for a dual-wavelength mode-locking state.We also plotted the corresponding preprocessed spectra at different wave plate angles, which are shown in Figure 4d.The correlation coefficient of each spectrum is also plotted on the right in the bar chart.

Automatic Mode-Locked Dual-Wavelength Operation
Since achieving a dual-wavelength mode-locking usually requires meticulous manual adjustment of the polarization controller, an intelligent searching algorithm is favored for realizing the automatic dual-wavelength mode-locking.While, in principle, a linear scan strategy can be employed to explore the parameter space, it becomes intractable when the dimension of the searching space is increased or the grid increment is significantly decreased.For instance, fully scanning the angles of the three paddles of the motorized polarization controller with an increment of 1 • (which is still rather coarse) results in approximately five million grid points.Searching through such a large number of points is extremely time-consuming, if not practically impossible.Moreover, both the simulation results and the linear scan experiment indicate that the final operation state sensitively depends on the initial conditions.Locating a correct set of wave plate angles does not guarantee achieving a mode-locked dual-wavelength operation, which means that the linear scan strategy may even fail in searching for the dual-wavelength mode-locking.
It is well known that genetic algorithms (GA) are suited for the task of finding optimum solutions to a multi-parameter problem [55].We developed a two-stage (GA) to tackle the above difficulty.The working principle of the algorithm is schematically shown in Figure 5a.The first stage is similar to the algorithm commonly used for realizing automatic singlesoliton mode-locking [30,31,36,37].In the first stage, the algorithm tries to locate the right wave plate position (DW point).Subsequently, in the second stage, the algorithm aims to attain dual-wavelength mode-locking by iteratively adjusting the initial conditions around the DW point.Specifically, in the first stage, each individual has three genes that represent the wave plate angles of the motorized PC.The population was set to 60 and evolved for 2 generations.We have checked that, with these parameters, the algorithm performed well in locating a wave plate position where states very near the dual-wavelength mode-locking could be obtained.Although for some realizations the GA can even achieve a dual-wavelength operation in the first stage, it does not always work, since the initial condition has an important influence on the final operation state.Thus, a second stage GA was developed to change the initial conditions iteratively.Guided by the simulation result and the linear scan experiment, we find that dual-wavelength operation can always be achieved by rotating one of the wave plates back and forth iteratively, around the mode-locking point.Such a process can be regarded as frequently changing the initial conditions at the DW point.Specifically, the best individual {α 1 * , α 2 * , α 3 * } generated from the first stage was selected.Then one paddle (indexed by k, where k = arg min {|α i * − 5|}) was selected to rotate two steps consecutively, with the other two paddles fixed.In the second stage, each individual is Although for some realizations the GA can even achieve a dual-wavelength operation in the first stage, it does not always work, since the initial condition has an important influence on the final operation state.Thus, a second stage GA was developed to change the initial conditions iteratively.Guided by the simulation result and the linear scan experiment, we find that dual-wavelength operation can always be achieved by rotating one of the wave plates back and forth iteratively, around the mode-locking point.Such a process can be regarded as frequently changing the initial conditions at the DW point.Specifically, the best individual {α * 1 , α * 2 , α * 3 } generated from the first stage was selected.Then one paddle (indexed by k, where k = arg min i { α * i − 5| }) was selected to rotate two steps consecutively, with the other two paddles fixed.In the second stage, each individual is characterized by two genes, representing the consecutive angles through which paddle k passes.We set the population to 50 and the maximum evolved generation to 10.The fitness function, which has a vital impact on the performance of the algorithm, is the same for both of the two stages.A compound fitness function was designed, which utilized both the temporal pulse train information recorded by the oscilloscope and the spectral information recorded by the OSA.The fitness function F merit is given by where ρ represents the Pearson correlation coefficient between the spectrum of each individual and a reference dual-wavelength spectrum, with a weight ξ 1 = −100.We note that our algorithm was to minimize the value of F merit during the optimization, thus, a negative value of the weight is chosen.Any mode-locked dual-wavelength spectrum supported by the laser can be chosen as the reference.Since it is the correlation coefficient that is used for evaluating the score, the algorithm is not sensitive to the central wavelength.The second term on the righthand side of Equation ( 5) represents a contribution from the RF intensity I RF at the fundament repetition rate, where Θ(x) is the Heaviside step function, ξ 2 = −30, and I 0 = −80 dBm represent an empirical threshold.In the experiment, we observed that when the peak RF intensity is above I 0 , the laser mainly exhibits a mode-locking operation.Thus, the second term on the righthand side of Equation ( 5) was mainly used to exclude the dual-wavelength CW regimes and the weak lasering regimes that have a broad ASE-like spectrum.
The above fitness function generally performs well in searching for the dual-wavelength mode-locking state.However, there are noise-like pulse regimes that have both smooth dual-peak spectral profiles and high RF intensities.The algorithm misidentified them as better dual-wavelength solutions and evaluated them with higher fitness scores |F merit |.To eliminate the misidentifications, a reliable recognition function for the mode-locked dual-wavelength operation must be designed.We proposed employing a feedforward deep neural network for accurate dual-wavelength mode-locking recognition.Specifically, a dataset comprising 12,928 measured spectra, encompassing various regimes (such as singlewavelength CW, single soliton, dual-wavelength CW, dual-wavelength mode-locking, hybrid states of CW and mode-locking, noise-like pulses, etc.) was utilized for offline training and testing of the neural network.Of these samples, there were 75 mode-locked dual-wavelength spectra, which were then extended to 450 with a data augmentation process by flipping and shifting.The mode-locked dual-wavelength spectra were labeled with 1.0, and the other spectra were labeled with 0.0.Then 60% of the dataset was used for training and 40% for testing.All spectral samples were preprocessed and down sampled to 101 points, and then fed into the input layer of the neural network.The neural network, as shown in Figure 5a, has two hidden layers with 120 and 5 neurons, respectively, and the output layer has only one neuron.The sigmoid function was used as the activation function.Then the trained neural network was used in the genetic algorithm for dual-wavelength mode-locking recognition.Specifically, once the fitness score of an individual is lower than a threshold (−115), the algorithm initiates the recognition process by evaluating the corresponding spectrum with the neural network.If the neural network's prediction exceeds 0.7, the individual is recognized as undergoing mode-locked dual-wavelength operation.The algorithm then keeps monitoring the output spectrum and repeating the recognition process until it is terminated or there is loss of the dual-wavelength mode-locking.
We have made a number of realizations to test the performance of the algorithm in the experiment.The evolution of the fitness score with the generation for five typical realizations is shown in Figure 5b and the corresponding mode-locked dual-wavelength spectra found are shown in Figure 5c.It can be seen that the average fitness score of the initial generation is generally high due to the random initialization and then gradually decreases due to selection and evolution.Typically, after the first stage, the algorithm is usually able to locate a wave plate position where a mode-locked dual-wavelength solution is supported.Then a solution can be achieved at a correct initial condition, created by rotating one of the paddles back and forth iteratively in the second stage.It can be seen that there are minor differences between the spectra obtained at different realizations in terms of both the wavelength separations and central wavelengths, as shown in Figure 5c, which indicates that they are different solutions.We note that although for some realizations a mode-locked dual-wavelength solution can also be found within the first stage, the two-stage algorithm significantly improves the success rate.

Discussion and Conclusions
In terms of dual-comb applications, the stability and noise characteristics of dualwavelength mode-locked fiber lasers play a crucial role in achieving highly sensitive spectroscopy.While the two-stage genetic algorithm that we developed allows for the automatic mode-locking of dual-wavelength soliton operation, we note that we have not made specific efforts to optimize the laser's noise performance in this study.However, when the algorithm was used, the laser was able to maintain a mode-locked dual-wavelength operation for hours.In contrast, without utilizing any algorithm, the laser would typically lose mode-locking within one hour and would not restore due to the slight and continuous environmental perturbations.It is reasonable to expect that the noise performance of the laser can be improved by incorporating an additional term to the compound fitness function, which accounts for the noise properties such as the relative intensity noise.Furthermore, utilizing faster electric polarization controllers and implementing real-time monitoring techniques, such as dispersive Fourier transform, holds the potential to further enhance performance.
In conclusion, our utilization of a two-stage genetic algorithm for achieving automatic dual-wavelength mode-locking operation represents a noteworthy extension of machine learning techniques in realizing intelligent fiber lasers [29,30,32,37].Both numerical simulations and a linear scan experiment were conducted to provide guidance for developing the algorithm.The results revealed that operation regimes can be finely adjusted around the dual-wavelength mode-locking point by changing wave plate angles.Additionally, the laser exhibits multiple stable states, with a critical dependence on the initial conditions.Thus, a two-stage genetic algorithm was developed with a compound fitness function that jointly utilized the RF intensity and the Pearson correlation coefficient of the measured spectrum.To further enhance the performance of the algorithm, a feedforward neural network was trained and integrated for accurate recognition of the dual-wavelength regimes.Although in certain realizations, the mode-locked dual-wavelength solution can even be found within the first stage, a two-stage algorithm significantly improves the performance.We believe that our results not only enrich the applications of the machine learning techniques in ultrafast photonics but also provide valuable insights into understanding operation regimes of mode-locked dual-wavelength fiber lasers.

Figure 1 .
Figure 1.Schematic of the laser.Text labels A-D shown on the cavity refer to the different propagation segments as discussed in the text.EDF erbium-doped fiber, LD laser diode, WDM wavelengthdivision multiplexer, PS-ISO polarization-sensitive isolator, PC polarization controller, OC optical coupler, OSA optical spectrum analyzer, OSC oscilloscope, PD photodiode, PM power meter.Parameters for all cavity elements are given in the text.

Figure 1 .
Figure 1.Schematic of the laser.Text labels A-D shown on the cavity refer to the different propagation segments as discussed in the text.EDF erbium-doped fiber, LD laser diode, WDM wavelengthdivision multiplexer, PS-ISO polarization-sensitive isolator, PC polarization controller, OC optical coupler, OSA optical spectrum analyzer, OSC oscilloscope, PD photodiode, PM power meter.Parameters for all cavity elements are given in the text.

Figure 2 .
Figure 2. (a) The gain profile.(b) The steady mode-locked spectra at wave plate angles of {0.4313, 1.0329, 1.0799, 1.4637}, {0.4313, 1.0329, 0.7657, 1.4637} and {0.4313, 1.0329, 0.5772, 1.4637} rad from the bottom to the top panel.The spectra represented by the dark curves were obtained with the same initial seed, which is two sech pulses centered around the gain peaks, each with a peak power of 25 W. The green curve in the middle panel was obtained by adding a random phase noise to the initial seed.(c) The spectral evolution of the dual-wavelength solution versus roundtrips shown on a logarithmic scale over 60 dB.

Figure 3 .
Figure 3. Intracavity evolution dynamics of the mode-locked dual-wavelength state.(a) The spectral evolution versus cavity distance shown on a linear scale.(b,c), The temporal evolutions versus cavity distance of the solitons centered around 83 ps and −202.5 ps, respectively.(d) The corresponding spectral profile at the output coupler.(e,f), The temporal pulse profiles of the corresponding solitons in (b,c), respectively, monitored at the coupler.The filled curves (left axis) correspond to the simulation results and the dashed curves represent hyperbolic secant fittings.The green curves (right axis) in (e,f) represent the pulse chirp.

Figure 4 .
Figure 4. Linear scan of the wave plate angles to identify operation regimes of the laser.(a) Th measured output power as a function of the wave plate angles (α 2 , α 3 ) while keeping α 1 fixed a 149.7°; the red point represents a position that supports mode-locked dual-wavelength operatio (DW point).(b) The spectral evolution versus α 2 while keeping α 1 = 149.7°and α 3 = 70.7°.Th α 2 are 101.7°,97.7°, 96.7°, 95.7°, and 91.7° for the blue curves from the bottom to the top pane respectively.The spectrum shown in the red in the middle panel represents that obtained manuall before the linear scan at α 2 = 96.7°.(c) The corresponding correlation coefficient with the referenc spectrum (red curve in (b)) as a function of the wave plate angles (α 2 , α 3 ) while keeping α 1 fixed a 149.7°.(d) The corresponding preprocessed spectrum at different α 2 , and the spectrum shown o the top panel corresponds to the reference spectrum.The bar chart on the right represents the cor responding correlation coefficient of each spectrum.

Figure 4 .
Figure 4. Linear scan of the wave plate angles to identify operation regimes of the laser.(a) The measured output power as a function of the wave plate angles (α 2 , α 3 ) while keeping α 1 fixed at 149.7 • ; the red point represents a position that supports mode-locked dual-wavelength operation (DW point).(b) The spectral evolution versus α 2 while keeping α 1 = 149.7 • and α 3 = 70.7 • .The α 2 are 101.7 • , 97.7 • , 96.7 • , 95.7 • , and 91.7 • for the blue curves from the bottom to the top panel, respectively.The spectrum shown in the red in the middle panel represents that obtained manually before the linear scan at α 2 = 96.7 • .(c) The corresponding correlation coefficient with the reference spectrum (red curve in (b)) as a function of the wave plate angles (α 2 , α 3 ) while keeping α 1 fixed at 149.7 • .(d) The corresponding preprocessed spectrum at different α 2 , and the spectrum shown on the top panel corresponds to the reference spectrum.The bar chart on the right represents the corresponding correlation coefficient of each spectrum.

Figure 5 .
Figure 5. (a) Illustration of the two-stage genetic algorithm.(b) Fitness score evolution with generations for five typical realizations, which are denoted by the red, blue, green, purple, and orange curves.For each realization, the curve with a triangular marker (on the top) represents the mean score of all individuals, and the curve with a circle marker (on the bottom) represents the maximum fitness score.(c) The corresponding mode-locked dual-wavelength spectrum found in each realization.