A judgment document identification method, device, equipment and medium
Patent Information
- Application Number
- CN202610862679.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-15
- Publication Date
- 2026-09-04
AI Technical Summary
然而,技术在赋能法律领域的同时,也带来了隐私、安全和公平等方面的问题
[0012]This disclosure provides a method, apparatus, device, and medium for recognizing court judgments. Its advantages lie in elevating the problem from the image level to the semantic understanding level by detecting and marking interference areas formed by seals. Leveraging the powerful reasoning capabilities of a large language model optimized for the legal field, it automatically infers and completes occluded information based on context, solving the problem of inaccurate reasoning results due to a lack of contextual support for occluded information. This not only significantly reduces reliance on complex image processing techniques and improves the feasibility of the solution, but also fundamentally ensures the legal logic and accuracy of the output results, thus providing a high-quality and reliable data foundation for legal artificial intelligence applications. It can extract more comprehensive and accurate key information, improving the information processing capabilities of court judgments. Based on the powerful semantic analysis capabilities of the large language model, in terms of legal provision matching, it can more accurately identify relevant legal provisions based on the facts of the case and the focus of the dispute, avoiding the errors or omissions in provision matching caused by insufficient semantic understanding in traditional technologies. To ensure the security and privacy of sensitive information in court judgments, a security enhancement architecture integrating dynamic anonymization and federated learning is established. This effectively prevents the leakage, alteration, and unauthorized access of personal information, genuinely protects the privacy rights of the parties involved in court judgments, and enhances the security of personal information during the processing of court judgments.
Smart Images

Figure CN122695643A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and more particularly to a method, apparatus, device, and medium for recognizing court judgments. It is specifically designed to address the needs of long text structure parsing, legal logic modeling, and data security in the judicial field. Background Technology
[0002] In the era of big data and artificial intelligence, intelligent legal interpretation, utilizing natural language processing, machine learning, and big data analytics, can significantly improve judicial efficiency and consistency of judgments. However, while technology empowers the legal field, it also brings issues related to privacy, security, and fairness. Specifically, judgments contain high-density legal terminology and complex logical chains, but general big data primarily consists of open corpora, lacking a deep understanding of the specific structure and legal terminology logic of judgments. This easily leads to structural fragmentation, and the resulting corrections often contradict legal common sense, exhibiting professional biases and logical inconsistencies, failing to meet the stringent requirements of the judicial field for data accuracy.
[0004] This patent proposes a judgment document recognition scheme that integrates multimodal parsing and knowledge enhancement architecture. The aim is to solve the problem of long text structure parsing through layout analysis and semantic reorganization; to design a legal knowledge injection mechanism to improve domain adaptability; and to ensure data security by constructing a judicial data sandbox.
[0005] In view of this, there is an urgent need to provide a method for identifying judgment documents that can extract more comprehensive and accurate key information, improve the information processing capabilities of judgment documents, and prevent the leakage, tampering, and unauthorized access of personal information. Summary of the Invention
[0006] To overcome the problems existing in the related technologies, this disclosure provides a method, apparatus, equipment and medium for identifying court documents, so as to solve the technical problems in the related technologies.
[0007] This specification provides one or more embodiments of a method for recognizing court judgments, including the following steps: Official seal location and marking: The circularity of the closed contour of the official seal area in the image of the judgment document is detected by the edge detection method and a mask of the official seal area is generated. The text content around the official seal is determined by text recognition, and the positional relationship between the text content and the mask is determined for hierarchical marking. Missing content identification: The text content is modularized according to the standard structure of the judgment document, and three types of feature vectors, namely semantic content, entity association and structural position, are extracted from each module and fused together; the correlation strength between modules is calculated through a multi-head attention mechanism to construct an initial official seal area; and based on the initial official seal area, multiple modules with the highest correlation with the occluded area are selected as reference information sources, and the missing content is determined by inferring and determining the missing content through an information reasoning model after weighted fusion of context features. Sensitive information protection: Context-based dynamic desensitization strategies, combined with federated learning and blockchain technology, enable differentiated access to sensitive information.
[0008] This specification provides one or more embodiments of a method and apparatus for recognizing court documents, including a seal positioning and marking module. The module is used to detect the circularity of the closed contour of the seal area in the image of the court document through an edge detection method and generate a seal area mask. It also uses text recognition to determine the text content around the seal and to determine the positional relationship between the text content and the mask for hierarchical marking. The missing content determination module is used to modularly segment the text content according to the standard structure of the judgment document, and extract three types of feature vectors for each module: semantic content, entity association, and structural position, and then fuse them. The module calculates the association strength between modules through a multi-head attention mechanism to construct an initial official seal area. Based on the initial official seal area, the module with the highest association with the occluded area is selected as a reference information source, and the missing content is determined by inferring and determining the missing content through an information reasoning model after weighted fusion of contextual features.
[0009] The sensitive information protection module is used for context-based dynamic de-identification strategies, combining federated learning and blockchain technology to achieve differentiated access to sensitive information.
[0010] This specification provides one or more embodiments of a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the judgment document recognition method as described above.
[0011] This specification provides one or more embodiments of a computer-readable storage medium storing a computer program that, when executed by a processor, implements the judgment document recognition method as described above.
[0012] This disclosure provides a method, apparatus, device, and medium for recognizing court judgments. Its advantages lie in elevating the problem from the image level to the semantic understanding level by detecting and marking interference areas formed by seals. Leveraging the powerful reasoning capabilities of a large language model optimized for the legal field, it automatically infers and completes occluded information based on context, solving the problem of inaccurate reasoning results due to a lack of contextual support for occluded information. This not only significantly reduces reliance on complex image processing techniques and improves the feasibility of the solution, but also fundamentally ensures the legal logic and accuracy of the output results, thus providing a high-quality and reliable data foundation for legal artificial intelligence applications. It can extract more comprehensive and accurate key information, improving the information processing capabilities of court judgments. Based on the powerful semantic analysis capabilities of the large language model, in terms of legal provision matching, it can more accurately identify relevant legal provisions based on the facts of the case and the focus of the dispute, avoiding the errors or omissions in provision matching caused by insufficient semantic understanding in traditional technologies. To ensure the security and privacy of sensitive information in court judgments, a security enhancement architecture integrating dynamic anonymization and federated learning is established. This effectively prevents the leakage, alteration, and unauthorized access of personal information, genuinely protects the privacy rights of the parties involved in court judgments, and enhances the security of personal information during the processing of court judgments. Attached Figure Description To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a method for recognizing court documents provided in one or more embodiments of this specification; Figure 2 A schematic flowchart of a method for recognizing court documents provided in one or more embodiments of this specification; Figure 3 Flowchart of the multi-detection and adaptive processing mechanism provided in one or more embodiments of this specification; Figure 4 A flowchart for determining missing content provided in one or more embodiments of this specification; Figure 5 A schematic diagram illustrating the high-quality corpus construction process provided for one or more embodiments of this specification; Figure 6 A flowchart illustrating the sensitive information protection process provided in one or more embodiments of this specification; Figure 7Block diagram of a court document recognition device provided for one or more embodiments of this specification; Figure 8 This is a schematic diagram of the structure of a computer device provided for one or more embodiments of this specification. Detailed Implementation
[0014] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this invention.
[0015] The judgment document recognition method provided by this invention trains a large language model by constructing a legal domain corpus, enabling the model to better understand the semantics and logic of legal texts and effectively process unstructured information in judgment documents. Compared with traditional technologies, it can extract more comprehensive and accurate key information, improving the information processing capabilities of judgment documents. Based on the powerful semantic analysis capabilities of the large language model, in terms of legal provision matching, it can more accurately find relevant legal provisions based on the facts of the case and the focus of the dispute, avoiding the errors or omissions in provision matching caused by insufficient semantic understanding in traditional technologies. At the same time, it effectively prevents the leakage, tampering, and unauthorized access of personal information, effectively protecting the privacy rights of the parties involved in the judgment documents and improving the security of personal information during the processing of judgment documents. The judgment document recognition method of this invention can be applied to judicial business systems, supporting application scenarios such as case analysis, legal research, and intelligent trial assistance. The invention will now be described in detail with reference to specific embodiments and accompanying drawings.
[0016] Method Implementation Examples According to embodiments of the present invention, a method for recognizing court judgments is provided, such as... Figure 1 and Figure 2 As shown, Figure 1 This is a flowchart of the court judgment document recognition method provided in this embodiment. Figure 2 This is a schematic flowchart of the judgment document recognition method provided in this embodiment. According to an embodiment of the present invention, a judgment document recognition method includes the following steps: Step S1, Seal Location and Marking: The circularity of the closed contour of the seal area in the judgment document image is detected by edge detection method and a seal area mask is generated. The text content around the seal is determined by text recognition, and the positional relationship between the text content and the mask is determined for occlusion classification and marking.
[0017] Step S2, Determining Missing Content: Based on the standard structure of the judgment document, the text content is modularly segmented, and three types of feature vectors—semantic content, entity association, and structural position—are extracted from each module and fused. The correlation strength between modules is calculated through a multi-head attention mechanism to construct an initial official seal area. Based on the initial official seal area, the top K modules with the highest correlation with the occluded area are selected as reference information sources. After weighted fusion of contextual features, the missing content is determined by reasoning through an information reasoning model.
[0018] Step S3, Sensitive Information Protection: Employ a context-based dynamic desensitization strategy, combined with federated learning and blockchain technology, to achieve differentiated access and access traceability for sensitive information.
[0019] The judgment document recognition method provided in this embodiment elevates the problem from the image level to the semantic understanding level by detecting and marking interference areas formed by seals. Leveraging the powerful reasoning capabilities of a large language model optimized for the legal field, it automatically infers and completes occluded information based on context, solving the problem of inaccurate reasoning results due to the lack of contextual support for occluded information and inaccurate completion. This not only significantly reduces the reliance on complex image processing techniques and improves the feasibility of the solution, but also fundamentally ensures the legal logic and accuracy of the output results, thus providing a high-quality and reliable data foundation for legal artificial intelligence applications. It can extract more comprehensive and accurate key information, improving the information processing capabilities of judgment documents. Based on the powerful semantic analysis capabilities of the large language model, in terms of legal provision matching, it can more accurately find relevant legal provisions based on the facts of the case and the focus of the dispute, avoiding the errors or omissions in provision matching caused by insufficient semantic understanding in traditional technologies. Meanwhile, to ensure the security and privacy of sensitive information in judgments, a security enhancement architecture integrating dynamic desensitization and federated learning is set up to effectively prevent the leakage, tampering and unauthorized access of personal information, effectively protect the privacy rights of the parties involved in judgments, and improve the security of personal information during the processing of judgments.
[0020] In this embodiment, in the current context of smart courts and judicial big data construction, the digitization of massive amounts of paper judgment documents is a fundamental task. However, in practice, the official judicial seals affixed to scanned documents have become a key obstacle affecting the quality of digitization. The red ink of the seals often directly covers key textual content such as the ruling date, the amount involved, the names of the parties, and the judgment result, causing a significant drop in the accuracy of traditional optical character recognition (OCR) engines. These text recognition errors or omissions caused by the seals directly input into the subsequent natural language processing model, causing "data pollution" to its analysis and learning process.
[0021] The complexity of this problem lies in the interplay between common image quality issues such as uneven lighting and ink bleeding, and the marks left by official seals, making it difficult for general image restoration algorithms to effectively address. These algorithms often prioritize visual naturalness and coherence, failing to guarantee the correctness and rationality of the restored text at the legal semantic level. Existing technological approaches typically reduce this problem to a simple image restoration task, lacking a deep understanding of the specific structure of judicial documents and the logic of legal terminology. Consequently, the restoration results often violate legal common sense and fail to meet the stringent requirements for data accuracy in the judicial field.
[0022] To address the interference caused by official seals on text recognition, this embodiment constructs a multi-detection and adaptive processing mechanism to ensure excellent seal recognition and marking capabilities in both color and black-and-white scanned document scenarios. Therefore, referring to... Figure 3 The diagram shown is a flowchart of the multi-detection and adaptive processing mechanism provided in this embodiment. Before step S1, there is also a multi-detection and adaptive processing mechanism step, which enables the multi-modal detection mechanism to accurately locate the official seal area in the judgment document image. Specifically, it includes the following steps: Step A1: Identify the official seal area in the image of the judgment document. Based on the optical characteristics of the official seal, if it is in color, proceed to step A2; if it is in black, identify the official seal area and proceed to step A3. In grayscale space, the official seal area presents specific geometric shape features, and the official seal part at the end of the document is located first.
[0023] Step A2: Perform RGB, HSV and Lab multi-color space collaborative analysis on the judgment document image, identify the official seal area through the color channel probability formula, and then execute step S1.
[0024] In this embodiment, step A2 addresses the impact of lighting variations and color shifts on the detection of official seals in scanned color seal documents. It employs a multi-color space collaborative analysis strategy to identify the seal region. Therefore, the specific implementation process of step A2 includes the following steps: Step A21: Perform preliminary segmentation of the judgment document image in the RGB color space, and then convert it to the HSV and Lab color spaces for fine processing to obtain the processed official seal area.
[0025] Step A22: Determine the official seal area through color channel probability calculation.
[0026] In this embodiment, taking the typical red feature of an official seal as an example, specifically the red channel, the pixel-level probability calculation formula for identifying the official seal area is as follows, to quantify the probability that each pixel belongs to the official seal area: Taking the red channel as an example, the identification of the official seal area can enhance the difference between the seal color and other colors, which is beneficial for subsequent seal location and restoration process. The calculation formula is as follows:
[0027] in, To prevent extremely small positive numbers with a denominator of zero The target color's main channel pixel value. The sum of the pixel values of the channels involved in the calculation. This is the sensitivity coefficient. The threshold value for the corresponding color; The parameter configurations for different colored official seals are as follows: .
[0028] For example, if the official seal is red, the calculation formula is as follows: .0 Among them, R, G, and B are the red, green, and blue channels in the RGB color space. The numerator greatly amplifies the R value, making it sensitive to the calculation of red values, but the calculation result for non-red pixels will be very small or even negative. It is a sigmoid gate function. T red The threshold can be set to 200, and k can be set to 0.1. These values can be adjusted or obtained through fitting based on experience. When R < T red The output is close to 0, and transitions smoothly near the threshold.
[0029] For the blue official seal, the exact same formula framework is used, except that the main channel is replaced with the B channel, the threshold is adjusted to 180, and other parameters remain unchanged. The blue feature is enhanced by amplifying the B channel value.
[0030] In the final result, based on the pixel probability calculation results of the official seal area obtained by multi-color space collaborative analysis, a probability threshold is set to extract high-confidence official seal candidate areas. The subsequent closed contour circularity detection, Canny edge detection and official seal area mask generation steps are all limited to this candidate area. Only the structural feature determination and extraction operations are performed on the image in this area to avoid unnecessary interference from the background area affecting the recognition results.
[0031] Step A3: Determine the official seal area in the judgment document image, perform closed contour circularity detection to determine the official seal area that meets the conditions, and then execute step S1.
[0032] In this embodiment, step A3 specifically includes the following steps: Step A31: For the black official seal in the black and white scanned document, firstly, candidate regions are preliminarily screened by calculating the probability of the grayscale channels. Then, the closed contour roundness detection is performed on the determined seal region, and the contour roundness is calculated. Contours that meet the roundness threshold condition are selected as candidate regions. The contour roundness calculation formula is as follows: ; The circularity threshold condition is set as follows: =0.7, which can be set according to the specific roundness of the official seal, and the outline that meets the conditions is used as the candidate area.
[0033] The grayscale channel probability calculation adopts the above unified formula framework, the main channel is the grayscale Y channel, the channel sum only contains the Y channel, the threshold is adjusted to 120, and the sensitivity coefficient is adjusted to 0.08.
[0034] Step A32: Perform radial projection transformation on the candidate region, expanding the annular region into a rectangular strip. Perform vertical projection analysis on the rectangular strip to detect the regularity between characters and verify the periodicity of character arrangement (i.e., the official seal text is evenly arranged along the circumference, and the spacing between characters after expansion shows a fixed interval repetition feature). When the vertical projection curve shows a regular peak distribution corresponding to the character arrangement, and the deviation between adjacent peaks does not exceed a preset uniformity threshold, it is determined to meet the conditions and is located as an official seal region. The uniformity threshold is obtained based on statistical analysis of standard official seal samples and can be adjusted or fitted according to experience. That is, the parameters mentioned in the formula above, those that meet the preset thresholds of each parameter are located as official seal regions. The preset thresholds of each parameter are, for example, a roundness threshold of 0.7, a red channel threshold of 200, and a sensitivity coefficient of 0.1.
[0035] Step S1 in this embodiment specifically includes the following steps: generating a mask for the official seal area, determining the text content around the official seal through text recognition, determining the positional relationship between the text and the mask to determine the degree of occlusion, and marking the occlusion level.
[0036] In this embodiment, steps A1-A3 only roughly locate the approximate position of the official seal. If it is necessary to further extract the information obscured by the official seal, more precise boundaries are required. Otherwise, the surrounding text information may be destroyed during the repair process. Contour extraction can provide a precise mask, ensuring that only the area of the official seal is processed, avoiding damage to normal text, and striving to provide high-quality input for the subsequent large model recognition. Therefore, step S1 specifically includes the following steps: Step 11: Based on the Canny edge detection optimization algorithm, the outline of the official seal is separated and obtained. Gaussian smoothing is used to perform convolution operations to suppress image noise and generate an initial localization mask. The formula is as follows: ; in This parameter controls the smoothness level, balancing noise suppression and edge positioning accuracy.
[0037] Step 12: Calculate the magnitude and direction of the image brightness gradient. Compare the gradient intensity of adjacent pixels along the gradient direction, retaining only local maxima to achieve edge refinement and obtain fine edges. .
[0038] Step 13: Blend the initial positioning mask with the fine-edged official seal to generate the final official seal area mask: ; in, Indicates the initial positioning mask. The official seal indicating a fine edge, M final This indicates the final mask for the official seal area.
[0039] Step 14: Determine the text content around the official seal using OCR text recognition method. Based on the final official seal area mask obtained in Step 13, determine the positional relationship between the text content and the mask and perform masking classification marking.
[0040] In one embodiment, the masking of the grading mark includes the following two cases: (1) Mark the text that is completely within the mask; (2) The recognized text that intersects with the mask boundary is marked normally, and the low-confidence recognition results of OCR are retained for later completion by a large model.
[0041] In another embodiment, step A31 further includes the following steps: when the outline roundness is less than the roundness threshold condition, i.e., it does not conform to the regular seal type, the context structure positioning mode is used to indirectly locate the seal area using the fixed layout structure of the judgment document; specifically, through text layout analysis, the characteristic keywords at the end of the document are identified, and the seal area is preferentially delineated in the signature area and date area based on the prior knowledge of the document structure to obtain the initial seal area.
[0042] In this embodiment, reference Figure 4 The diagram shown is a flowchart for determining missing content provided in this embodiment. Step S2 specifically includes the following steps: Step 21, Long text structure processing: A three-level hierarchical processing mechanism is adopted to automatically divide the document into five major modules: introduction, narrative, reasoning, judgment, and conclusion; extract three types of feature vectors for each module: semantic content, entity association, and structural position, and fuse them; calculate the association strength between modules through a multi-head attention mechanism to construct a document dependency graph.
[0043] In one embodiment, step 21 is specifically implemented as follows: Step 211: Automatically segment the judgment document into multiple modules based on a common format. It includes the first module M1 (covering court information, case number, and basic information of the parties), the statement of facts M2 (including the plaintiff's claims, the defendant's defense, and the facts ascertained), the reasoning module M3 (involving the court's findings and legal application analysis), the judgment module M4 (including the main text of the judgment and the allocation of litigation costs), and the last module M5 (including the judges, date, and official seal area).
[0044] For each module, three core feature vectors are extracted: semantic content features, entity association features, and structural location features. This is known as node feature generation, as detailed below: Semantic content features: Encoding the text of each module using a large language model pre-trained on a large-scale legal corpus. Furthermore, semantic representations of modules are obtained through pre-trained models in the legal field.
[0045] Entity association features: Transform each entity set into a vector representation based on frequency or TF-IDF weighting. This feature directly reflects the core legal facts and basis of the module.
[0046] Structural location characteristics: including the start and end positions and type information of the encoding modules. .
[0047] The three features of each module are concatenated and then fused through a fully connected layer to obtain the fused feature: ,in For a learnable parameter matrix, This is a bias term.
[0048] Step 212: Calculate the correlation strength between modules to obtain the edge weight quantization of the official seal area; After obtaining the fusion feature representation of each module, the multi-head attention mechanism is used to compute the fusion feature representation of any two modules. M i and M j The strength of the correlation between R ij The association strength is normalized using Softmax to construct a complete document dependency graph; specifically: The semantic association header is used to calculate the cosine similarity between two modules in the deep semantic space: ; The entity association header is used to calculate the Jaccard similarity coefficient for the sets of legal entities contained in the two modules: ; The structural association header calculates a priori structural association degree based on the module's relative position and type within the document: ; final After applying Softmax normalization to the relationships between all modules, we obtain: ; in, α, β, γ These are learnable weight parameters used to balance the importance of the three association heads. This step constructs the document dependency graph.
[0049] Step 22, semantic completion of occluded text: The top K modules with the highest correlation between the document dependency graph and the occluded region are used as reference information sources, and the contextual features of the K modules are weighted and fused to infer the missing content.
[0050] In one embodiment, for the covered information area Using the constructed document dependency graph G, the most relevant sources of contextual information are located. The edge weight matrix R of the document dependency graph G is given by... Representation module For modules The correlation strength is used to complete the covered information area. The missing information in the data is used to filter out the top K modules with the strongest correlation, which are then used as the reference information source set. , represents one of the first k maximum values in the t-th row of the matrix.
[0051] Based on this set of reference information sources An information reasoning model is constructed, which infers the covered content by fusing multi-source contextual information. The most likely value of .
[0052] Suppose from the reference information source The features extracted that are relevant to the target information are The final reasoning result Determined by a weighted fusion of various reference information: ; in, For an inference function based on information type, For reference information source The weight is determined by the module and the covered information area. After normalizing the correlation strength, the following results are obtained: .
[0053] In the formula, index j is the set of reference information sources. All module indices are used to iterate through the top K reference modules that have the highest correlation with the covered region.
[0054] Step 23: Assess the confidence level of the missing content in the reasoning. If the confidence level is below the threshold, mark it as requiring manual review. Finally, output the structured information.
[0055] In one embodiment, to ensure the accuracy of the information, a confidence assessment needs to be performed, and the confidence function is as follows: ; in, Let be the weighting coefficient, satisfying The first term of the formula measures the overall relevance of the reference information source. The function measures the degree of consistency between the inference result and each reference information source; the third term of the formula considers the degree of coverage, and when there is partial coverage (coverage ratio) ρ cover <1), utilizing the uncovered portion helps improve confidence. When the confidence γ is lower than the preset threshold Tγ, the information is marked as "requires manual review".
[0056] The coverage area is set as the target information area. The set of pixels corresponding to it in the document image is The official seal area mask is Its pixel set is Information area coverage ratio ρ cover The calculation is as follows: ; Where |.| is the cardinality of the set, when =0 indicates that the information was not covered; when =1 indicates complete information coverage; when 0 < <1 indicates that the information is partially covered, and the final output is the structured information after completion as required.
[0057] In this embodiment, by combining modular segmentation of judicial documents and fusion of multi-dimensional features, a structured understanding of long texts is achieved. Then, by constructing a document dependency graph, the context is accurately associated, making the completion results more credible. Finally, the confidence of missing content in the reasoning is automatically evaluated, and low-confidence items are marked for verification to ensure the accuracy of the output.
[0058] In this embodiment, refer to Figure 5 This diagram illustrates the high-quality corpus construction process provided for this implementation. In the information completion step, due to the lack of a dedicated high-quality legal corpus, an advanced legal document corpus is constructed based on the existing terminology database. This corpus is used to train the legal domain pre-trained large language model and information reasoning model in the missing content determination step of this patent, improving the adaptability of the large model to the judicial domain. The specific steps are as follows: Step B1, Multi-source data collection: Collect court judgments, which can be obtained through public websites, authoritative commercial legal databases, and other channels. Automated batch collection of original texts of all types of judgments.
[0059] Step B2, Initial Cleaning and Format Standardization: Automatically remove invalid information from the beginning and end of the document, unify the document encoding format, and convert it into plain text format.
[0060] Step B3, Quality Filtering and Deduplication: Based on indicators such as document length and the completeness of key paragraphs, automatically filter out documents that are too short, have serious structural deficiencies, or are of low quality, and remove highly repetitive documents.
[0061] Step B4, Classification and Storage: The processed high-quality documents are automatically classified according to the processing stage, such as cause of action, trial procedure, court level, etc., and finally stored in a vectorized database or a dedicated corpus management system for use in training and fine-tuning large language models.
[0062] In this embodiment, refer to Figure 6 The diagram shown is a flowchart of the sensitive information protection process provided in this embodiment. Step S3, which implements sensitive information protection, involves the following specific steps: Step 31: Dynamically calculate the file de-identification level based on user role weight, access scenario coefficient, and data sensitivity classification. Use format preservation encryption for sensitive fields to retain the format while protecting privacy.
[0063] In one embodiment, a context-based dynamic desensitization strategy is employed to differentiate sensitive information and automatically adjust the desensitization granularity according to the access scenario: ; Among them, R role For user role weights, C context Access level coefficients, for example, high privileges: 1.0, medium privileges: 0.6, low privileges: 0.2; S sensitivity Data sensitivity can be categorized into different levels, for example, ID number: 1.0, contact information: 0.8, address: 0.6.
[0064] Then, sensitive fields are encrypted using format-preserving encryption (FPE) technology, i.e. .
[0065] Step 32: Using a client-server federated learning model, controllable noise is added before the client uploads the data, and the server only receives the encrypted model gradient updates.
[0066] In one specific embodiment, adding controllable noise before uploading on the client side is as follows: ; Where x represents the gradient of the original model obtained from local training on the client side. Let I represent a multidimensional Gaussian distribution, where I is the identity matrix consistent with the gradient dimension, and the noise variance is... Adjusted dynamically based on the privacy budget.
[0067] The server only receives encrypted model gradient updates, i.e. .
[0068] Where N is the total number of clients participating in federated learning. Let represent the encryption gradient uploaded by the i-th client, and Decrypt(·) be the gradient decryption function on the server side.
[0069] Step 33: Use blockchain to record tamper-proof access logs, calculate access scores based on user roles, historical behavior, risk levels, and other indicators, and trigger secondary authentication if the score exceeds a preset threshold, thereby achieving access control and security traceability.
[0070] In one specific embodiment, the blockchain-recorded immutable access log may include key information such as the previous block hash, user ID, operation type, timestamp, and random number, specifically: ; The access score is calculated based on a combination of user role, historical behavior, risk level, and other indicators, as follows: ; when Two-factor authentication is triggered at that time.
[0071] This embodiment, through the fusion architecture of dynamic de-identification and federated learning, achieves strict privacy protection while ensuring data availability, thus meeting the stringent requirements for data security in the judicial field.
[0072] Device Examples According to embodiments of the present invention, a court judgment document recognition device is provided, such as... Figure 7 The diagram shown is a block diagram of the judgment document recognition device provided in this embodiment. According to an embodiment of the present invention, the judgment document recognition device includes: The official seal positioning and marking module 10 is used to detect the circularity of the closed contour of the official seal area in the judgment document image through edge detection method and generate an official seal area mask. It also uses text recognition to determine the text content around the official seal and to determine the positional relationship between the text content and the mask for hierarchical marking.
[0073] The missing content determination module 20 is used to modularly segment the text content according to the standard structure of the judgment document, and extract and fuse three types of feature vectors for each module: semantic content, entity association, and structural position. It calculates the association strength between modules through a multi-head attention mechanism to construct an initial official seal area. Based on the initial official seal area, it selects the top K modules with the highest association with the occluded area as reference information sources, and after weighted fusion of context features, it infers and determines the missing content through an information reasoning model.
[0074] The sensitive information protection module 30 is used to adopt a context-based dynamic desensitization strategy, combined with federated learning and blockchain technology, to achieve differentiated access and access traceability of sensitive information.
[0075] The judgment document recognition device provided in this embodiment, with its official seal positioning and marking module 10 detecting and marking the interference area formed by the seal, and the missing content determination module 20 elevating the problem from the image level to the semantic understanding level, leverages the powerful reasoning capabilities of a large language model optimized for the legal field to automatically infer and complete occluded information based on context. This solves the problem of inaccurate reasoning results due to the lack of contextual support for occluded information and inaccurate completion. This not only significantly reduces the reliance on complex image processing technologies and improves the feasibility of the solution, but also fundamentally ensures the legal logic rationality and accuracy of the output results, thus providing a high-quality and highly reliable data foundation for legal artificial intelligence applications. It can extract more comprehensive and accurate key information, improving the information processing capabilities of judgment documents. Based on the powerful semantic analysis capabilities of the large language model, in terms of legal provision matching, it can more accurately find relevant legal provisions based on the facts of the case and the focus of the dispute, avoiding the errors or omissions in provision matching caused by insufficient semantic understanding in traditional technologies. Meanwhile, to ensure the security and privacy of sensitive information in judgments, a security enhancement architecture integrating dynamic desensitization and federated learning is set up to effectively prevent the leakage, tampering and unauthorized access of personal information, effectively protect the privacy rights of the parties involved in judgments, and improve the security of personal information during the processing of judgments.
[0076] In this embodiment, an adaptive processing mechanism module is also included, which is used to accurately locate the official seal area in the image of the judgment document through a multimodal detection mechanism. The module includes an image judgment submodule, a first official seal area determination submodule, and a second official seal area determination submodule. The image judgment submodule is used to identify the official seal area in the image of the judgment document. Based on the optical characteristics of the official seal, if it is in color, it is fed back to the first official seal area determination submodule; if it is in black, the official seal area is identified and fed back to the second official seal area determination submodule.
[0077] The first official seal area determination submodule is used to perform collaborative analysis of RGB, HSV and Lab multi-color spaces on the image of the judgment document, identify the official seal area through the color channel probability formula, and feed it back to the official seal positioning and marking module.
[0078] The second official seal area determination submodule is used to determine the official seal area in the image of the judgment document and to perform closed contour circularity detection to determine the official seal area that meets the conditions.
[0079] In this embodiment, the probability calculation formula for color channels is as follows:
[0080] Among them, R, G, and B are the red, green, and blue channels in the RGB color space. The numerator greatly amplifies the R value, making it sensitive to the calculation of red values, but the calculation result for non-red pixels will be very small or even negative. It is a sigmoid gate function. T red The threshold can be set to 200, and k can be set to 0.1. These values can be adjusted or obtained through fitting based on experience. When R < T red The output is close to 0, and transitions smoothly near the threshold.
[0081] The final result is defined by limiting the area of the official seal, so that the subsequent official seal positioning and marking module can determine the structural features of the area and execute the extraction program within the area, thus avoiding unnecessary interference that could affect the recognition result.
[0082] In this embodiment, the second official seal area determination submodule includes an outline roundness calculation unit and an official seal area determination unit; The contour roundness calculation unit is used to detect the roundness of the closed contour of a defined official seal area and calculate the contour roundness, selecting contours that meet the roundness threshold as candidate areas; the contour roundness calculation formula is as follows: ; The circularity threshold condition is set as follows: =0.7, which can be set according to the specific roundness of the official seal, and the outline that meets the conditions is used as the candidate area.
[0083] The official seal area determination unit is used to perform radial projection transformation on candidate areas, expand the annular area into a rectangular strip, perform vertical projection analysis on the rectangular strip, detect the regularity between characters, and verify the periodicity of character arrangement. Areas that meet the conditions are located as official seal areas.
[0084] In another embodiment, the official seal area determination unit is further configured to: when the outline roundness is less than the roundness threshold condition, i.e., when it does not conform to the regular official seal type, use the context structure positioning mode to indirectly locate the official seal area using the fixed format structure of the judgment document. Specifically, by analyzing the text layout, identifying key features at the end of the document, and based on prior knowledge of the document structure, the scope of the official seal is preferentially delineated in the signature area and date area to obtain the initial official seal area.
[0085] The embodiments of the present invention are device embodiments corresponding to the above method embodiments. The specific operations of each module processing step can be understood with reference to the description of the method embodiments, and will not be repeated here.
[0086] like Figure 8As shown, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the judgment document recognition method described in the above embodiments.
[0087] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the judgment document recognition method described in the above embodiments.
[0088] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0089] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for apparatus or system embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The apparatus and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0090] Furthermore, the functional modules in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and the contents not described in detail in the specification of the present invention are well known to those skilled in the art.
Claims
1. A method for recognizing court judgments, characterized in that, Includes the following steps: Official seal location and marking: The circularity of the closed contour of the official seal area in the image of the judgment document is detected by the edge detection method and a mask of the official seal area is generated. The text content around the official seal is determined by text recognition, and the positional relationship between the text content and the mask is determined for hierarchical marking. Missing content identification: The text content is modularized according to the standard structure of the judgment document, and three types of feature vectors, namely semantic content, entity association and structural position, are extracted from each module and fused together; the correlation strength between modules is calculated through a multi-head attention mechanism to construct an initial official seal area; and based on the initial official seal area, multiple modules with the highest correlation with the occluded area are selected as reference information sources, and the missing content is determined by inferring and determining the missing content through an information reasoning model after weighted fusion of context features. Sensitive information protection: Context-based dynamic desensitization strategies, combined with federated learning and blockchain technology, enable differentiated access to sensitive information.
2. The method for recognizing court judgments as described in claim 1, characterized in that, Before the official seal location and marking steps, the following also applies: The system identifies the official seal area in the image of the judgment document. Based on the optical characteristics of the official seal, if the image is in color, it performs a collaborative analysis of RGB, HSV, and Lab multi-color spaces, calculates the color channel probability to determine the official seal area, and then performs the official seal location and marking steps. If the image is in black, it identifies the official seal area in the judgment document image, performs closed contour circularity detection to determine the official seal area that meets the conditions, and then performs the official seal location and marking steps. The color channel probability calculation adopts a unified formula framework: in, To prevent extremely small positive numbers with a denominator of zero The target color's main channel pixel value. The sum of the pixel values of the channels involved in the calculation. This is the sensitivity coefficient. The threshold value for the corresponding color; Parameter configuration for different colored official seals 。 3. The method for recognizing court judgments as described in claim 1, characterized in that, The closed contour circularity detection determines the official seal area that meets the conditions, specifically including the following steps: The circularity of the closed contour of the determined official seal area is detected and the circularity of the contour is calculated. The contours that meet the circularity threshold conditions are selected as candidate areas. The candidate region is subjected to radial projection transformation, which expands the annular region into a rectangular strip. The rectangular strip is then subjected to vertical projection analysis to detect the regularity between characters and verify the periodicity of character arrangement. Regions that meet the conditions are located as official seal regions.
4. The method for recognizing court judgments as described in any one of claims 1-3, characterized in that, The specific steps for locating and marking the official seal include: The outline of the official seal is obtained by an optimized algorithm based on Canny edge detection. Image noise is suppressed by performing convolution operation through Gaussian smoothing, and an initial positioning mask is generated. Calculate the magnitude and direction of the image brightness gradient, compare the gradient intensity of adjacent pixels along the gradient direction, and retain only local maxima to achieve edge refinement and obtain fine edge texture. The initial positioning mask and the fine edge of the official seal are merged using a fusion strategy to generate the final official seal area mask; The text content surrounding the official seal is determined using text recognition methods. Based on the final mask of the official seal area, the positional relationship between the text content and the mask is determined and the masking is graded and marked.
5. The method for recognizing court judgments as described in claim 3, characterized in that, It also includes the following steps: When the roundness of the outline is less than the roundness threshold, i.e., it does not conform to the regular seal type, the context structure positioning mode is used to indirectly locate the seal area by utilizing the fixed format structure of the judgment document.
6. The method for recognizing court judgments as described in claim 1, characterized in that, The steps for determining the missing content specifically include the following steps: A three-level hierarchical processing mechanism is adopted to automatically segment documents into five major modules: preface, narrative, reasoning, judgment, and conclusion; three types of feature vectors, namely semantic content, entity association, and structural position, are extracted from each module and fused together; and the inter-module association strength is calculated through a multi-head attention mechanism to construct a document dependency graph. Semantic completion of occluded text: The K modules with the highest correlation between the document dependency graph and the occluded region are used as reference information sources, and the contextual features of the K modules are weighted and fused to infer the missing content; The system assesses the confidence level of any missing information in the reasoning. If the confidence level is below a threshold, the information is marked and manually reviewed. Finally, the system outputs structured information.
7. The method for recognizing court judgments as described in claim 1, characterized in that, The sensitive information protection steps specifically include the following steps: The file desensitization level is dynamically calculated based on user role weight, access scenario coefficient, and data sensitivity classification. Sensitive fields are encrypted while preserving the format, thus protecting privacy. A client-server federated learning model is adopted, in which controllable noise is added before the client uploads the data, and the server only receives the encrypted model gradient updates. Blockchain is used to record tamper-proof access logs, and comprehensive evaluation indicators are used to calculate access scores. If the score exceeds a preset threshold, secondary authentication is triggered to achieve access control and security traceability.
8. A method and apparatus for recognizing court judgments, characterized in that, include: The official seal positioning and marking module is used to detect the circularity of the closed contour of the official seal area in the image of the judgment document through edge detection method and generate an official seal area mask. It also uses text recognition to determine the text content around the official seal and to determine the positional relationship between the text content and the mask for hierarchical marking. The missing content determination module is used to modularize the text content according to the standard structure of the judgment document, and extract three types of feature vectors for each module: semantic content, entity association, and structural position, and then fuse them; calculate the association strength between modules through a multi-head attention mechanism to construct an initial official seal area; and select the modules with the highest association with the occluded area as reference information sources based on the initial official seal area, and then use the information reasoning model to infer and determine the missing content after weighted fusion of context features. The sensitive information protection module is used for context-based dynamic de-identification strategies, combining federated learning and blockchain technology to achieve differentiated access to sensitive information.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the judgment document recognition method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the judgment document recognition method as described in any one of claims 1 to 7.