# Research and Application of Semi-Supervised Category Dictionary Model Based on Transfer Learning
## 2 Materials and Methods
### Optimization of the Objective Function
#### 2.6.1 Solve for the Variable \(S_{k,m}\)  
In solving for the variable \(D_{k,m}\) while holding \(S_{k,m}\) constant, Equation (10) can be reformulated as follows:  
\[\min_{S_{k,m}}\|X_{k,m}-D_{k,m}S_{k,m}\|_{F}^{2}+\lambda_{1}\|S_{k,m}\|_{1}+tr \big{(}S_{k,m}\Theta_{k,m}S_{k,m}^{T}\big{)} \tag{11}\]This equation consists of three functional terms related to the variable \(S_{k,m}\) encompassing both \(\ell^{1}\) and Frobenius norm operations. Drawing an analogy with the method outlined in the literature [11] (pp. 850-863), the introduction of intermediate variables, denoted as \(W_{k,m}\), can be considered. This leads to the following expression:  
\[\min_{S_{k,m},W_{k,m}}\|X_{k,m}-D_{k,m}S_{k,m}\|_{F}^{2}+\lambda_{1}\|W_{k,m}\|_ {1}+tr\Big{(}S_{k,m}\Theta_{k,m}S_{k,m}^{T}\Big{)}\]  
\[s.t.\ S_{k,m}=W_{k,m} \tag{12}\]  
Establishing the multiplicative Lagrange multiplier function on the above equation:  
\[\begin{array}{c}C_{1}=\|X_{k,m}-D_{k,m}S_{k,m}\|_{F}^{2}+\lambda_{1}\|W_{k,m }\|_{1}\\ +tr\Big{(}S_{k,m}\Theta_{k,m}S_{k,m}^{T}\Big{)}+\left\langle Y_{1},S_{k,m}-W_{ k,m}\right\rangle+\frac{\rho_{1}}{2}\left(\|S_{k,m}-W_{k,m}\|_{F}^{2}\right)\end{array} \tag{13}\]  
where \(Y_{1}\) and \(\rho_{1}>0\) are the additional Lagrange multipliers and penalty factors introduced, respectively.  
Further using a distribution optimization strategy to solve for the variables in the above equation, first fixing \(W_{k,m}\), the expression with respect to \(S_{k,m}\) is:  
\[\begin{array}{c}C_{1}{}^{1}=\|X_{k,m}-D_{k,m}S_{k,m}\|_{F}^{2}+tr\Big{(}S_{k,m}\Theta_{k,m}S_{k,m}^{T}\Big{)}\\ +\frac{\rho_{1}}{2}\left(\|S_{k,m}-W_{k,m}\|_{F}^{2}\right)\end{array} \tag{14}\]  
Taking the derivative of Equation (14) and making the derivative zero, the following result is obtained.  
\[\begin{array}{c}\left(2D_{k,m}^{T}D_{k,m}+\rho_{1}I\right)S_{k,m}+S_{k,m}(2 \Theta_{k,m})\\ =2D_{k,m}^{T}X_{k,m}+\rho_{1}\Big{(}W_{k,m}-\frac{Y_{1}}{\rho_{1}}\Big{)}\end{array} \tag{15}\]  
The above equation is a Sylvester equation [8] for the variable \(S_{k,m}\), and the parameters of the set of equations are: \(A=\left(2D_{k,m}^{T}D_{k,m}+\rho_{1}I\right)\), \(B=2\Theta_{k,m}\), and \(C=2D_{k,m}^{T}X_{k,m}+\rho_{1}\Big{(}W_{k,m}-\frac{Y_{1}}{\rho_{1}}\Big{)}\)  
Solve the above parameters by matrix analysis (e.g., using the MATLAB integrated function _lyap_).  
Then, fixing the variable \(S_{k,m}\), form the expression of the objective function with respect to the variable \(W_{k,m}\):  
\[C_{1}{}^{2}=\lambda_{1}\|W_{k,m}\|_{1}+\frac{\rho_{1}}{2}\Big{(}\|S_{k,m}-W_{ k,m}+\frac{Y_{1}}{\rho_{1}}\|_{F}^{2}\Big{)} \tag{16}\]  
The optimization problem described by the above equation, i.e., \(\underset{W_{k,m}}{\text{min}}C_{1}{}^{2}\) has a closed solution and the expression is shown below:  
\[W_{k,m}^{*}=shrink\Big{(}S_{k,m}+\frac{Y_{1}}{\rho_{1}},\frac{\rho_{1}}{ \lambda_{1}}\Big{)} \tag{17}\]  
Finally, update the auxiliary variables in Equation (14):  
\[\begin{cases}\ \ \ \ \ \ \rho_{1}=\min(\rho_{1}\kappa,\rho_{max})\\ Y_{1}=Y_{1}+\kappa(S_{k,m}-W_{k,m})\end{cases} \tag{18}\]  
where \(\kappa\) is a constant slightly greater than \(1\).  
After that, repeat the process of executing Equations (14)-(18) continuously until the values of the variables to be solved satisfy the given convergence conditions. Then, the above algorithm process is executed separately for each class of samples and dictionaries to obtain the corresponding \(S_{k,m}\) and \(W_{k,m}\).