## 2 Methods
### AWPSO Algorithm  
It is widely known that selecting parameters for optimization algorithms is a significant challenge. The PSO algorithm involves three parameters: the inertia weight \(\omega\) and the learning factors \(c_{1}\) and \(c_{2}\). If these parameters are chosen unreasonably, the impact on the results will undoubtedly be substantial. For the traditional PSO algorithm, although previous researchers have provided some prior information, such as the recommended value ranges for \(c_{1}\) and \(c_{2}\) being [1.5, 2] and for \(\omega\) being [0.4, 0.9] [19,20], these ranges still lack universality. For the adaptive strategy of the inertia weight \(\omega\), we select the linearly decreasing method proposed by [PERSON] and [PERSON] (1998) [12]. The specific improvement is shown in Equation (4):  
\[\omega(k)=\omega_{max}-\left(\frac{\omega_{max}-\omega_{min}}{K_{max}}\right) \times k \tag{4}\]  
where \(\omega(k)\) represents the inertia weight during the k-th iteration. \(\omega_{max}\) and \(\omega_{min}\) are the maximum and minimum inertia weights, respectively, typically set to 0.9 and 0.4. \(K_{max}\) is the maximum number of iterations.  
For the adaptive weighted update strategy of learning factors \(c_{1}\) and \(c_{2}\), the key step is to calculate particle distances from \(\mathbf{p_{best}}\) and \(\mathbf{g_{best}}\) and then perform updates based on these distances. The updated rules are as follows:  
\[c_{g_{pi}}(k)=F\big{(}g_{pi}(k)\big{)}\]  
\[c_{g_{gi}}(k)=F\big{(}g_{gi}(k)\big{)} \tag{5}\]where the function \(F(\cdot)\) represents the adaptive weighted update function and \(g_{pi}(k)\) and \(g_{gi}(k)\) are, respectively, the distances of particle \(i\) to \(\mathbf{p_{best}}\) and \(\mathbf{g_{best}}\) at the k-th iteration. Their expressions are as follows:  
\[g_{pi}(k)=p_{i}(k)-x_{i}(k)\]  
\[g_{gi}(k)=g_{i}(k)-x_{i}(k) \tag{6}\]  
Since learning factors are weighted terms designed to guide particles towards \(\mathbf{p_{best}}\) and \(\mathbf{g_{best}}\) and the search space for constrained optimization problems is usually bounded, the adaptive weighted update function needs to have two characteristics: the update function is monotonically increasing and bounded. The activation functions in neural networks perfectly meet this requirement. We choose the sigmoid function as the adaptive weighted update function; in addition to satisfying the conditions of being monotonically increasing and bounded, it also has an S-shaped curve. This curve helps avoid abrupt changes in control parameters. Moreover, the sigmoid function is smooth and differentiable, reflecting the adaptive nature of updating weights iteratively. The specific expression is as follows:  
\[F(D)=\frac{b}{1+e^{-a(D-c)}}+d \tag{7}\]  
where \(e\) is the natural logarithmic base. \(a\) represents the steepness of the curve, which is a constant. \(b\) represents the peak value of the curve, \(c\) represents the abscissa value of the center of the curve, \(d\) is a positive constant, and \(D\) is calculated by the equation (5), representing the distance of the particle from \(\mathbf{p_{best}}\) and \(\mathbf{g_{best}}\). Combining Equations (4)-(6), Equation (2) is updated to the following:  
\[V_{j}^{k+1}=\omega(k)\times V_{j}^{k}+c_{g_{pi}}(k)\times r_{1}\times g_{pi}(k )+c_{g_{gi}}(k)\times r_{2}\times g_{gi}(k) \tag{8}\]  
In the PSO algorithm, fitness needs to be calculated as an indicator for selecting the optimal solution. In gravity inversion problems, the Root Mean Square (RMS) of the difference between observed gravity and forward-modeled gravity is typically used as the fitness value. The expression is as follows:  
\[\varphi_{obj}=\sqrt{\frac{1}{N}\sum_{i=1}^{N}\Bigl{[}g_{j}^{o}(x_{j})-g_{j}^{ p}(x_{j})\Bigr{]}^{2}} \tag{9}\]  
where \(N\) represents the measured data points, \(g_{j}^{o}(x_{j})\) is the observed gravity field, and \(g_{j}^{p}(x_{j})\) is the computed gravity field at the point \(x_{j}\).