Method for training perovskite crystal image processing model and image processing method
By employing a two-stage transfer learning framework and a parameter freeze-fine-tuning strategy, a lightweight perovskite crystal image processing model is constructed, which solves the resource and data dependency problems of perovskite crystal image recognition and enables real-time and efficient analysis on mobile devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies struggle to effectively process grain boundaries in perovskite crystal images. Traditional methods are time-consuming and rely on manual judgment, while deep learning models are difficult to apply on a large scale due to limited resources. Furthermore, data acquisition and annotation are challenging, thus limiting the commercialization of the perovskite industry.
A two-stage transfer learning framework and parameter freeze-fine-tuning strategy are adopted. By pre-training a general boundary recognition model and freezing some parameters, combined with fine-tuning based on perovskite-specific data, a lightweight perovskite crystal image processing model is constructed, which reduces the dependence on the amount of data and enhances the model's perovskite-specific recognition ability.
It achieves efficient recognition of perovskite crystal images under limited computing resources, can identify grain boundaries and morphological information, meets the real-time analysis needs of mobile devices, reduces the dependence on high-quality data, and improves recognition accuracy and efficiency.
Smart Images

Figure CN121330276B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of image processing and perovskite technology, and specifically to a training method and processing method for a perovskite crystal image processing model. Background Technology
[0002] Perovskite absorber layers are a core component of perovskite solar cells and perovskite photodetectors. Their microstructure is closely related to photoelectric performance and stability, making them the most intuitive and convenient parameter for many researchers to analyze film quality. However, low contrast, blurred and irregular grain boundaries, dense grain distribution, and unavoidable noise introduced during electron microscopy make the analysis of perovskite microfilms challenging. Traditional image processing methods can only analyze scanning electron microscope (SEM) images with a few clear grains, and require significant time for algorithm iteration and optimization, as well as subjective human judgment. This hinders the large-scale commercialization of perovskite-related industries.
[0003] While some studies have attempted to train deep learning models with automatic feature extraction capabilities to extract grains and grain boundaries from SEM images, no research has yet considered lightweighting these models. This is because reducing model parameters could significantly degrade model performance, leading to insufficient generalization ability. Furthermore, the high cost of SEM representation and the dense connections and blurring of grains in SEM images make the collection and annotation of valuable samples more difficult, and data-driven neural networks are prone to overfitting in the absence of sufficient data samples.
[0004] Therefore, with limited computing or memory resources, most deep learning algorithms are difficult to apply in practice, making it difficult to perform large-scale analysis of perovskite SEM images in real time. Summary of the Invention
[0005] In view of the above problems, the present invention provides a training method and a processing method for a perovskite crystal image processing model.
[0006] According to a first aspect of the present invention, a training method for a perovskite crystal image processing model is provided, comprising: pre-training a basic model using a first training dataset based on a preset semantic segmentation task to obtain a boundary recognition model for extracting common features of grain boundaries, wherein the first training dataset includes first sample images of multiple independent target individuals and segmentation labels for characterizing the boundaries of the multiple independent target individuals, the independent target individuals having continuous closed boundaries; freezing a first part of the model parameters of the boundary recognition model so that the boundary recognition model can retain the general features for locating the entity boundaries of independent target individuals; and fine-tuning a second part of the unfrozen model parameters in the boundary recognition model using a second training dataset to obtain a perovskite crystal image processing model with perovskite grain boundary recognition capability, wherein the second training dataset includes second sample images of perovskite grains and real segmentation labels for characterizing grain boundaries in perovskite grain images.
[0007] According to a second aspect of the present invention, a perovskite crystal image processing method is provided, comprising:
[0008] Acquire scanning electron microscope images of the perovskite grains to be processed;
[0009] The scanning electron microscope image of the perovskite grain to be processed is input into the trained perovskite crystal image processing model for recognition to obtain perovskite grain information; the trained perovskite crystal image processing model is obtained through the above training method.
[0010] A third aspect of the present invention provides a training apparatus for a perovskite crystal image processing model. The apparatus includes: a first training module for pre-training a basic model using a first training dataset based on a preset semantic segmentation task to obtain a boundary recognition model for extracting common features of grain boundaries, wherein the first training dataset includes first sample images of multiple independent target individuals and segmentation labels for representing multiple independent target individuals, wherein the independent target individuals have continuous closed boundaries; a freezing module for freezing a first part of the model parameters of the boundary recognition model so that the boundary recognition model can retain the ability to locate the general features of the entity boundaries of independent target individuals; and a second training module for fine-tuning a second part of the unfrozen model parameters of the boundary recognition model using a second training dataset to obtain a perovskite crystal image processing model with perovskite grain boundary recognition capability, wherein the second training dataset includes second sample images of perovskite grains and real segmentation labels for representing grain boundaries in perovskite grain images.
[0011] A fourth aspect of the present invention provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the training method or processing method described above.
[0012] A fifth aspect of the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions, when executed by a processor, implement the steps of the training method or processing method described above.
[0013] A sixth aspect of the present invention also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps of the training method or processing method described above.
[0014] According to an embodiment of the present invention, a two-stage transfer learning framework and a parameter freeze-fine-tuning strategy are used. In the pre-training stage, a general boundary recognition model is constructed using first sample images with multiple independent target individuals. This model not only conforms to the characteristic that perovskite grains have multiple independent, clear, and continuous boundaries, but also reduces the dependence on the amount of data in the perovskite grain image training dataset. This allows the extraction of common features of the boundaries of independent target individuals, laying the foundation for subsequent perovskite-specific tasks. In the fine-tuning stage, the model is adapted to the microscopic features of perovskite grains by freezing the encoder parameters to preserve general features. The model can be trained using a large number of other grain images. Freezing the general feature extraction layer reduces the dependence on the amount of labeled data. The model parameters are fine-tuned using a small number of perovskite images, enhancing perovskite-specific modeling. This allows for the acquisition of a lightweight perovskite crystal image processing model that can specifically distinguish perovskite grain boundaries without the need for a large amount of high-quality perovskite image data for model training. This enables the identification of perovskite grains in perovskite electron microscopy images, and the statistical analysis yields various morphological information such as the boundaries and perimeters of the perovskite grains. Attached Figure Description
[0015] Figure 1 This is a flowchart of a training method for a perovskite crystal image processing model according to an embodiment of the present invention;
[0016] Figure 2 This is a schematic diagram of the boundary recognition model recognition results in an embodiment of the present invention;
[0017] Figure 3 This is a schematic diagram of the basic model structure of an embodiment of the present invention;
[0018] Figure 4 This is a comparison chart of loss functions in embodiments of the present invention;
[0019] Figure 5 This is a schematic diagram of the cosine learning rate with a preheating stage in an embodiment of the present invention;
[0020] Figure 6 This is a flowchart of the perovskite crystal image processing method according to an embodiment of the present invention;
[0021] Figure 7 This is a schematic diagram of the perovskite grain identification software interface according to an embodiment of the present invention;
[0022] Figure 8 This is a schematic diagram of the perovskite grain number identification results in an embodiment of the present invention;
[0023] Figure 9 This is a diagram showing the distribution of various features of perovskite grain identification information in an embodiment of the present invention.
[0024] Figure 10 This is a structural block diagram of the training device for the perovskite crystal image processing model according to an embodiment of the present invention.
[0025] Figure 11 This is a structural block diagram of the perovskite crystal image processing device according to an embodiment of the present invention;
[0026] Figure 12 This is a block diagram of an electronic device suitable for implementing a training method for an image processing model of perovskite crystals, according to an embodiment of the present invention. Detailed Implementation
[0027] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the invention. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.
[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0029] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0030] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0031] The embodiments of the present invention provide a training method for a perovskite crystal image processing model.
[0032] Figure 1 This is a flowchart illustrating the training method for a perovskite crystal image processing model according to an embodiment of the present invention.
[0033] like Figure 1 As shown, the training method of this embodiment includes operations S101 to S103.
[0034] In operation S101, based on the preset semantic segmentation task, the basic model is pre-trained using the first training dataset to obtain a boundary recognition model for extracting common features of grain boundaries. The first training dataset includes first sample images with multiple independent target individuals and segmentation labels for representing multiple independent target individuals, with each independent target individual having a continuous closed boundary.
[0035] According to embodiments of the present invention, the pre-defined semantic segmentation task refers to a pixel-level classification task predefined before model training, with the goal of classifying each pixel in an image into a predefined semantic category, such as grain boundaries or grains. The base model is the initial neural network architecture, typically a general semantic segmentation model. The boundary recognition model refers to a model optimized through pre-training of the base model, specifically designed for boundary detection of images with independent individual classes. The first sample image with multiple independent target individuals refers to a single object with clear and independent boundaries, such as distinct grains or cell optical microscope images where each cell is independent, i.e., each grain or cell is an independent individual with clear, defined, and continuously closed boundaries.
[0036] In some specific embodiments of the present invention, the input first training dataset image will be subjected to horizontal flipping, vertical flipping, random rotation, random addition of salt and pepper noise, and random addition of Gaussian noise enhancement pipeline. If the position or size of the first training dataset image changes during data enhancement, the label data must also be changed accordingly; otherwise, the label data will not be processed.
[0037] Specifically, the type of the first sample image can be selected and optimized according to actual training needs.
[0038] Segmentation labels are annotation data that corresponds one-to-one with sample images. They are used to clearly define the boundaries and regions of grains in the labeled images. They can be represented by binary masks (e.g., 0 for background, 1 for grain) or multi-channel masks to distinguish different types of grains. The purpose of segmentation labels is to accurately define grain boundaries. Specifically, this can be achieved by distinguishing grains from the background through pixel-level annotations, such as outlining the grain contour with white lines and a black background. Alternatively, they can be used for full-area annotation within the grain, such as filling the grain region with a specific color or value to help the model identify the overall shape and location of the grain. If multiple grain types are involved, the labels can distinguish each category using different colors or channels, such as red for monocrystalline silicon and blue for polycrystalline copper.
[0039] In some specific embodiments of the present invention, the data in the first dataset is open source, without copyright protection, and is a mature dataset from the scientific research community or competitions.
[0040] In some specific embodiments of the present invention, the loss functions used in the training process of the boundary recognition model are cross-entropy loss and dice loss, as shown in equations (1), (2) and (3) below.
[0041] (1);
[0042] (2);
[0043] (3).
[0044] Where CE represents cross-entropy loss and dice loss represents dice loss. The flattened representation of the true label This represents the flattening of the probability prediction graph output by the neural network. This represents the total loss function.
[0045] According to an embodiment of the present invention, pre-training is first used to learn coarser boundary information, and then perovskite SEM dataset is used to learn the semantic information of grains and strengthen grain boundaries. Since boundary samples are very scarce, this loss allows the model to focus on difficult-to-distinguish grain boundary regions in the second stage of SEM training, promoting the separation of adjacent grains. That is, if adjacent grains cannot be separated, it will affect subsequent statistics and analysis, and adjacent grains are often closely connected and difficult to separate.
[0046] In operation S102, the first part of the model parameters of the boundary recognition model are frozen so that the boundary recognition model can retain the general features of the entity boundary for locating individual targets.
[0047] According to embodiments of the present invention, freezing refers to fixing parameters. Specifically, it refers to selectively fixing the weights of some parameters in the pre-trained model during transfer learning, so that they do not participate in gradient updates in subsequent training, thus preserving the learned general features of the entity boundaries (i.e., grain boundaries) of independent target individuals. The first part of the model parameters can be manually adjusted according to the first training dataset used. For example, if the images in the first training dataset used have similar features to the perovskite grain images, then the first part of the model parameters may be frozen in large quantities, and only a small part of the model parameters may be fine-tuned. Conversely, a large number of parameters may need to be adjusted. The ability to preserve the general features of the entity boundaries of independent target individuals means that the model has the ability to identify the boundaries of each independent target individual in the first image. That is, the model has the basic ability to identify the boundaries of independent individuals in the image, or it can be understood as being able to identify each independent target individual and distinguish which are boundaries and which are the entities (non-boundaries) of the independent target individuals. For example, if the first image data is a cell image, then the model now has the ability to identify each cell and distinguish which are cell membranes / walls and which are cell tissues.
[0048] Figure 2 This is a schematic diagram of the boundary recognition model recognition results in an embodiment of the present invention.
[0049] In some specific embodiments of the present invention, such as Figure 2 As shown, after step S102, the boundary recognition model retains the ability to preserve the general features of locating the entity boundaries of independent target individuals. Figure 2 The left side shows the SEM image of the perovskite crystal, and the right side shows the result of the model trained after step S102 recognizing the SEM image of the perovskite crystal. It can be seen that the model at this time has the preliminary ability to recognize the boundaries of the perovskite SEM image.
[0050] In operation S103, the parameters of the second part of the boundary recognition model that were not frozen are fine-tuned using the second training dataset to obtain a perovskite crystal image processing model with the ability to identify perovskite grain boundaries. The second training dataset includes second sample images of perovskite grains and real segmentation labels used to characterize grain boundaries in perovskite grain images.
[0051] According to an embodiment of the present invention, the second training dataset refers to scanning electron microscope (SEM) or transmission electron microscope (TEM) images of perovskite grains, which need to cover the typical microstructural features of perovskite materials, such as grain size, grain boundary morphology, and defect distribution. The ground truth labels for the perovskite grain images refer to pixel-level annotations that correspond one-to-one with the second sample images, used to accurately define the boundaries of perovskite grains. Annotation formats include binary masks. The ground truth labels provide supervisory signals, guiding the model to learn the accurate characterization of perovskite grains and grain boundaries. Grain boundaries are defined through manual annotation or algorithmic generation, such as edge detection algorithms based on SEM images, thus solving the detection challenges caused by grain stacking and grain boundary blurring in perovskite thin films.
[0052] In some specific embodiments of the present invention, before the perovskite image is fed into the network model, data augmentation is performed first, and then the network model extracts semantic features and fuses multi-scale information to restore the high-resolution image layer by layer.
[0053] According to embodiments of the present invention, fine-tuning refers to adjusting the parameters and weights in the model to improve the model's ability to identify perovskite grain-specific features, such as grain stacking and twin boundaries. The freeze-and-fine-tuning strategy achieves an efficient transfer from general grain boundary detection to a perovskite-specific model by balancing the preservation of general features with adaptation to specific data, resulting in a perovskite crystal image processing model.
[0054] In some specific embodiments of the present invention, the perovskite grain boundary recognition capability refers to the ability to accurately detect, locate and classify grain boundaries of different scales, such as grain boundaries between grain aggregates, in perovskite thin film images. Specifically, it can identify the information of each grain, thereby obtaining information such as the number of grains, perimeter, area, and thin film coverage in the image.
[0055] According to an embodiment of the present invention, a two-stage transfer learning framework and a parameter freeze-fine-tuning strategy are used. In the pre-training stage, a general boundary recognition model is constructed using first sample images with multiple independent target individuals. This model not only conforms to the characteristic that perovskite grains have multiple independent, clear, and continuous boundaries, but also reduces the dependence on the amount of data in the perovskite grain image training dataset. This allows the extraction of common features of the boundaries of independent target individuals, laying the foundation for subsequent perovskite-specific tasks. In the fine-tuning stage, the model is adapted to the microscopic features of perovskite grains by freezing the encoder parameters to preserve general features. The model can be trained using a large number of other grain images. Freezing the general feature extraction layer reduces the dependence on the amount of labeled data. The model parameters are fine-tuned using a small number of perovskite images, enhancing perovskite-specific modeling. This allows for the acquisition of a lightweight perovskite crystal image processing model that can specifically distinguish perovskite grain boundaries without the need for a large amount of high-quality perovskite image data for model training. This enables the identification of perovskite grains in perovskite electron microscopy images, and the statistical analysis yields various morphological information such as the boundaries and perimeters of the perovskite grains.
[0056] Figure 3 This is a schematic diagram of the basic model structure of an embodiment of the present invention.
[0057] According to an embodiment of the present invention, based on Figure 3 As can be seen, the basic model includes at least one downsampling unit and at least one upsampling unit corresponding to each downsampling unit. Each downsampling unit and each corresponding upsampling unit are connected through a channel attention (Squeeze-and-Excitation Networks, SE) module. The channel attention module includes multiple channels for representing different feature types and dimensions. The channel attention module receives the multi-channel feature map output by the downsampling unit and redistributes the feature weights of the multiple channels to generate redistributed weight coefficients corresponding to the importance of the multiple channels. The upsampling unit receives the feature map weighted by the channel attention module and performs multi-scale feature fusion based on the redistributed channel weights.
[0058] Specifically, Figure 3The Tok-Kan module can be interpreted as a non-standard module (like a convolutional layer), a customized design employing the Kolmogorov-Arnold Network (KAN) concept. "Tok" refers to the segmented image or its feature representation. Its role is to perform deeper and more flexible non-linear transformations on the features filtered by attention weights to capture complex structures and details in the image. The Tok-Kan module works by feeding the raw input data into a tokenization layer, converting it into independent units that the model can process, transforming it into a labeled sequence. Then, it undergoes a core non-linear feature transformation through a KAN layer, followed by lightweight convolutional feature extraction through a depthwise separable convolution layer. Finally, it is normalized through a LayerNorm layer to stabilize the data distribution. Specifically, shortcut connections or residual paths can also exist to skip the above layers and directly feed the data to the normalization layer.
[0059] According to an embodiment of the present invention, the basic model is based on a symmetrical encoder and decoder structure. The encoder corresponds to a downsampling unit for image downsampling, and the decoder corresponds to an upsampling unit for image upsampling. In skip connections, low-level, fine-grained positional information features from the encoder are fused (feature maps are concatenated along the channel dimension) before the high-level, coarse-grained semantic features in the decoder. The encoder's positional information is then enhanced by an attention module to enhance channel features. This basic model has significantly fewer parameters and less floating-point computation than mainstream segmentation models. Both the first and second supervision modules contribute gradient information to guide model weight updates. The labels in the second supervision module are obtained by downsampling the true label map by a factor of 2.
[0060] In some specific embodiments of the present invention, multiple channels include channels with several different feature information obtained by projecting the convolutional layer into a high-dimensional space.
[0061] Specifically, the channel attention module analyzes the importance of multiple channels used to characterize different feature types and dimensions, generating adaptive channel weight coefficients for the feature map output by the downsampling unit. This involves redistributing feature weights to generate redistributed weight coefficients corresponding to the importance of multiple channels. The upsampling unit combines deep semantic features with shallow detail features from the downsampling unit, weighted by the SE module (through skip connections, etc.), achieving complementary advantages. For example, in perovskite grain boundary segmentation, edge texture channels are given higher weights, such as grain boundary gradient features, while background noise channels are suppressed. Furthermore, by aggregating global channel information, cross-regional grain boundary correlations can be captured, and redundant feature channels can be dynamically pruned, reducing the computational load of the upsampling unit. The pre-trained downsampling unit transmits general features through channel attention, reducing dependence on target domain data. In some specific embodiments of this invention, the model used can effectively improve computational efficiency while reducing the number of parameters, achieving improved accuracy through model lightweighting. Comparison data between the model and related technologies is shown in Table 1 below.
[0062] Table 1
[0063]
[0064] Specifically, as shown in Table 1, the model parameters of this invention are only 2.36M, a 93% reduction compared to U-Net's 32.08M parameters, and a 99.2% reduction compared to ResNet50-Unet's 311.21M parameters. This lightweight characteristic allows the trained model to be directly deployed in the memory module of mobile devices. While maintaining an 82.3% Dice coefficient, real-time inference on mobile terminal systems such as smartphones is achieved. Through the synergistic optimization of channel attention mechanism and parameter freezing strategy, the model parameters are compressed to less than 1 / 15 of traditional methods while maintaining the accuracy of perovskite grain boundary identification. This lightweight characteristic breaks through the memory bottleneck of deep learning models deployed on mobile devices, meeting the needs of rapid quality diagnosis of perovskite thin films in industrial settings via mobile application software (APP).
[0065] According to an embodiment of the present invention, in operation S102, the first part of the model parameters includes at least one of the parameters of the convolutional layer at the end of the upsampling unit, the parameters of all upsampling units, or the parameters of all channel attention modules.
[0066] According to an embodiment of the present invention, the type of parameters frozen is related to the similarity between the first training dataset and the perovskite image. In transfer learning, if the source domain and the target domain differ greatly, i.e., the training set images and the perovskite images differ greatly, more intermediate layers need to be unfrozen to enhance feature adaptation.
[0067] In some specific embodiments of the present invention, the base model includes at least three downsampling units and at least three upsampling units corresponding to the at least three downsampling units respectively; when the first training dataset is a cell dataset, the first part of the model parameters includes a first downsampling parameter or a second downsampling parameter, wherein the first downsampling parameter includes the parameters of the first layer downsampling unit and the parameters of the second layer downsampling unit from the direction of the input layer, and the second downsampling parameter includes the parameters of the first layer downsampling unit, the parameters of the second layer downsampling unit, and the parameters of the third layer downsampling unit from the direction of the input layer, wherein the cell dataset is a collection of cell optical microscopy images; when the first training dataset is a predetermined type of grain image, the first part of the model parameters includes the parameters of all downsampling units.
[0068] According to an embodiment of the present invention, the cell dataset, due to its multiple independent cells, clear and relatively regular boundaries, and individual independence and distinct features, closely resembles the characteristics of perovskite grain images and can be used to train a model. The predetermined grain type refers to a predefined grain category in the dataset, such as metal or semiconductor, specifically silicon, copper, etc., and may include some perovskite grain images or exclude them. The first sample image can be image data containing grains, such as microscopic images of metal or semiconductor grains taken with an electron microscope. These images typically contain information about the grain's morphology, texture, and boundaries, serving as the basic input for the model to learn features.
[0069] For example, when the distribution of general grains and perovskite data is close or highly similar, all upsampling units can be frozen so that the pre-trained model already has the ability to extract general grain boundary features. The end convolutional layer is responsible for local detail optimization such as grain boundary sharpening. Freezing the upsampling backbone can preserve general features, and only the end layer is adjusted to adapt to perovskite specificity.
[0070] For example, when using cell set images, which are significantly different from or have low to medium similarity to perovskite data, the first two or three upsampling units can be frozen, and the rest need to be adjusted using multi-scale feature fusion strategies such as the deconvolution kernel weights and attention weights of the upsampling units.
[0071] Specifically, freezing strategies may include: for general data and perovskite data that are highly similar in grain topology, such as grain boundary curvature and ECD distribution, only fine-tuning the end convolutional layers; for data that have significant specificity with perovskite grains, such as irregular grain boundaries and high-density defects, unfreezing the upsampling units and channel attention; and for data that have a very large distribution difference with perovskite data, such as grain size differences exceeding an order of magnitude, fine-tuning all parameters of the network modules.
[0072] According to an embodiment of the present invention, operation S103 may specifically include operations S1301 to S1303:
[0073] Operation S1301 inputs the second training dataset into the boundary recognition model for forward propagation to obtain the predicted probability map;
[0074] Operation S1302: Determine the loss value based on the predicted probability map, the segmentation labels used to characterize the multiple independent target individuals, and the preset loss function;
[0075] Operation S1303 adjusts the model weights of the boundary recognition model based on the loss value to obtain the target perovskite crystal image processing model.
[0076] According to an embodiment of the present invention, in operation S1301, forward propagation processing refers to inputting a perovskite grain image into the model, passing it layer by layer through an encoder (downsampling unit) and a decoder (upsampling unit), and finally outputting a predicted probability map, that is, the probability distribution of each pixel belonging to a grain boundary.
[0077] Figure 4 This is a comparison chart of loss functions in embodiments of the present invention.
[0078] According to an embodiment of the present invention, in operation S1302, the real label refers to the manually labeled grain boundary information. The preset loss function can be the focal loss and the dice loss, as shown in equations (4), (5) and (6) below.
[0079] (4);
[0080] (5);
[0081] (6).
[0082] Where N represents the number of pixels in the label. This represents the probability that the neural network predicts for the current category at the i-th pixel. Let α represent the true class of the i-th pixel, α be the weighting factor, and γ be the focusing parameter. This represents the total loss function.
[0083] For example, the two-dimensional matrix output by the model, with a numerical range of [0,1], represents the probability that each pixel belongs to a grain boundary. For example, in perovskite SEM image segmentation, the probability map can distinguish between low-probability areas inside grains and high-probability areas at grain boundaries. It is compared with manually labeled binary masks, such as 0 for background and 1 for grain boundaries. Then, based on the preset loss functions Focal loss and Dice loss, the model error is quantified into an optimizable numerical objective.
[0084] Specifically, in combination Figure 4It can be seen that the larger the γ value, the more the model "focuses" on samples that are difficult to classify. In perovskite grain boundary segmentation, a reasonable selection of γ (such as γ=1~2) can significantly improve the model's ability to identify sparse and fuzzy grain boundaries, complementing techniques such as transfer learning and attention mechanisms.
[0085] In some specific embodiments of the present invention, the loss function can be dynamically selected based on data characteristics such as noise and imbalance, and end-to-end optimization can be achieved by combining attention mechanism and learning rate strategy.
[0086] According to an embodiment of the present invention, the cross-union ratio of grain boundary regions is directly optimized by Dice loss to improve the geometric consistency of the segmentation results, such as reducing fractures or blurred boundaries. Focal Loss is combined to enhance attention to small targets such as nanoscale grain boundary defects and boundary-sensitive losses such as edge weighting functions are introduced to strengthen grain boundary continuity. The degree of misclassification bias is quantified by the loss function, the gradient is calculated based on the backpropagation algorithm, and the unfrozen parameters are adjusted by the optimizer to gradually reduce the prediction error, so that the model focuses on learning the unique properties of perovskite.
[0087] According to an embodiment of the present invention, operation S1303 may specifically include:
[0088] The gradient information of the loss value with respect to the unfrozen second part of the model parameters is calculated through backpropagation;
[0089] Based on the gradient information and the cosine learning rate with a preheating phase, the unfrozen second part of the model parameters is updated by the optimizer to adjust the weights of the boundary recognition model, thus obtaining the target perovskite crystal image processing model.
[0090] According to an embodiment of the present invention, backpropagation calculation of gradient information refers to calculating the gradient of the loss value with respect to the unfrozen parameters using the backpropagation algorithm, i.e., the parameter update direction and magnitude, used to locate weights in the model that are sensitive to perovskite grain boundary segmentation, and to prioritize the adjustment of key parameters such as the convolution kernel at the end of the upsampling unit. The cosine learning rate with a warm-up phase (wram-up) includes two parts: the warm-up phase and the cosine learning rate, such as... Figure 4 As shown.
[0091] Figure 5 This is a schematic diagram of the cosine learning rate with a preheating stage in an embodiment of the present invention.
[0092] Specifically, in combination Figure 5 To understand Equations (7) and (8), using a cosine learning rate with wram-up to train unfrozen network parameters is more conducive to the network searching for the global optimum during fine-tuning.
[0093] In the first few training epochs, the learning rate is increased from its minimum to its maximum to prevent parameter instability and loss divergence in the early stages of training. After reaching the maximum learning rate, the learning rate is slowly and continuously decayed back to its minimum to reduce parameter sensitivity and loss oscillations in the later stages. This facilitates finer optimization in the later stages, resulting in a more stable optimization process and better segmentation accuracy. The learning rate changes in the two stages can be represented as follows:
[0094] (7);
[0095] (8);
[0096] in and The learning rates are for the warmup phase and the cosine annealing phase, respectively. and Let t represent the minimum and maximum learning rates allowed during training, respectively. w This represents the number of epochs in the warmup, T represents the total number of epochs in training, and t represents the current number of epochs.
[0097] According to embodiments of the present invention, the warm-up stage avoids the destruction of pre-trained features, i.e., the general grain boundary extraction capability, due to parameter abrupt changes during initial fine-tuning. Cosine decay balances convergence speed and accuracy. Dynamic learning rate adjustment initially uses a high learning rate to quickly fit the perovskite data distribution, and later uses a low learning rate to refine local features such as grain boundary sharpening. Gradient-guided updates prioritize optimizing the weights of channels sensitive to perovskite grain boundaries, such as channel attention modules, and suppress irrelevant features such as SEM image background noise.
[0098] Specifically, in combination Figure 2 It is understandable that the first and second supervision modules compare the probability distribution of the model output with the true labels, measure the difference between the model's predicted values and the true labels using the loss function, and then update the model weights based on the gradient information using the gradient descent and backpropagation algorithms until the loss function converges to obtain the optimal model.
[0099] According to another embodiment of the present invention, a perovskite crystal image processing method is also provided, such as... Figure 6 As shown, operations S601 to S602 are included:
[0100] Operation S601: Acquire scanning electron microscope images of the perovskite grains to be processed;
[0101] Operation S602: Input the scanning electron microscope image of the perovskite grain to be processed into the trained perovskite crystal image processing model for recognition to obtain perovskite grain information; wherein the trained perovskite crystal image processing model is obtained through the above training method.
[0102] According to an embodiment of the present invention, in operation S601, the perovskite grain scanning electron microscope image to be processed refers to the microscopic morphology image of microscopic particles with perovskite crystal structure obtained by scanning electron microscope (SEM), and refers to the raw data that needs further analysis or processing. These images have not yet been processed by segmentation, feature extraction, etc., and need to be input into the model for automated analysis.
[0103] According to an embodiment of the present invention, in operation S602, the perovskite grain information may include the position of the segmented binary mask marking grains, morphological parameters such as area, perimeter, and distribution statistics, for subsequent thin film quality assessment.
[0104] According to embodiments of the present invention, the perovskite crystal image processing method can directly process perovskite SEM images with low contrast, blurred boundaries, and noise interference without manual preprocessing. The model automatically completes denoising, contrast enhancement, and grain segmentation. During the training phase, random noise and flipping are introduced to enhance the model's robustness to noise and deformation. Furthermore, the channel features are enhanced to distinguish densely bonded grains, and the output information includes grain boundaries, area, perimeter, shape factor, etc. The error rate is lower than that of manual annotation. The entire process from inputting the SEM image to outputting morphological parameters (such as thin film coverage and grain number) requires no manual intervention.
[0105] Figure 7 This is a schematic diagram of the perovskite grain identification software interface according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the perovskite grain number identification results in an embodiment of the present invention; Figure 9 This is a diagram showing the distribution of various features of perovskite grain identification information in an embodiment of the present invention.
[0106] In some specific embodiments of the present invention, such as Figure 7 , Figure 8 and Figure 9 As shown, the trained perovskite crystal image processing model can be implemented as an application (APP) on mobile devices such as computers or mobile phones. A schematic diagram of the APP interface is shown below. Figure 7 As shown, since this model requires only 2.36MB of storage space and 1.32 billion floating-point operations per second (GFLOPs), it can be implemented on mobile devices equipped with this architecture processor. Figure 7The mobile app shown can perform localized real-time analysis without relying on cloud servers, making real-time die analysis based on mobile apps possible and meeting the technical requirements of low latency and high privacy for on-site quality inspection in semiconductor factories.
[0107] Specifically, you can upload perovskite SEM images to the app, select grain segmentation to segment the perovskite SEM image, and display the segmented image in the original perovskite SEM image window to obtain an analysis image after boundary recognition, as shown below. Figure 8 As shown, and according to Figure 8 The calculation of the divided grains yields the maximum and average grain areas, the maximum and longest and average perimeters, the film coverage, and the number of grains. Result images can also be input. Figure 9 As shown, this allows for a more intuitive understanding of statistical results and facilitates easier analysis of aspects such as the quality of perovskite thin films.
[0108] The above parameters generate a comma-separated value (CSV) file for subsequent analysis. Users can also select other morphological features provided by the app for display, such as area distribution, perimeter distribution, shape factor distribution, aspect ratio distribution, compactness distribution, and indentation rate distribution. Researchers can quickly obtain the morphological features provided by the app while characterizing the film, enabling rapid determination of the film morphology. For industrial applications, the algorithm can run on lower memory requirements, saving costs while achieving batch analysis.
[0109] Specifically, the aforementioned APP can also receive the actual area of the original image (input by the user) to provide the true unit of perimeter or area. If no input is made, the measurement method defaults to pixels.
[0110] Based on the above-mentioned training method for perovskite crystal image processing models, this invention also provides a training device for perovskite crystal image processing models. The following will combine... Figure 10 The device is described in detail.
[0111] Figure 10 This is a structural block diagram of the training device for the perovskite crystal image processing model according to an embodiment of the present invention.
[0112] like Figure 10 As shown, the training device 1000 for the perovskite crystal image processing model in this embodiment includes a first training module 1010, a freezing module 1020, and a second training module 1030.
[0113] The first training module 1010, based on a preset semantic segmentation task, pre-trains a base model using a first training dataset to obtain a boundary recognition model for extracting common features of grain boundaries. The first training dataset includes first sample images of multiple independent target individuals and segmentation labels representing these individuals, where each independent target individual has a continuous, closed boundary. In one embodiment, the first training module 1010 can be used to perform the operation S101 described above, which will not be repeated here.
[0114] The freeze module 1020 is used to freeze a first portion of the model parameters of the boundary recognition model, so that the boundary recognition model can retain the general features of the entity boundary for locating independent target individuals. In one embodiment, the freeze module 1020 can be used to perform the operation S102 described above, which will not be repeated here.
[0115] The second training module 1030 is used to fine-tune the unfrozen second part of the model parameters in the boundary recognition model using the second training dataset, thereby obtaining a perovskite crystal image processing model with perovskite grain boundary recognition capability. The second training dataset includes second sample images of perovskite grains and true segmentation labels used to characterize grain boundaries in perovskite grain images. In one embodiment, the second training module 1030 can be used to perform the operation S103 described above, which will not be repeated here.
[0116] According to an embodiment of the present invention, a two-stage transfer learning framework and a parameter freeze-fine-tuning strategy are used. In the pre-training stage, a general boundary recognition model is constructed using first sample images with multiple independent target individuals. This model not only conforms to the characteristic that perovskite grains have multiple independent, clear, and continuous boundaries, but also reduces the dependence on the amount of data in the perovskite grain image training dataset. This allows the extraction of common features of the boundaries of independent target individuals, laying the foundation for subsequent perovskite-specific tasks. In the fine-tuning stage, the model is adapted to the microscopic features of perovskite grains by freezing the encoder parameters to preserve general features. The model can be trained using a large number of other grain images. Freezing the general feature extraction layer reduces the dependence on the amount of labeled data. The model parameters are fine-tuned using a small number of perovskite images, enhancing perovskite-specific modeling. This allows for the acquisition of a lightweight perovskite crystal image processing model that can specifically distinguish perovskite grain boundaries without the need for a large amount of high-quality perovskite image data for model training. This enables the identification of perovskite grains in perovskite electron microscopy images, and the statistical analysis yields various morphological information such as the boundaries and perimeters of the perovskite grains.
[0117] According to embodiments of the present invention, any plurality of modules in the first training module 1010, the freezing module 1020, and the second training module 1030 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules can be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of the present invention, at least one of the first training module 1010, the freezing module 1020, and the second training module 1030 can be at least partially implemented as a hardware circuit, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging the circuit, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the first training module 1010, the freezing module 1020, and the second training module 1030 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0118] Figure 11 This is a structural block diagram of the perovskite crystal image processing device according to an embodiment of the present invention.
[0119] like Figure 11 As shown, the training device 1100 for the perovskite crystal image processing model in this embodiment includes an acquisition module 1110 and a processing module 1120.
[0120] The acquisition module 1110 is used to acquire scanning electron microscope images of the perovskite grains to be processed. In one embodiment, the acquisition module 1110 can be used to perform the operation S601 described above, which will not be repeated here.
[0121] The processing module 1120 is used to input the scanning electron microscope image of the perovskite grain to be processed into a trained perovskite crystal image processing model for recognition, thereby obtaining perovskite grain information; wherein the trained perovskite crystal image processing model is obtained through the training method described above. In one embodiment, the processing module 1120 can be used to perform the operation S602 described above, which will not be repeated here.
[0122] According to embodiments of the present invention, any plurality of modules in the acquisition module 1110 and the processing module 1120 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules may be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of the present invention, at least one of the acquisition module 1110 and the processing module 1120 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the acquisition module 1110 and the processing module 1120 may be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0123] Figure 12 This is a block diagram of an electronic device suitable for implementing a training method for an image processing model of perovskite crystals, according to an embodiment of the present invention.
[0124] like Figure 12 As shown, an electronic device 1200 according to an embodiment of the present invention includes a processor 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage portion 1208 into a random access memory (RAM) 1203. The processor 1201 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1201 may also include onboard memory for caching purposes. The processor 1201 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0125] RAM 1203 stores various programs and data required for the operation of electronic device 1200. Processor 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. Processor 1201 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 1202 and / or RAM 1203. It should be noted that programs may also be stored in one or more memories other than ROM 1202 and RAM 1203. Processor 1201 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in one or more memories.
[0126] According to an embodiment of the present invention, the electronic device 1200 may further include an input / output (I / O) interface 1205, which is also connected to the bus 1204. The electronic device 1200 may also include one or more of the following components connected to the input / output (I / O) interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the input / output (I / O) interface 1205 as needed. A removable medium 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1210 as needed so that computer programs read from it can be installed into the storage section 1208 as needed.
[0127] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.
[0128] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of the present invention, a computer-readable storage medium may include ROM 1202 and / or RAM 1203 and / or one or more memories other than ROM 1202 and RAM 1203 described above.
[0129] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the training method for the perovskite crystal image processing model provided in the embodiments of the present invention.
[0130] When the computer program is executed by the processor 1201, it performs the functions defined in the system / apparatus of this invention. According to embodiments of the invention, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0131] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1209, and / or installed from the removable medium 1211. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0132] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1209, and / or installed from the removable medium 1211. When the computer program is executed by the processor 1201, it performs the functions defined in the system of this embodiment of the invention. According to embodiments of the invention, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0133] According to embodiments of the present invention, program code for executing the computer programs provided in the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0135] Those skilled in the art will understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention can be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or combinations fall within the scope of the present invention.
[0136] The embodiments of the present invention have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of the invention. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of the invention, and all such substitutions and modifications should fall within the scope of the invention.
Claims
1. A training method for a perovskite crystal image processing model, characterized in that, include: Based on a preset semantic segmentation task, a basic model is pre-trained using a first training dataset to obtain a boundary recognition model for extracting common features of grain boundaries. The first training dataset includes first sample images with multiple independent target individuals and segmentation labels for representing the multiple independent target individuals, wherein the independent target individuals have continuous closed boundaries. The first part of the model parameters of the boundary recognition model is frozen so that the boundary recognition model can retain the ability to locate the general features of the entity boundary of independent target individuals; wherein, the strategy of freezing the first part of the model parameters includes: when the first training dataset and the perovskite data are similar in grain boundary curvature or ECD distribution, only the terminal convolutional layer is fine-tuned; when the first training dataset and the perovskite data have irregular grain boundaries or high-density defects, the upsampling unit and the channel attention module are unfrozen. The second training dataset is input into the boundary recognition model for forward propagation to obtain a predicted probability map; the loss value is determined based on the predicted probability map, the segmentation labels used to characterize multiple independent target individuals, and a preset loss function; the gradient information of the loss value with respect to the unfrozen second part of the model parameters is calculated through backpropagation; based on the gradient information and the cosine learning rate with a warm-up phase, the unfrozen second part of the model parameters is updated by an optimizer to adjust the weights of the boundary recognition model, thereby obtaining the perovskite crystal image processing model. The second training dataset includes second sample images of perovskite grains and true segmentation labels used to characterize grain boundaries in perovskite grain images.
2. The training method according to claim 1, characterized in that, The basic model includes at least one downsampling unit and at least one upsampling unit corresponding to the at least one downsampling unit, wherein the downsampling unit and the corresponding upsampling unit are connected through a channel attention module. The channel attention module includes multiple channels for representing different feature types and dimensions. The channel attention module is used to receive the multi-channel feature map output by the downsampling unit, and to redistribute the feature weights of the multiple channels to generate redistribution weight coefficients corresponding to the importance of the multiple channels. The upsampling unit is used to receive the feature map after being weighted by the channel attention module, and to perform multi-scale feature fusion based on the reassigned channel weights.
3. The training method according to claim 1, characterized in that, The first part of the model parameters includes at least one of the parameters of the convolutional layer at the end of the upsampling unit, the parameters of all upsampling units, or the parameters of all channel attention modules.
4. The training method according to claim 1, characterized in that, The basic model includes at least three downsampling units and at least three upsampling units corresponding to the at least three downsampling units respectively; When the first training dataset is a cell dataset, the first part of the model parameters includes a first downsampling parameter or a second downsampling parameter. The first downsampling parameter includes a first-layer downsampling unit parameter and a second-layer downsampling unit parameter from the direction of the input layer. The second downsampling parameter includes a first-layer downsampling unit parameter, a second-layer downsampling unit parameter, and a third-layer downsampling unit parameter from the direction of the input layer. The cell dataset is a collection of cell optical microscopy images. When the first training dataset consists of images of a predetermined type of grain, the first part of the model parameters includes the parameters of all downsampling units.
5. The training method according to claim 1, characterized in that, The preset loss function includes the focus loss function and the dice loss function.
6. A method for image processing of perovskite crystals, characterized in that, include: Acquire scanning electron microscope images of the perovskite grains to be processed; The scanning electron microscope image of the perovskite grain to be processed is input into a trained perovskite crystal image processing model for identification to obtain perovskite grain information; wherein the trained perovskite crystal image processing model is obtained by the training method described in any one of claims 1 to 5.
7. A training device for a perovskite crystal image processing model, characterized in that, The device includes: The first training module is used to pre-train a basic model based on a preset semantic segmentation task using a first training dataset to obtain a boundary recognition model for extracting common features of grain boundaries. The first training dataset includes first sample images with multiple independent target individuals and segmentation labels for representing the multiple independent target individuals, wherein the independent target individuals have continuous closed boundaries. The freezing module is used to freeze a first part of the model parameters of the boundary recognition model so that the boundary recognition model can retain the ability to locate the general features of the boundary of independent target individual entities; wherein, the strategy for freezing the first part of the model parameters includes: when the first training dataset and the perovskite data are similar in grain boundary curvature or ECD distribution, only the terminal convolutional layer is fine-tuned; when the first training dataset and the perovskite data have irregular grain boundaries or high-density defects, the upsampling unit and the channel attention module are unfrozen. The second training module is used to input the second training dataset into the boundary recognition model for forward propagation processing to obtain a predicted probability map; determine the loss value based on the predicted probability map, the segmentation labels used to characterize multiple independent target individuals, and a preset loss function; calculate the gradient information of the loss value with respect to the unfrozen second part of the model parameters through backpropagation; and update the unfrozen second part of the model parameters through an optimizer based on the gradient information and a cosine learning rate with a warm-up phase, thereby adjusting the weights of the boundary recognition model to obtain the perovskite crystal image processing model. The second training dataset includes second sample images of perovskite grains and true segmentation labels used to characterize grain boundaries in perovskite grain images.
8. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic is that the one or more processors execute the one or more computer programs to implement the steps of the training method according to any one of claims 1 to 5 or the processing method according to claim 6.
Citation Information
Patent Citations
Tissue characteristic quantitative extraction method and system for titanium alloy microstructure image
CN120823598A
Semi-supervised image semantic segmentation method and system based on visual basic model
CN121053438A