Long graph restoration method and device based on discrete probability distribution and storage medium
By constructing a combination of Gaussian probability distribution and VIT model, the problem of not being able to restore the segmented product detail images to a complete long image is solved, achieving efficient long image restoration and improving restoration accuracy and robustness.
Patent Information
- Application Number
- CN202511962494.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-07
- Estimated Expiration
- 2045-12-24
AI Technical Summary
Existing technologies cannot effectively restore fragmented product detail images to a complete long image, resulting in users being unable to obtain a complete visual experience and affecting data analysis and quality monitoring.
Training samples are generated by cutting multiple sub-images from a long image of product details. A Gaussian probability distribution is constructed with the cutting position as the center. The training process of the initial model is supervised by the Gaussian probability distribution as a soft label. The probability sequence output by the VIT model is used and the target peak sequence points are extracted and stitched together to achieve accurate and automatic restoration of the long image.
It improves the accuracy of long image restoration and its robustness to cutting deviations, achieving accurate and automatic restoration of long images and enhancing the restoration effect.
Smart Images

Figure CN121391600B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a long image restoration method based on discrete probability distribution, device and storage medium. BACKGROUND
[0002] In the commodity display link of the e-commerce platform, the commodity detail image is an important carrier for conveying information, which is usually a long image with coherent content. In order to adapt to the efficiency requirements of network transmission and terminal rendering, the platform generally adopts a mechanical cutting rule based on fixed size to automatically segment the original long image into a series of sub-image segments. Although this processing method improves the storage and loading performance, it completely destroys the overall structure and visual continuity of the image content.
[0003] At present, for the sub-image set that has been cut, there is a lack of effective technical means to restore it to the complete long image state before cutting. Existing image processing technologies are mostly focused on image segmentation or pattern recognition, and do not involve the reverse restoration problem for this specific scenario. Since the cutting process does not consider the semantic boundaries of image content, it is extremely difficult to restore based on content awareness. This situation leads to the fact that users cannot obtain the complete long image visual experience, and at the same time, it brings obstacles to downstream applications that need complete image content for data analysis or quality monitoring.
[0004] The above content is only used to assist in understanding the technical solutions of the present application, and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0005] The main purpose of the present application is to provide a long image restoration method based on discrete probability distribution, device and storage medium, which aims to solve the technical problem of inaccurate long image restoration caused by fuzzy cutting line positioning.
[0006] In order to achieve the above purpose, the present application provides a long image restoration method based on discrete probability distribution, which comprises:
[0007] Generating training samples based on a plurality of sub-images cut from a commodity detail long image, and constructing a Gaussian probability distribution centered on the cutting position;
[0008] Inputting the training samples into an initial model, and using the Gaussian probability distribution as a soft label to supervise the training process of the initial model;
[0009] Obtaining a VIT model according to the supervision result of the soft label, inputting a plurality of sub-images into the VIT model to output a probability sequence;
[0010] Extracting target peak sequence points in the probability sequence to generate a sub-image splicing line, and splicing a plurality of sub-images into a complete long image using the sub-image splicing line.
[0011] In one embodiment, the step of obtaining a VIT model based on the supervision results of the soft labels and inputting multiple subgraphs into the output probability sequence of the VIT model includes:
[0012] The predicted splicing lines are extracted from the training results of the initial model, and the positions of the predicted splicing lines are compared with the actual splicing lines represented by the soft labels.
[0013] If the predicted splicing line and the actual splicing line are in the same position, the initial model is used as the VIT model.
[0014] In one embodiment, the step of using the Gaussian probability distribution as soft labels to supervise the training process of the initial model includes:
[0015] The Gaussian probability distribution is used as a supervision signal to compare the difference between the probability sequence output by the initial model and the soft label, and the parameters of the initial model are adjusted according to the difference.
[0016] The Gaussian probability distribution is centered on the actual cutting line position and forms a continuous probability distribution in the height direction.
[0017] In one embodiment, the step of using the Gaussian probability distribution as a supervision signal, comparing the difference between the probability sequence output by the initial model and the soft label, and adjusting the parameters of the initial model based on the difference includes:
[0018] Calculate the loss function between the probability sequence output by the initial model and the soft label;
[0019] The backpropagation algorithm is optimized based on the loss function, and the parameters of the initial model are optimized using the optimized backpropagation algorithm.
[0020] In one embodiment, the steps of optimizing the backpropagation algorithm based on the loss function and optimizing the parameters of the initial model using the optimized backpropagation algorithm include:
[0021] An adaptive moment estimation algorithm is used as the optimizer to calculate the first-order moment estimate and the second-order moment estimate of the loss function.
[0022] The learning rate of the initial model parameters is dynamically adjusted based on the calculated first-order moment estimate and second-order moment estimate.
[0023] The adaptive moment estimation algorithm adaptively adjusts the learning step size of each parameter in the initial model based on the first and second moments of the gradient during each parameter update.
[0024] In one embodiment, the step of calculating the loss function between the probability sequence output by the initial model and the soft label includes:
[0025] Determine whether the loss function is within a preset threshold range;
[0026] If the loss function fails to fall within the preset threshold range, the gradient of the loss function is clipped so that the loss function falls within the preset threshold range.
[0027] In one embodiment, the step of extracting target peak sequence points from the probability sequence to generate subgraph splicing lines, and using the subgraph splicing lines to splice multiple subgraphs into a complete long image, includes:
[0028] Peak detection is performed on the probability sequence, and local maximum points are determined based on the detection results;
[0029] The target peak sequence points are determined from the local maximum points using preset filtering conditions, and the sub-graph splicing line is generated based on the target peak sequence points.
[0030] In one embodiment, the step of performing peak detection on the probability sequence and determining local maximum points based on the detection results includes:
[0031] A probability threshold is set according to the image parameters of the sub-image, and a probability value greater than or equal to the concept threshold is retained in the probability sequence as the local maximum point;
[0032] And / or, set the minimum interval between adjacent peaks, and ensure that the probability value of the distance between adjacent target peak sequence points meets the minimum interval requirement is used as the local maximum point;
[0033] And / or, a non-maximum suppression method is used to select target peak sequence points in the probability sequence as the local maximum points.
[0034] In addition, to achieve the above objectives, this application also proposes a long image restoration device based on discrete probability distribution, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the long image restoration method based on discrete probability distribution as described above.
[0035] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the long graph restoration method based on discrete probability distribution as described above.
[0036] One or more technical solutions proposed in this application have at least the following technical effects:
[0037] The technical solution of this application generates training samples based on multiple sub-images cut from a long product detail image, and constructs a Gaussian probability distribution centered on the cutting position. The training samples are input into an initial model, and the Gaussian probability distribution is used as soft labels to supervise the training process of the initial model. A VIT model is obtained based on the supervision results of the soft labels, and multiple sub-images are input into the output probability sequence of the VIT model. Target peak sequence points are extracted from the probability sequence to generate sub-image splicing lines, and these lines are used to splice the multiple sub-images into a complete long image. Therefore, this application trains the ViT model using Gaussian probability distribution soft labels, transforms cutting line localization into probability sequence prediction, and utilizes peak detection to generate splicing cues, achieving accurate and automatic restoration of the long image, effectively improving restoration accuracy and robustness to cutting deviations. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a flowchart illustrating the first embodiment of the long graph restoration method based on discrete probability distribution in this application;
[0041] Figure 2 This is a schematic diagram of the device structure of the hardware operating environment involved in the long graph restoration method based on discrete probability distribution in the embodiments of this application.
[0042] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0043] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0044] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0045] The main solution of this application embodiment is as follows: training samples are generated based on multiple sub-images cut from a long image of product details, and a Gaussian probability distribution is constructed with the cutting position as the center; the training samples are input into an initial model, and the Gaussian probability distribution is used as a soft label to supervise the training process of the initial model; a VIT model is obtained according to the supervision results of the soft label, and multiple sub-images are input into the output probability sequence of the VIT model; target peak sequence points are extracted from the probability sequence to generate sub-image splicing lines, and multiple sub-images are spliced into a complete long image using the sub-image splicing lines.
[0046] In existing technologies, there is a lack of effective methods to restore a set of segmented sub-images to its original, complete long-image state. Current image processing techniques largely focus on image segmentation or pattern recognition, neglecting the reverse restoration problem specific to this scenario. Because the segmentation process does not consider the semantic boundaries of the image content, content-aware restoration becomes exceptionally difficult. This situation prevents users from obtaining a complete long-image visual experience and creates obstacles for downstream applications that require complete image content for data analysis or quality monitoring.
[0047] This application provides a solution that trains a ViT model using Gaussian probability distribution soft labels, transforms cutting line localization into probability sequence prediction, and uses peak detection to generate splicing cues, thereby achieving accurate and automatic restoration of long images and effectively improving restoration accuracy and robustness to cutting deviations.
[0048] Based on this, embodiments of this application provide a long graph reconstruction method based on discrete probability distribution, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the long image restoration method based on discrete probability distribution according to this application. In this embodiment, the long image restoration method based on discrete probability distribution includes steps S10 to S40:
[0049] Step S10: Generate training samples based on multiple sub-images cut from the long image of product details, and construct a Gaussian probability distribution centered on the cutting position;
[0050] In this embodiment, when generating training samples based on multiple sub-images cut from a long product detail image, the original long product detail image dataset needs to be obtained to generate the training samples. Specifically, the long product detail image dataset contains complete product display content, and the resolution feature of the product display content is a fixed width and a variable height. By performing a procedural cutting operation on the long product detail images in the long product detail image dataset, a set of sub-image samples that meet the training requirements is generated. In this procedural cutting operation, a strategy of fixed height and variable cutting position is adopted, that is, while keeping the width of the sub-image consistent with the width of the original long image, a sliding window sampling is performed along the vertical direction with a random starting position to ensure that each sub-image sample contains continuous and partially overlapping and / or non-overlapping image content.
[0051] During the training sample generation process, the spatial location information of each sub-image sample within the original long image needs to be accurately recorded. This spatial location information specifically includes the ordinate values of the top and bottom boundaries of the sub-image within the original long image, as well as the overlapping area between adjacent sub-images. This spatial location information will serve as the foundational data for subsequently constructing the supervisory signal. Simultaneously, to enhance the diversity of the training samples, data augmentation processing is performed on the original product detail image. This data augmentation includes operations such as color space transformation, geometric deformation correction, and noise injection to generate derived samples with different visual characteristics.
[0052] The process of constructing a Gaussian probability distribution centered on the cutting position involves soft labeling of the supervision signal. This embodiment uses a label smoothing technique based on the Gaussian kernel function to construct a continuous one-dimensional Gaussian probability distribution as a soft label, centered on the actual cutting line position μ. The probability density function of the Gaussian probability distribution is:
[0053] ;
[0054] Where h is the pixel position in the height direction, μ is the actual cutting line position, and σ is a hyperparameter controlling the distribution width.
[0055] In another feasible implementation, an adaptive bandwidth mechanism is used to construct the Gaussian probability distribution. The σ parameter of the Gaussian kernel is dynamically adjusted according to the semantic complexity of the sub-image content. A smaller bandwidth value is used for regions with complex textures and dense edges to maintain positioning accuracy, while a larger bandwidth value is used for regions with smooth content and sparse features to enhance generalization ability. Simultaneously, the Gaussian kernel function can be extended to a Gaussian mixture model, using a linear combination of multiple Gaussian distributions to model complex cutting line position distributions, better adapting to the structural characteristics of different product detail images.
[0056] Step S20: Input the training samples into the initial model, and use the Gaussian probability distribution as soft labels to supervise the training process of the initial model;
[0057] In this embodiment, the generation of the training samples follows a systematic data processing flow. Specifically, original product detail images are collected from relevant data platforms. These product detail images are typically stored in JPEG or PNG format and contain diverse visual content such as product display, parameter descriptions, and usage scenarios. The collected product detail images undergo quality screening and preprocessing to remove samples with excessively low resolution, corrupted content, or incomplete information, ensuring the consistency of the training data quality. The preprocessing operation also includes image size normalization, uniformly scaling long images from different sources to a standard width while maintaining the aspect ratio.
[0058] Furthermore, an overlapping sliding window algorithm is used to implement the cutting operation. By setting a fixed sub-image height H and an overlapping area height O, starting from the top of the product details long image, the algorithm slides downwards with a step size S=HO, sequentially capturing sub-image samples. This overlapping sampling strategy ensures the continuity of content between adjacent sub-images, providing necessary contextual information for subsequent stitching and reconstruction. Moreover, each sub-image sample is accompanied by metadata annotations, including key attributes such as sample identifier, original long image source, vertical position range within the long image, and relationship between adjacent sub-images.
[0059] Furthermore, the physical meaning and geometric characteristics of the cutting line's position need to be fully considered when constructing the Gaussian probability distribution. Specifically, in the long image of the product details, the cutting line actually corresponds to the splicing boundary between sub-images, and its precise position directly affects the visual coherence of the restored long image. The soft label based on the Gaussian kernel not only reflects the theoretical position of the cutting line but also expresses the uncertainty of the position estimation in the form of a probability distribution.
[0060] In another feasible implementation, the training samples can be generated using a semantic segmentation-based enhancement strategy. First, a pre-trained semantic segmentation model is used to analyze the long image of the product details page, identifying different semantic units such as text regions, product main body regions, and background regions. Then, the cutting positions are adjusted according to semantic boundaries to avoid cutting at the center of important visual elements.
[0061] Specifically, the step of using the Gaussian probability distribution as soft labels to supervise the training process of the initial model includes:
[0062] The Gaussian probability distribution is used as a supervision signal to compare the difference between the probability sequence output by the initial model and the soft label, and the parameters of the initial model are adjusted according to the difference.
[0063] The Gaussian probability distribution is centered on the actual cutting line position and forms a continuous probability distribution in the height direction.
[0064] In this embodiment, using a Gaussian probability distribution as a supervisory signal involves spatial alignment and similarity measurement of the probability distribution. The Gaussian probability distribution is centered at the true cutting line position μ, constructing a continuous probability density function along the height dimension. Its distribution shape is controlled by the standard deviation parameter σ. The soft labels serve as a supervisory benchmark during training, assigning corresponding probability weights to each possible height position, rather than using traditional binary labeling. This soft supervision strategy enables the model to learn the statistical characteristics of the cutting line position, rather than simply relying on hard boundaries.
[0065] Furthermore, the difference between the probability sequence output by the initial model and the soft labels is achieved through a probability distribution distance metric function. Specifically, the initial model outputs a probability sequence for each input sub-graph, which corresponds to the height dimension of the sub-graph and represents the confidence level of the initial model in predicting the existence of cutting lines at each height position. This predicted probability sequence is then compared point-by-point with the Gaussian kernel-based soft label distribution to calculate the difference between the two at the statistical distribution level.
[0066] In another feasible implementation, a multi-scale distribution matching strategy is employed for difference comparison. This involves downsampling the probability sequences at different resolutions to construct a multi-scale probability pyramid, and then calculating the difference between the predicted distribution and the target distribution at each scale of the multi-scale probability pyramid. This multi-scale comparison method can simultaneously consider both the overall distribution pattern and local detailed features, enhancing the model's ability to perceive the location of the cutting line.
[0067] Furthermore, the process of adjusting the initial model parameters based on the differences is implemented based on the gradient descent optimization principle. Specifically, the loss function value is calculated using a difference metric, and then the gradient of the loss function with respect to the parameters of each layer of the initial model is calculated using the backpropagation algorithm. Moreover, the weight matrix and bias terms of the initial model are updated according to the gradient direction, so that the probability distribution output by the initial model gradually approximates the soft-label distribution based on a Gaussian kernel. An adaptive learning rate strategy is employed during the parameter adjustment process based on the initial model, dynamically adjusting the update magnitude according to the importance of the parameters to ensure the stability and convergence efficiency of the training process.
[0068] Furthermore, the step of using the Gaussian probability distribution as a supervision signal, comparing the difference between the probability sequence output by the initial model and the soft label, and adjusting the parameters of the initial model based on the difference includes:
[0069] Calculate the loss function between the probability sequence output by the initial model and the soft label;
[0070] The backpropagation algorithm is optimized based on the loss function, and the parameters of the initial model are optimized using the optimized backpropagation algorithm.
[0071] In this embodiment, when calculating the loss function between the probability sequence output by the initial model and the soft label, the Kullback-Leibler divergence is used as a quantitative indicator of distribution difference. Specifically, the Kullback-Leibler divergence is used to measure the asymmetric distance between two probability distributions. The mathematical expression for the asymmetric distance is: L = Σ[P_gt(h_i) · log(P_gt(h_i) / P_pred(h_i))], where P_gt(h_i) represents the Gaussian soft label value at height position h_i, and P_pred(h_i) represents the predicted probability value of the initial model at this height position. Because the loss function is sensitive to the relative proportion between the predicted probability and the target probability, it can effectively capture subtle differences in distribution patterns.
[0072] In another feasible implementation, the calculation of the loss function can be achieved by combining a hybrid loss scheme of Wasserstein distance and Kullback-Leibler divergence. The Wasserstein distance measures the minimum transport cost between two distributions and is more robust to changes in the support set of the distributions; while the Kullback-Leibler divergence is more sensitive to relative changes in distribution density. Therefore, a hybrid loss function is constructed by linearly combining the Wasserstein distance and the Kullback-Leibler divergence. The formula for the hybrid loss function is: L = α·L_Wasserstein + β·L_KL, where α and β are balancing hyperparameters. This hybrid loss strategy can simultaneously maintain the accuracy and robustness of distribution alignment.
[0073] Furthermore, the process of optimizing the backpropagation algorithm based on the loss function is achieved through refined gradient calculation and propagation path design. This requires calculating the partial derivative of the loss function with respect to the initial model's output layer probability sequence, and then propagating back to the network's bottom layers layer by layer using a chain rule. To alleviate the vanishing gradient problem in deep networks, a gradient rescaling mechanism is introduced into the backpropagation path to normalize the gradient signal of each layer. Simultaneously, a gradient clipping strategy is implemented to limit the norm of the gradient vector within a reasonable range, preventing instability during training due to gradient explosion.
[0074] When optimizing the initial model parameters based on the optimized backpropagation algorithm, an adaptive optimization algorithm and a learning rate scheduling strategy need to be integrated. The adaptive optimization algorithm uses the AdamW algorithm as the optimizer, introducing decoupled weight decay on top of the standard Adam optimizer to prevent overfitting. The learning rate scheduling strategy employs cosine annealing, smoothly reducing the learning rate during training, allowing for fine-tuning of the initial model's parameters in the later stages of training. Furthermore, a hierarchical learning rate strategy is implemented, setting different learning rates for different components of the initial model; for example, a lower learning rate is set for the backbone feature extraction network, and a higher learning rate is set for the prediction head network, balancing the requirements of feature preservation and task adaptation. The entire optimization process iteratively updates and continuously reduces the loss function value, driving the initial model to gradually approach the expected performance target.
[0075] Specifically, the calculation process of the loss function can be limited to the steps of calculating the loss function between the probability sequence output by the initial model and the soft label, including:
[0076] Determine whether the loss function is within a preset threshold range;
[0077] If the loss function fails to fall within the preset threshold range, the gradient of the loss function is clipped so that the loss function falls within the preset threshold range.
[0078] In this embodiment, determining whether the loss function is within a preset threshold range is achieved by real-time monitoring of loss value fluctuations during the training process. The preset threshold range is determined jointly by the theoretical minimum value of the loss function and the typical loss value during the model convergence phase. The lower limit of the preset threshold range is set as a warning value to avoid premature convergence, while the upper limit is set as a critical value to prevent gradient explosion. Before each parameter update, the positional relationship of the current loss value relative to the preset threshold range is automatically detected, and a loss status evaluation report is generated.
[0079] Furthermore, when the loss function fails to fall within a preset threshold range, a gradient pruning mechanism is automatically activated. This mechanism operates based on the global gradient norm. First, the L2 norm of the gradients of all trainable parameters is calculated. When the L2 norm exceeds a preset pruning threshold, the entire gradient vector is scaled proportionally until its norm equals the pruning threshold. The specific calculation formula is: if ||g||>c, then g ← g × c / ||g||, where g represents the gradient vector and c represents the pruning threshold. This scaling operation maintains the consistency of gradient direction while controlling the update step size.
[0080] In another feasible implementation, the gradient clipping can employ a hierarchical adaptive strategy. Specifically, differentiated clipping thresholds are set according to the gradient characteristics of different network layers. A more lenient clipping threshold is used for the bottom visual feature extraction layers to retain rich feature information, while a stricter clipping threshold is used for the top prediction layers to enhance training stability. Furthermore, the clipping threshold can be dynamically adjusted according to the training progress. A larger threshold is used in the early stages of training to allow for rapid convergence, while the threshold is gradually reduced in the later stages of training to improve convergence accuracy.
[0081] Furthermore, the implementation of the gradient pruning process requires comprehensive consideration of training batch size and network depth. For mini-batch training scenarios, a gradient accumulation mechanism is introduced, using the gradient averaging of multiple mini-batch training operations to obtain a more stable gradient estimate before performing the pruning operation. For deep network structures, multiple gradient checkpoints are inserted into the backpropagation path to monitor the gradient state of each layer in real time, preventing gradient anomalies from being amplified layer by layer during propagation. Through these fine-grained controls, the loss function is ensured to remain within a preset threshold range, maintaining the numerical stability of the training process.
[0082] Furthermore, the parameter optimization process based on the initial model can be defined as the steps of optimizing the backpropagation algorithm based on the loss function and using the optimized backpropagation algorithm to optimize the parameters of the initial model, including:
[0083] An adaptive moment estimation algorithm is used as the optimizer to calculate the first-order moment estimate and the second-order moment estimate of the loss function.
[0084] The learning rate of the initial model parameters is dynamically adjusted based on the calculated first-order moment estimate and second-order moment estimate.
[0085] The adaptive moment estimation algorithm adaptively adjusts the learning step size of each parameter in the initial model based on the first and second moments of the gradient during each parameter update.
[0086] In this embodiment, an adaptive moment estimation algorithm is implemented as the optimizer based on the mathematical framework of the Adam optimizer. This adaptive moment estimation algorithm dynamically adjusts the learning rate by maintaining first-order and second-order moment estimates for each parameter. The first-order moment estimate m_t is calculated as the exponential moving average of the gradient g_t. This reflects the directional trend of the gradient; the second-order moment estimate v_t is calculated as the exponential moving average of the squared gradient. , which is used to reflect the magnitude change of the gradient, and β is a balance hyperparameter.
[0087] The dynamic adjustment of the parameter learning rate based on the first-order and second-order moment estimates is achieved through bias correction and normalization. Since the moment estimates have a bias towards zero in the initial stage, bias correction is required. Therefore, the parameter update formula is: where α is the global learning rate, ε is the numerical stability constant, and m_t is the exponential moving average. This update method allows each parameter to have an adaptive learning step size, decreasing the learning rate for frequently updated parameters and increasing the learning rate for sparsely updated parameters.
[0088] In another feasible implementation, the adaptive moment estimation algorithm can be extended to an AdamW variant, decoupling weight decay from gradient updates. Based on AdamW, the weight decay term is handled separately, with L2 penalties applied directly during parameter updates. This improvement decouples the effect of weight decay from gradient values, enhancing the robustness of hyperparameter settings. The specific update formula is defined as:
[0089] , where λ is the weight decay coefficient.
[0090] The hyperparameter configuration of the adaptive moment estimation algorithm needs to be carefully tuned according to the model architecture and data characteristics. Specifically, the momentum parameter β1 is typically set to 0.9 to control the decay rate of the first-order moment estimation; the second-order moment estimation parameter β2 is set to 0.999 to control the smoothness of the variance estimation; and the numerical stability constant ε is set to 1e-8 to avoid division-by-zero errors. Based on this, considering the specific characteristics of the product detail image reconstruction task, different hyperparameter combinations can be set for the visual Transformer backbone network and the prediction head network, balancing the training pace of feature extraction and task adaptation through a hierarchical optimization strategy.
[0091] Step S30: Obtain the VIT model based on the supervision results of the soft labels, and input the multiple subgraphs into the output probability sequence of the VIT model;
[0092] In this embodiment, the process of obtaining the VIT model based on the supervision results of soft labels adopts an end-to-end deep learning training paradigm. The VIT model is built on a visual Transformer architecture, including an embedding layer, a multi-layer Transformer encoder, and an output prediction head. The embedding layer is responsible for dividing the input sub-image into fixed-size image patches and converting each image patch into a token vector through linear projection, while adding learnable positional encoding to preserve spatial information. The Transformer encoder consists of multiple self-attention layers and feedforward neural network layers stacked together, capturing the global dependencies of image content through a multi-head self-attention mechanism.
[0093] The VIT model is trained using soft labels as supervision signals and KL divergence as the core metric of the loss function. Specifically, for each training sample, the difference between the probability distribution output by the model and the distribution of the soft labels based on a Gaussian kernel is calculated using KL divergence:
[0094] ;
[0095] Wherein, Pgt(hi) is defined as the height position. The Gaussian soft label value at position i, where Ppred(hi) is defined as the predicted probability value of the initial model at that height position. The loss function design aims to make the probability distribution of the model output as close as possible to the ideal soft label distribution, rather than simply matching a single cutting line position.
[0096] When inputting multiple subgraphs into the VIT model to output a probability sequence, a batch inference mechanism is involved. Specifically, during the inference phase, the set of subgraphs to be restored is organized into batches according to their logical order in the original long graph and input into the trained VIT model sequentially. For each input subgraph, the VIT model outputs a probability sequence corresponding to the height dimension of the subgraph, where each element represents the probability confidence that a cutting line exists at that height position.
[0097] In another feasible implementation, the architecture of the VIT model can integrate a cross-scale feature fusion mechanism. Based on the Transformer encoder, a feature pyramid network structure is introduced to integrate feature maps of different scales through top-down paths and lateral connections. This multi-scale feature fusion strategy enables the model to simultaneously utilize local detail information and global contextual information, improving the accuracy of perceiving the cutting line position.
[0098] Furthermore, the step of obtaining the VIT model based on the supervision results of the soft labels and inputting multiple subgraphs into the output probability sequence of the VIT model includes:
[0099] The predicted splicing lines are extracted from the training results of the initial model, and the positions of the predicted splicing lines are compared with the actual splicing lines represented by the soft labels.
[0100] If the predicted splicing line and the actual splicing line are in the same position, the initial model is used as the VIT model.
[0101] In this embodiment, extracting the predicted stitching line from the training results of the initial model involves post-processing and analysis of the probability sequence output by the initial model. Specifically, the initial model generates a probability sequence along the height dimension for each input sub-image, reflecting the likelihood that each pixel position will serve as a cutting line. To this end, a local maximum detection algorithm is applied to identify all candidate positions in the probability sequence that satisfy the peak condition, i.e., this probability value is simultaneously higher than several preceding and subsequent pixel positions. The saliency of the candidate peak points at these candidate positions is evaluated, comprehensively considering factors such as peak height, peak sharpness, and the relative height difference with neighboring peaks, to finally determine the precise position coordinates of the predicted stitching line.
[0102] A similarity metric based on Euclidean distance is used to compare the predicted splicing lines with the actual splicing lines represented by soft labels. Since the soft labels are continuous representations based on Gaussian probability distributions, the actual splicing line positions correspond to the peak center points of the probability distribution. A quantitative index of positional deviation is obtained by calculating the absolute distance between the predicted and actual splicing line positions in the height dimension. Simultaneously, considering that multiple candidate positions may exist for splicing line detection, a one-to-one matching relationship is established to ensure that each actual splicing line is compared with its closest predicted splicing line.
[0103] In another feasible implementation, a multi-objective matching strategy based on the Hungarian algorithm is used for position comparison. Specifically, when there are multiple predicted splicing lines and multiple real splicing lines that need to be compared, a cost matrix is constructed to record the position deviation of all possible preset splicing lines and real splicing line pairing combinations, and the optimal pairing scheme is found through the Hungarian algorithm to minimize the overall position deviation.
[0104] Furthermore, the judgment criteria based on positional consistency need to set a reasonable fault tolerance threshold. Considering the inherent errors in manual annotation and the limitations of image resolution, the standard for positional consistency is defined as the Euclidean distance between the predicted stitching line and the actual stitching line not exceeding a preset pixel tolerance range. The pixel tolerance range is usually determined comprehensively based on image resolution, sub-image size, and business accuracy requirements. It should not be too strict, which would make it difficult for the model to meet the requirements, nor too lenient, which would affect the subsequent stitching quality.
[0105] If the predicted splicing line and the actual splicing line are in the same position, the initial model is used as the validation process for the VIT model, which requires statistical significance testing. The initial model is systematically evaluated on an independent validation set, calculating the splicing line position accuracy, average position deviation, and success rate for all samples. When all of these indicators reach the preset performance benchmark, the initial model is confirmed to have met commercial standards and can be formally deployed and used as the VIT model.
[0106] The validation process based on the VIT model also requires additional robustness testing. This involves constructing test cases with varying levels of challenge, including disturbances such as changes in lighting, noise interference, and compression distortion, to verify the stability of the VIT model under different abnormal conditions. The VIT model that passes comprehensive testing is then confirmed as a qualified VIT model, ensuring its reliable performance in real e-commerce environments.
[0107] Furthermore, if the predicted stitching line fails to match the actual stitching line in position, the model iterative optimization process will be automatically triggered. Based on the analysis results of the positional deviation, the systematic error patterns existing in the VIT model are identified, and the training strategy or model architecture is adjusted accordingly.
[0108] Step S40: Extract target peak sequence points from the probability sequence to generate sub-graph splicing lines, and use the sub-graph splicing lines to splice multiple sub-graphs into a complete long image.
[0109] In this embodiment, a multi-stage peak detection algorithm is used to extract target peak sequence points from the probability sequence to generate subgraph splicing lines. Specifically, the original probability sequence output by the VIT model is first smoothed by using Gaussian filtering to suppress local fluctuations caused by noise and enhance meaningful probability peaks. Then, a local maximum detection algorithm is applied to identify all candidate positions in the probability sequence that meet the peak condition, that is, points whose probability values are greater than several adjacent positions are taken as candidate positions. These candidate peak points constitute a preliminary set of hypothetical cutting line positions.
[0110] Peak detection is performed by setting appropriate sensitivity parameters, including a minimum height threshold for the peak and a minimum distance constraint between peaks. For each candidate peak point, a corresponding significance score is calculated, which comprehensively considers multiple factors such as the peak's height, sharpness, and height ratio with adjacent peaks. Candidate peaks are then sorted and filtered based on the significance scores, and the final determined target peak sequence points are the predicted cutting line positions. The cutting line positions define the stitching boundaries between sub-images and are key geometric parameters for image reconstruction.
[0111] Furthermore, multiple sub-images are stitched together into a complete long image using image registration and fusion techniques along sub-image stitching lines. The overlapping area between adjacent sub-images is calculated based on the predicted cutting line positions, and the relative displacement between sub-images is precisely calibrated using a feature matching algorithm. Additionally, a transformation matrix between sub-images is calculated using phase correlation or SIFT-based feature matching, and this transformation matrix includes translation, rotation, and scaling parameters. During the image fusion stage, a multi-band mixing algorithm is used to smooth the stitching boundaries, avoiding obvious seams or visual discontinuities.
[0112] In another feasible implementation, this stitching process can incorporate a global optimization strategy, modeling the entire stitching task using a graph model for optimization. Specifically, nodes in the graph represent subgraphs, edges represent adjacency relationships, and edge weights reflect stitching quality. By solving for the maximum spanning tree or applying dynamic programming algorithms, the optimal stitching path and parameter settings are determined, effectively handling situations with complex geometric deformations between subgraphs and ensuring the accuracy and visual coherence of the final reconstructed long image. Simultaneously, a stitching quality assessment mechanism is established to automatically detect the quality of the reconstruction results, identifying and marking potentially problematic stitching areas, providing a reference for subsequent manual verification.
[0113] Furthermore, the step of extracting target peak sequence points from the probability sequence to generate subgraph splicing lines, and using the subgraph splicing lines to splice multiple subgraphs into a complete long image, includes:
[0114] Peak detection is performed on the probability sequence, and local maximum points are determined based on the detection results;
[0115] The target peak sequence points are determined from the local maximum points using preset filtering conditions, and the sub-graph splicing line is generated based on the target peak sequence points.
[0116] In this embodiment, a local extremum identification algorithm based on a sliding window is used to detect peaks in the probability sequence. The probability sequence is a sequence of probability values distributed along the height dimension output by the VIT model. Each element of the probability sequence represents the confidence level that a cutting line exists at the corresponding height position. First, the original probability sequence is Gaussian smoothed, and convolution is performed using a Gaussian kernel with a standard deviation of σ. Then, a sliding window of width W is used to traverse the entire probability sequence to identify local maximum points that satisfy preset value conditions. The preset value conditions include the following conditions within the current sliding window: the probability value of the center point is strictly greater than the probability values of all other points, and its probability value exceeds a preset absolute threshold θ_abs.
[0117] Furthermore, the boundary conditions of the probability sequence need to be considered during the determination of local maxima. Specifically, for the window calculation of the start and end positions of the probability sequence, a mirror-filling strategy is used to expand the sequence boundary to ensure that the boundary region can also be correctly detected. Each detected local maxima is recorded with its position coordinates h_i and corresponding probability value p_i, forming a preliminary set of candidate peaks. To further verify the reliability of the candidate peaks, a significance index is calculated for each candidate peak, including kurtosis sharpness, probability difference with neighboring valleys, and local signal-to-noise ratio.
[0118] In another feasible implementation, a precise localization method based on the zero point of the first derivative is used for peak detection. The first numerical derivative is calculated on the smoothed probability sequence, and then the zero-crossing point where the first numerical derivative changes from positive to negative is detected. This zero-crossing point corresponds to a local maximum point of the probability function. Sub-pixel-level precise localization of the region near the zero-crossing point is achieved through cubic spline interpolation, yielding a more accurate peak coordinate estimate than that of integer pixel positions.
[0119] When determining the target peak sequence points from the local maximum points using preset screening conditions, a multi-level filtering mechanism needs to be implemented. The first level of filtering based on the multi-level filtering mechanism is based on the absolute probability threshold, which eliminates candidate peaks with probability values lower than θ_abs. The second level of filtering is based on the relative significance threshold, which requires that the probability value of the candidate peak is at least θ_rel times the probability of its neighboring valleys. The third level of filtering is based on spatial distribution constraints, which ensures that the minimum distance between adjacent target peaks is not less than D_min, and avoids dense pseudo-peaks caused by noise.
[0120] Furthermore, the filtering conditions based on the multi-level filtering mechanism also include a rationality check based on prior knowledge. According to the typical layout characteristics of the product detail image, the candidate peak positions are verified to ensure they conform to common cutting patterns. For example, it checks for abnormal cutting points that violate content continuity, filtering out abnormal peaks located outside obvious semantic boundaries (such as the boundary between the title and body text). Simultaneously, it considers the overlap constraints between adjacent sub-images to ensure that the generated splicing lines form reasonable overlapping areas.
[0121] Furthermore, generating sub-image stitching lines based on target peak sequence points involves precise calculation of geometric parameters. Each target peak sequence point corresponds to a cutting line position, and a complete stitching line network is formed by connecting these cutting line positions. For each stitching line in the stitching line network, in addition to recording its height coordinates, its confidence score must also be calculated. This confidence score is used to synthesize the peak probability value, significance index, and spatial consistency measure of the candidate peaks. The final generated set of sub-image stitching lines serves as the geometric guide for subsequent image stitching operations, ensuring that multiple sub-images can be accurately aligned and restored into a complete long image.
[0122] In another feasible implementation, a non-maximum suppression algorithm is introduced to determine the target peak sequence points. For multiple candidate peaks that are too close in space, only the peak with the highest significance is retained, and the remaining secondary peaks are suppressed to avoid generating redundant splicing lines in adjacent positions, ensuring the simplicity and effectiveness of the splicing result. At the same time, a topological relationship graph between splicing lines is established, and the spatial distribution of the splicing lines is further optimized through a graph optimization algorithm to make it more consistent with the actual content distribution pattern.
[0123] Specifically, the step of performing peak detection on the probability sequence and determining local maximum points based on the detection results includes:
[0124] A probability threshold is set according to the image parameters of the sub-image, and a probability value greater than or equal to the concept threshold is retained in the probability sequence as the local maximum point;
[0125] And / or, set the minimum interval between adjacent peaks, and ensure that the probability value of the distance between adjacent target peak sequence points meets the minimum interval requirement is used as the local maximum point;
[0126] And / or, a non-maximum suppression method is used to select target peak sequence points in the probability sequence as the local maximum points.
[0127] In this embodiment, an adaptive threshold calculation based on image features is used to set a probability threshold for the image parameters of the sub-image. These image parameters include the sub-image's resolution size, content complexity index, and average confidence level. Furthermore, a quantile-based method based on statistical distribution is employed to set the probability threshold. By analyzing the numerical distribution characteristics represented by the probability sequence on the validation set, the probability threshold is set as a critical value that controls the false positive rate within a predetermined range. Specifically, for a sub-image with a resolution of H×W, its probability threshold... Where μ is the mean of the probability sequence, σ is the standard deviation, and k is a sensitivity coefficient adjusted according to business needs.
[0128] In another feasible implementation, a content-aware dynamic adjustment strategy is used to set the probability threshold. The semantic content complexity of the subgraph is analyzed by an auxiliary network. For regions with complex textures and dense edges, the threshold is appropriately increased to avoid false detections, while for regions with smooth content, the threshold is appropriately decreased to ensure detection recall. Simultaneously, considering the average prediction confidence of the VIT model across different subgraphs, a more conservative threshold setting is applied to low-confidence samples to ensure the reliability of the detection results.
[0129] In addition, based on the physical constraints and visual continuity requirements of the splicing lines, a minimum interval between adjacent peaks is set. This minimum interval is defined as Δ_min. The determination of this minimum interval requires comprehensive consideration of the sub-image height H, the expected overlap area ratio η, and content continuity constraints. The formula for calculating the minimum interval is as follows: Where δ_min is the minimum pixel distance.
[0130] Furthermore, an iterative peak selection mechanism is implemented to screen target peak sequence points. The candidate peaks are sorted in descending order of probability value, and each candidate peak is processed sequentially. For the currently processed peak point, all secondary peaks within a range of Δ_suppress are suppressed, where Δ_suppress is typically set as a multiple of the minimum interval Δ_min. A soft suppression strategy is employed, which does not completely zero out secondary peaks but rather decays their probability values according to their distance from the main peak, retaining a certain probability for subsequent analysis.
[0131] In comprehensive applications, local maxima are determined using the aforementioned constraints. Low-confidence candidates are filtered using the probability threshold, and non-maximum suppression is implemented to remove redundant peaks. Finally, it is verified whether the remaining peaks meet the minimum interval requirement. For peak pairs that do not meet the interval requirement, the peak with the higher probability value is retained, while the peak with the lower probability value is discarded.
[0132] In this embodiment, the ViT model is trained by Gaussian probability distribution soft labels, which transforms the cutting line location into probability sequence prediction. Peak detection is used to generate splicing clues, thereby achieving accurate and automatic restoration of long images and effectively improving restoration accuracy and robustness to cutting deviations.
[0133] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the long graph restoration method based on discrete probability distribution in this application. Any simple transformations based on this technical concept are within the protection scope of this application.
[0134] This application provides a long image restoration device based on discrete probability distribution. The long image restoration device based on discrete probability distribution includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the long image restoration method based on discrete probability distribution in the above embodiment 1.
[0135] The following is for reference. Figure 2 The diagram illustrates a structural schematic suitable for implementing a long image reconstruction device based on discrete probability distribution in the embodiments of this application. The long image reconstruction device based on discrete probability distribution in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 2The long graph reconstruction device based on discrete probability distribution shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0136] like Figure 2 As shown, the long image reconstruction device based on discrete probability distribution may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The random access memory 1004 also stores various programs and data required for the operation of the long image reconstruction device based on discrete probability distribution. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the long graph reconstruction device based on discrete probability distributions to wirelessly or wiredly communicate with other devices to exchange data. Although the figure shows a long graph reconstruction device based on discrete probability distributions with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0137] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0138] The long image restoration device based on discrete probability distribution provided in this application, employing the long image restoration method based on discrete probability distribution in the above embodiments, can solve the technical problem of inaccurate long image restoration caused by blurred cutting line positioning in existing technologies. Compared with the prior art, the beneficial effects of the long image restoration device based on discrete probability distribution provided in this application are the same as those of the long image restoration method based on discrete probability distribution provided in the above embodiments, and other technical features in this long image restoration device based on discrete probability distribution are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0139] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0140] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0141] This application provides a storage medium, which is a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the long graph restoration method based on discrete probability distribution in the above embodiments.
[0142] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the 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, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), or any suitable combination thereof.
[0143] The aforementioned computer-readable storage medium may be included in a long image reconstruction device based on discrete probability distribution; or it may exist independently and not assembled into a long image reconstruction device based on discrete probability distribution.
[0144] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by the long image restoration device based on discrete probability distribution, the long image restoration device based on discrete probability distribution implements the technical content of the long image restoration method embodiment based on discrete probability distribution as shown above.
[0145] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0146] 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 this application. 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 the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can 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.
[0147] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0148] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described long image restoration method based on discrete probability distribution. This solves the existing technical problem of inaccurate long image restoration caused by blurred cutting line positioning. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the long image restoration method based on discrete probability distribution provided in the above embodiments, and will not be repeated here.
Claims
1. A method for restoring long graphs based on discrete probability distributions, characterized in that, The long graph restoration method based on discrete probability distribution includes the following steps: Training samples are generated by cutting multiple sub-images from a long image of product details, and a Gaussian probability distribution is constructed with the cutting position as the center. The training samples are input into the initial model, and the Gaussian probability distribution is used as a soft label to supervise the training process of the initial model; The VIT model is obtained based on the supervision results of the soft labels, and multiple subgraphs are input into the output probability sequence of the VIT model. Extract target peak sequence points from the probability sequence to generate sub-graph splicing lines, and use the sub-graph splicing lines to splice multiple sub-graphs into a complete long image; The step of using the Gaussian probability distribution as soft labels to supervise the training process of the initial model includes: The Gaussian probability distribution is used as a supervision signal to compare the difference between the probability sequence output by the initial model and the soft label, and the parameters of the initial model are adjusted according to the difference; wherein, the Gaussian probability distribution forms a continuous probability distribution in the height direction with the actual cutting line position as the center.
2. The long graph reconstruction method based on discrete probability distribution as described in claim 1, characterized in that, The step of obtaining the VIT model based on the supervision results of the soft labels and inputting multiple subgraphs into the output probability sequence of the VIT model includes: The predicted splicing lines are extracted from the training results of the initial model, and the positions of the predicted splicing lines are compared with the actual splicing lines represented by the soft labels. If the predicted splicing line and the actual splicing line are in the same position, the initial model is used as the VIT model.
3. The long graph reconstruction method based on discrete probability distribution as described in claim 1, characterized in that, The step of using a Gaussian probability distribution as a supervision signal, comparing the difference between the probability sequence output by the initial model and the soft label, and adjusting the parameters of the initial model based on the difference includes: Calculate the loss function between the probability sequence output by the initial model and the soft label; The backpropagation algorithm is optimized based on the loss function, and the parameters of the initial model are optimized using the optimized backpropagation algorithm.
4. The long graph reconstruction method based on discrete probability distribution as described in claim 3, characterized in that, The steps of optimizing the backpropagation algorithm based on the loss function and then optimizing the parameters of the initial model using the optimized backpropagation algorithm include: An adaptive moment estimation algorithm is used as the optimizer to calculate the first-order moment estimate and the second-order moment estimate of the loss function. The learning rate of the initial model parameters is dynamically adjusted based on the calculated first-order moment estimate and second-order moment estimate. The adaptive moment estimation algorithm adaptively adjusts the learning step size of each parameter in the initial model based on the first and second moments of the gradient during each parameter update.
5. The long graph reconstruction method based on discrete probability distribution as described in claim 3, characterized in that, The step of calculating the loss function between the probability sequence output by the initial model and the soft label includes: Determine whether the loss function is within a preset threshold range; If the loss function fails to fall within the preset threshold range, the gradient of the loss function is clipped so that the loss function falls within the preset threshold range.
6. The long graph reconstruction method based on discrete probability distribution as described in claim 1, characterized in that, The steps of extracting target peak sequence points from the probability sequence to generate sub-graph splicing lines, and using the sub-graph splicing lines to splice multiple sub-graphs into a complete long image, include: Peak detection is performed on the probability sequence, and local maximum points are determined based on the detection results; The target peak sequence points are determined from the local maximum points using preset filtering conditions, and the sub-graph splicing line is generated based on the target peak sequence points.
7. The long graph reconstruction method based on discrete probability distribution as described in claim 6, characterized in that, The step of performing peak detection on the probability sequence and determining local maximum points based on the detection results includes: A probability threshold is set according to the image parameters of the sub-image, and a probability value greater than or equal to the concept threshold is retained in the probability sequence as the local maximum point; And / or, set the minimum interval between adjacent peaks, and ensure that the probability value of the distance between adjacent target peak sequence points meets the minimum interval requirement is used as the local maximum point; And / or, a non-maximum suppression method is used to select target peak sequence points in the probability sequence as the local maximum points.
8. A long image reconstruction device based on discrete probability distribution, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the long graph reconstruction method based on discrete probability distribution as described in any one of claims 1 to 7.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the long graph restoration method based on discrete probability distribution as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Screenshot method, terminal and computer readable storage medium
CN110764852A
Pavement crack image detection method and system based on image classification and segmentation
CN116485767A