Stulejka
Zapobieganie i profilaktyka

Przedstawiony system automatycznego wykrywania, prostowania perspektywy oraz ekstrakcji tekstu z dokumentów na urządzeniach mobilnych i komputerach opiera się na nowatorskim podejściu łączącym lekkie sieci neuronowe z klasycznymi metodami przetwarzania obrazu. Kluczowym elementem jest lokalne wykrywanie bloków tekstu za pomocą sieci generującej mapę prawdopodobieństwa obecności tekstu, a następnie precyzyjne wyznaczanie granic tekstu w tych regionach poprzez adaptacyjne progowanie lokalne. Algorytm ustala kolejność czytania bloków tekstu na podstawie ich wzajemnego położenia i nakładania się, co pozwala na prawidłowe odtworzenie naturalnego porządku lektury nawet w złożonych układach dokumentów. Połączenie sąsiednich bloków tekstu, które spełniają kryteria bliskości i wyrównania, umożliwia efektywniejsze i dokładniejsze rozpoznawanie znaków przez OCR, wykorzystujący komponent Google ML Kit. System osiąga redukcję wskaźników błędów znaków (CER) i słów (WER) o około 9-10% w porównaniu do bezpośredniego stosowania OCR bez wstępnej segmentacji i analizy kolejności czytania.

Profilaktyka stulejki (phimosis)

Stulejka (phimosis) to stan, w którym napletek jest zbyt ciasny, aby można go było odciągnąć znad żołędzi prącia. Profilaktyka tego schorzenia obejmuje różne aspekty opieki nad prąciem, które mogą pomóc uniknąć lub zmniejszyć ryzyko wystąpienia stulejki patologicznej (nabytej) i związanych z nią powikłań. Warto podkreślić, że fizjologiczna stulejka występująca u niemowląt i małych chłopców to zjawisko normalne i najczęściej ustępuje samoistnie z wiekiem.12

Profilaktyka u niemowląt i małych dzieci

W przypadku niemowląt i małych dzieci profilaktyka stulejki opiera się na kilku kluczowych zasadach:12

  • Unikanie siłowego odciągania napletka – nie należy na siłę odciągać napletka niemowlęcia lub małego chłopca, ponieważ może to być bolesne i prowadzić do uszkodzenia tkanki, powodując blizny i problemy w późniejszym życiu
  • Odpowiednia higiena – u niemowląt nie jest wymagana specjalna pielęgnacja napletka, wystarczy rutynowe mycie podczas zmiany pieluszki lub kąpieli
  • Delikatne oczyszczanie – w pierwszych latach życia delikatne odciąganie napletka podczas mycia jest wystarczające i prowadzi do stopniowego rozluźniania się napletka z czasem

123

Ważne jest, aby rodzice nie próbowali na siłę odciągać napletka w celu jego rozluźnienia lub umycia prącia. Może to być bardzo bolesne dla dziecka i prowadzić do urazów. U większości chłopców napletek naturalne oddziela się i staje się bardziej elastyczny w ciągu pierwszych kilku lat życia.12

Profilaktyka u dzieci starszych i młodzieży

U starszych dzieci i nastolatków profilaktyka stulejki wymaga bardziej aktywnego podejścia:12

  • Edukacja w zakresie higieny – chłopcy w wieku około 6-7 lat powinni być uczeni, jak delikatnie odciągać napletek podczas kąpieli lub pod prysznicem w celu zachowania higieny
  • Regularne mycie – regularne, delikatne mycie prącia i pod napletkiem ciepłą wodą pomaga zapobiegać infekcjom i utrzymywać elastyczność napletka
  • Unikanie podrażnień – należy unikać stosowania mydła perfumowanego, dezodorantów i talku na prąciu, ponieważ mogą one powodować podrażnienia i stany zapalne

12

Jeśli u dziecka powyżej 6-7 roku życia napletek nadal nie może być odciągnięty, nawet jeśli nie występują objawy, warto skonsultować się z lekarzem w celu oceny sytuacji i ewentualnego wdrożenia leczenia.1

Profilaktyka u dorosłych

Dla nastolatków i dorosłych mężczyzn, profilaktyka stulejki obejmuje następujące działania:12

  • Całkowite odciąganie napletka – przy każdym oddawaniu moczu należy całkowicie odciągać napletek
  • Regularne mycie – odciąganie napletka i mycie pod nim przy każdej kąpieli lub prysznicu
  • Prawidłowe zakładanie napletka – po oddaniu moczu lub umyciu należy zawsze zaciągnąć napletek z powrotem nad żołądź prącia
  • Bezpieczne zachowania seksualne – stosowanie prezerwatyw podczas stosunków płciowych może zapobiec infekcjom przenoszonym drogą płciową, które mogą przyczynić się do rozwoju stulejki

12

Ważnym elementem profilaktyki jest również szybkie leczenie wszelkich infekcji, które mogą wpływać na prącie lub napletek. Odpowiednie leczenie może zmniejszyć ryzyko bliznowacenia, co może zapobiec rozwojowi stulejki w przyszłości.12

Kiedy zgłosić się do lekarza

Wizyta u lekarza jest wskazana w następujących sytuacjach:12

  • Jeśli nie można całkowicie odciągnąć napletka, zwłaszcza gdy staje się on czerwony lub bolesny
  • W przypadku balonowania napletka podczas oddawania moczu
  • Gdy występują trudności z oddawaniem moczu lub ból podczas mikcji
  • Jeśli pojawiają się nawracające infekcje prącia lub napletka
  • Gdy napletek został odciągnięty i nie można go przesunąć z powrotem nad żołądź (stan wymagający natychmiastowej pomocy medycznej – paraphimosis)

12

Jeśli proste środki konserwatywne nie poprawiają elastyczności napletka, lekarz pierwszego kontaktu zwykle zaleca skierowanie do urologa w celu dalszej porady.1

Metody leczenia i ich rola w profilaktyce

Leczenie zachowawcze

W przypadku stulejki, która nie ustępuje samoistnie lub powoduje problemy, dostępne są różne metody leczenia, które mogą również pełnić rolę profilaktyczną:12

  • Steroidy miejscowekremy steroidowe, takie jak betametazon, mometazon furoat i kortyzon, są skuteczne w leczeniu stulejki i powinny być rozważone przed obrzezaniem. Steroidy te pomagają zmiękcz%!TEX root = ../paper.tex

    section{System Overview}
    label{sec:overview}

    Our algorithm ingests a camera-facing document, extracts text blocks, and sorts them
    in reading order. Text blocks near each other get coalesced, and OCR is only executed on these blocks rather than the full document image. This is the traditional text extraction pipeline with our method making significant changes to the region extraction, sorting and coalescing stages.

    begin{figure*}[ht!]
    begin{center}
    includegraphics[width=0.9textwidth]{figures/overview-2.pdf}
    caption{The overall flow diagram of our proposed system. We start with a novel, localized text detection method to find and segment text blocks from input images. Then we determine reading order of these blocks, combine blocks near each other, and extract text from them using a standard OCR system.} label{fig:overview}
    end{center}
    end{figure*}

    subsection{Text Detection}
    label{sec:text_det}
    The first step of the pipeline is to detect individual text blocks from the input document image. Traditional methods~cite{googleDriveScanner, googleLens, office-lens} typically either employ a full text segmentation algorithm that identifies all text pixels or leverage a standard object detector to generate bounding boxes around text in a document~cite{CTPN,PixelLink,TextBoxes,TextBoxes++, DB-CVPR}. However, there are two key challenges with these methods: 1) Text segmentation can be expensive, especially on mobile devices, and 2) Text blocks in a document can be dense and non-rectangular, leading to non-optimal bounding box generations at times. In this work, we propose a local region-based approach for text detection. The intuition behind our design is as follows: Given an input image, rather than trying to detect the precise boundaries of all text blocks at once, we can detect areas of the image that are likely to contain text and then find more precise text boundaries within these regions. This approach is more efficient and adaptable to the structure of document text.

    Our method works as follows: First, we generate a „likelihood map” through a lightweight neural network $f_{text{text}}$. This likelihood map is a downsampled version of the input image where each pixel represents the probability of text being present in the corresponding area of the original image. Figure~ref{fig:text_detector} illustrates this step. Let $I$ be the input image. We define the likelihood map as $L = f_{text{text}}(I)$ where $L in [0, 1]^{H times W}$, $H < text{height}(I)$ and $W < text{width}(I)$.

    Given the likelihood map, we first identify individual 8-connected components, then get the corresponding areas in the original image, and try to find more precise text boundaries within each foreground component by a novel local thresholding approach.

    begin{figure}[th!]
    centering
    includegraphics[width=columnwidth]{figures/text_detector.pdf}
    caption{An overview of our text detection method. We first generate a downsampled likelihood map, use a threshold to detect high-probability regions and then conduct more precise local segmentation.}label{fig:text_detector}
    end{figure}

    Let $P={p_i}$ be the set of foreground components (likely text regions)
    where $p_i$ is a set of pixels in the likelihood map.
    For each component $p_i$, we compute the corresponding area in the original
    image, which we denote as $R_i$.
    Then, we apply a local thresholding method to $R_i$ to find more precise text boundaries.

    Traditional global thresholding methods~cite{sauvola2000adaptive, niblack1985globalthresholding} may work well for documents with uniform illumination, but they often fail in real-world scenarios where lighting conditions can vary across the document. On the other hand, local thresholding methods~cite{AdaptiveThresholding} need to process each pixel individually, which is impractical for large images.

    We combine the benefits of both by using our text detection network to first identify regions that are likely to contain text (significantly reducing the search space) and then employing a localized thresholding approach within these regions. Let $T_i = g_{text{threshold}}(R_i)$ be the thresholding function applied to region $R_i$, resulting in a binary mask $T_i$ that represents the refined text boundaries within $R_i$. This approach ensures that text boundaries are detected with high accuracy regardless of lighting variations. We use a brightness channel adaptive threshold-based binarization.

    The result of this local text detection process is a set of binary masks ${T_i}$, each representing a separate text block. Connected components within the thresholded area are merged if they are close to each other, which helps maintain the integrity of text lines or phrases. Let $B = {b_i}$ be the set of final bounding boxes, where each $b_i$ is the minimal bounding box enclosing the corresponding connected components in $T_i$. So, instead of using traditional text segmentation or simple bounding box generation, our approach leverages a hierarchy of detection methods: first identifying potential text regions and then refining them with local thresholding, which is efficient and well-suited for mobile document scanning.

    subsection{Reading Order Determination}
    label{sec:reading_order}
    After detecting the text blocks, the next critical step is to arrange them in an order that follows the natural reading flow of the document. This is not always a trivial left-to-right, top-to-bottom ordering, as document layouts can be complex with columns, sections, etc. We’ve developed an algorithm that considers both the spatial arrangement of blocks and potential logical connections between them. Figure~ref{fig:reading_order} visualizes a hypothetical document layout and the order our algorithm establishes.
    begin{figure}[th!]
    centering
    includegraphics[width=columnwidth]{figures/read_order_edited.pdf}
    caption{Our reading order algorithm determines the sequence for processing text blocks based on spatial layout and logical flow. The numbers indicate the reading order established for this example. Notice how our algorithm navigates through complex layouts with multiple columns and nested structures.}label{fig:reading_order}
    end{figure}

    Our reading order algorithm works as follows: Let $B = {b_i}$ be the set of all detected text blocks. For each pair of blocks $b_i$ and $b_j$, we compute a directional relation score $r(b_i, b_j)$ that indicates whether $b_i$ should be read before $b_j$. This score is based on the relative positions of the blocks, calculated using the top-left and bottom-right corners.

    Specifically, let the coordinates of a box $b_i$ be defined by its top-left $(x_i^1, y_i^1)$ and bottom-right $(x_i^2, y_i^2)$ corners. We compute horizontal and vertical overlap scores, denoted as $h_{ij}$ and $v_{ij}$, respectively:

    begin{align}
    h_{ij} &= frac{min(x_i^2, x_j^2) – max(x_i^1, x_j^1)}{max(x_i^2 – x_i^1, x_j^2 – x_j^1)}
    v_{ij} &= frac{min(y_i^2, y_j^2) – max(y_i^1, y_j^1)}{max(y_i^2 – y_i^1, y_j^2 – y_j^1)}
    end{align}

    The intuition behind these overlap scores is that in multi-column layouts, text blocks often exhibit horizontal or vertical alignment. The scores quantify this alignment, which is crucial for determining the correct reading order. These scores are only valid when there is an actual overlap; otherwise, they are set to 0. Our goal is to establish if block $b_i$ should be read before block $b_j$. For this purpose, we define a directional score based on the positions and overlaps of blocks. First, we calculate a raw positional score for a block $b_i$ to be read before $b_j$:

    begin{equation}
    s_{ij} =
    begin{cases}
    1 & text{if } y_i^2 < y_j^1
    0.75 & text{if } y_i^1 < y_j^1 text{ and } v_{ij} 0 text{ and } x_i^2 0 text{ and } y_i^1 < y_j^1
    end{cases}
    end{equation}

    This formula prioritizes reading from top to bottom (when one block is entirely above another), followed by partially overlapping blocks from top to bottom, then left to right for blocks at a similar vertical position, and finally by the top-to-bottom ordering for horizontally overlapping blocks.

    To refine this score further and ensure that it takes into account both the distances and overlaps between blocks, we apply additional calculations. For each block $b_i$, we first sort all other blocks by their positional score $s_{ij}$ in descending order. This sorted list, combined with the overlap scores, allows us to determine a clear reading path through the document. Our approach allows us to handle complex layouts including those with multiple columns, nested sections, and varying block sizes, which is crucial for accurate extraction of document content in the correct reading order.

    subsection{Block Combination & Text Extraction}
    label{sec:block_comb}
    After the text blocks are arranged in the proper reading order, the final step is to combine adjacent blocks that form a coherent unit and to extract the text from these combined blocks. The motivation for block combination is two-fold: 1) to improve the efficiency of the OCR process by reducing the number of individual operations, and 2) to maintain the natural flow of text by combining blocks that belong together, which leads to better OCR results.

    Our block combination algorithm utilizes the previously computed reading order and the spatial relationships between blocks. For consecutive blocks in the reading order, we evaluate whether they can be combined based on their proximity and alignment. Let $b_i$ and $b_{i+1}$ be two consecutive blocks in the reading order. We determine if they should be combined based on the following criteria:

    begin{itemize}
    item Proximity: The distance between the blocks is below a threshold.
    item Alignment: The blocks are horizontally or vertically aligned.
    item Content continuity: If the blocks are likely to be part of the same paragraph.
    end{itemize}

    Once we’ve identified blocks to combine, we merge their bounding boxes to form a unified region. Let $B_{text{combined}} = {B_k}$ be the set of combined blocks, where each $B_k$ represents a merged region containing one or more of the original blocks. The final step is to extract text from each of these combined blocks, which is where standard OCR techniques are employed. We use the on-device optical character recognition component of Google ML Kit~cite{ml-kit-ocr}. Applying OCR to $B_{text{combined}}$ is more efficient than processing each original block individually since our system minimizes the number of blocks sent to the OCR, with each invocation providing a higher-quality context. By processing combined blocks, the OCR system has more context available for character recognition (e.g., complete words, phrases, sentences), which leads to higher accuracy, especially for languages that rely heavily on context for accurate recognition. Finally, the extracted text from all combined blocks is concatenated in the determined reading order to form the complete document text. This concatenated text respects the original document structure, resulting in a faithful digital representation of the physical document.

    section{Conclusion and Future Work}
    label{sec:conclusion}
    In this work, we presented an end-to-end automatic document detection, rectification, and text extraction system for mobile phones and computers. The method includes a novel segmentation algorithm for detection and processing of visually homogeneous regions, an improved text extraction module, and a fully differentiable neural network model for document detection and rectification.

    The proposed system alleviates some of the most common pain points when scanning documents. With the help of differentiable image processing, we constructed and optimized the entire pipeline to deliver performance improvement on a wide variety of documents, under significantly different camera views.

    There are several potential directions for future work. One promising avenue is the incorporation of advanced language models or specialized optical character recognition for handling complex layouts, particularly those with mathematical expressions and domain-specific terminology. Furthermore, enhancing the robustness of the system against extreme lighting conditions and document deformities could increase its applicability in even broader contexts.

    section{Appendix}
    subsection{Quantitative Analysis for Text Extraction}
    label{sec:text_eval}
    We trained and benchmarked our text extractor using the DocVQA~cite{DocVQA} and PubLayNet~cite{Publaynet} datasets. $90%$ of the data was used for training and $10%$ for validation.
    For evaluation, we used two standard metrics: Character Error Rate (CER) and Word Error Rate (WER).

    begin{align}
    text{CER} &= frac{text{edit_distance(ground_truth, prediction)}}{||text{ground_truth}||}
    text{WER} &= frac{text{edit_distance_by_word(ground_truth, prediction)}}{||text{ground_truth}||_{text{words}}}
    end{align}

    begin{figure}[h]
    begin{center}
    includegraphics[width=0.90linewidth]{figures/accuracy_chart.pdf}
    end{center}
    caption{Character and word error rates on our validation sets. Mobile OCR denotes Google ML Kit’s on-device text recognition. Text Extract denotes our method combining ML Kit with our proposed text detection and reading ordering.}
    label{fig:accuracy}
    end{figure}

    Figure~ref{fig:accuracy} shows the performance of our system compared to a baseline that directly applies Google ML Kit ~cite{ml-kit-ocr} on-device text recognition without our text detection and reading ordering modules. Our approach achieves 9-10% lower character and word error rates. Key reasons for this improvement include more accurate text block detection leading to better character segmentation, proper reading order determination, and block recombination providing better context for the OCR system. Figure~ref{fig:extraction_comparison} shows a qualitative comparison of text extraction using our method vs. the baseline.

    Our system’s performance was also evaluated on a sample of real-world documents as shown in Figure~ref{fig:extraction_comparison}. The system can handle documents with complex layouts with greater accuracy than applying OCR directly.

    begin{figure}
    centering
    includegraphics[width=columnwidth]{figures/extraction_comparison.pdf}
    caption{Qualitative comparison of text extraction results. Our method (right) maintains proper reading order and structural integrity compared to direct OCR (left).}
    label{fig:extraction_comparison}
    end{figure}

    subsection{Text Detection Details}
    label{sec:text_detection_details}
    Our text detection network is specifically designed to be efficient on mobile devices. The architecture consists of five core convolution blocks, each containing two convolution layers with batch normalization, followed by a max pooling layer. The last block is followed by a $1 times 1$ convolution layer with sigmoid activation to produce the likelihood map. The network has approximately 500K parameters, making it lightweight for mobile deployment.

    The training objective for our text detection network is a binary cross-entropy loss between the predicted likelihood map and the ground truth segmentation map. The ground truth map is generated by labeling pixels corresponding to text regions as 1 and background regions as 0. To handle balance class imbalance (as most of the document is non-text), we apply a weighted loss where positive examples (text) are weighted more heavily than negative examples (non-text).

    begin{equation}
    L = -frac{1}{N} sum_i [ alpha y_i log(hat{y}_i) + (1-y_i) log(1-hat{y}_i) ]
    end{equation}

    where $y_i$ is the ground truth label, $hat{y}_i$ is the predicted probability, $N$ is the number of pixels, and $alpha$ is the weight factor for positive examples.

    For the local thresholding step, we employ an adaptive approach based on the characteristic of high contrast between text and background. For each detected region $R_i$, we compute a local threshold value that adapts to the intensity distribution within that region. Specifically, we use a modified version of Sauvola’s method~cite{sauvola2000adaptive}:

    begin{equation}
    T(x, y) = m(x, y) left[ 1 + k left( frac{s(x, y)}{R} – 1 right) right]
    end{equation}

    where $m(x, y)$ is the local mean, $s(x, y)$ is the standard deviation in a local window centered on pixel $(x, y)$, $R$ is a normalization factor, and $k$ is a parameter that controls the behavior of the thresholding (we empirically set this to 0.2).

    section{Experiments}
    label{sec:experiments}

    We evaluate our method both on standard datasets and on real-world manually annotated documents, using standard metrics for document analysis systems. The following sections present the details of our experimental setup, validation metrics, and comparative analysis with existing solutions.

    subsection{Datasets}
    For our experiments, we use several publicly available datasets specifically designed for document analysis, as well as a curated set of real-world documents:

    1. textbf{DocVQA Dataset}~cite{DocVQA}: The Document Visual Question Answering dataset contains over 12K images of document pages from various sources with diverse layouts. We focused on images exhibiting perspective distortion for our detection experiments. Moreover, the dataset contains high-quality OCR annotations, which we use to assess our text extraction methods.

    2. textbf{PubLayNet Dataset}~cite{Publaynet}: This dataset consists of over 360,000 document images of scholarly papers from PubMed Central, with annotations for layout analysis. We used a subset of these images for training and evaluating our document detection and perspective rectification models.

    3. textbf{ICDAR 2019 Post-OCR Correction}~cite{ICDAR}: This dataset contains ground-truth aligned with OCR outputs, providing a good benchmark for OCR correction systems. We used this to evaluate the effectiveness of our text extraction pipeline compared to traditional OCR methods.

    4. textbf{Real-world Document Collection}: We manually collected and annotated a set of 200 real-world documents captured under varying lighting conditions and perspectives. These documents include receipts, forms, and typed pages of various languages. We employed this dataset primarily for qualitative assessment and to verify our system’s performance in practical scenarios.

    subsection{Document Detection Evaluation}
    We evaluate the performance of our document detection component using standard object detection metrics. Specifically, we compare our approach against strong baseline models including YOLOv5~cite{YOLOv5}, EfficientDet~cite{EfficientDet}, and the recursive crop method used in Google Drive Scanner~cite{googleDriveScanner}.

    begin{table}[t]
    centering
    caption{Document detection performance comparison. Higher IoU (Intersection over Union) indicates better detection accuracy, while lower process time indicates better efficiency. Best results are highlighted in bold.}
    label{tab:document_detection}
    begin{tabular}{lcc}
    toprule
    Method & multicolumn{1}{l}{IoU ($uparrow$)} & Process Time (ms) ($downarrow$)
    midrule
    YOLOv5~cite{YOLOv5} & 0.87 & 35
    EfficientDet~cite{EfficientDet} & 0.85 & 55
    Recursive Crop~cite{googleDriveScanner} & 0.88 & 110
    Ours & textbf{0.92} & textbf{28}
    bottomrule
    end{tabular}
    end{table}

    The results in Table~ref{tab:document_detection} show that our edge-based detection method outperforms the comparison methods in terms of both accuracy (IoU) and processing time. Our approach achieves a 4% improvement in IoU compared to the next best method while being 20% faster than the fastest baseline. This improvement is particularly significant for mobile applications where processing efficiency is crucial, and detection accuracy directly impacts the quality of the captured document image.

    begin{figure}[t]
    centering
    includegraphics[width=columnwidth]{figures/detection_comparison.pdf}
    caption{Qualitative comparison of document detection algorithms on challenging cases. Our approach (right column) delivers better boundary detection with fewer spurious edges compared to Recursive Crop~cite{googleDriveScanner} (left column).}
    label{fig:detection_comparison}
    end{figure}

    The qualitative comparison in Figure~ref{fig:detection_comparison} further illustrates the robustness of our detection method. In challenging cases with complex backgrounds or irregular document shapes, our approach delivers cleaner and more accurate boundary delineation compared to the recursive crop method~cite{googleDriveScanner}.

    subsection{Perspective Rectification Evaluation}
    For evaluating the perspective rectification performance, we utilize the standard reprojection error metric, which measures the average Euclidean distance between the ground truth corner points and the points estimated by our model after rectification. We compare our approach against three baseline methods: the Hough transform approach commonly used in traditional document scanners, the neural warp field method~cite{jaderberg2015spatial}, and DewarpNet~cite{ma2018docunet}.

    begin{table}[h]
    centering
    caption{Perspective rectification performance comparison. Lower reprojection error indicates better rectification quality. Best results are highlighted in bold.}
    label{tab:rectification}
    begin{tabular}{lc}
    toprule
    Method & Reprojection Error (px) ($downarrow$)
    midrule
    Hough Transform & 15.6
    Neural Warp Field~cite{jaderberg2015spatial} & 10.2
    DewarpNet~cite{ma2018docunet} & 8.7
    Ours & textbf{5.3}
    bottomrule
    end{tabular}
    end{table}

    The results in Table~ref{tab:rectification} demonstrate that our differentiable homography estimation method achieves significantly better reprojection accuracy compared to the baselines. Our approach reduces the error by 39% compared to the next best method, DewarpNet~cite{ma2018docunet}. This improvement is crucial for maintaining the document’s visual integrity after rectification, especially for OCR processing.

    begin{figure}[h]
    centering
    includegraphics[width=columnwidth]{figures/rectification_comparison.pdf}
    caption{Qualitative comparison of perspective rectification. Our differentiable homography method (right column) produces more accurate rectification with less distortion compared to Hough Transform (left column) and Neural Warp Field~cite{jaderberg2015spatial} (middle column).}
    label{fig:rectification_comparison}
    end{figure}

    The qualitative comparison in Figure~ref{fig:rectification_comparison} shows that our rectification method preserves the document’s layout and content with minimal distortion. Traditional methods like Hough Transform tend to introduce artifacts at the boundaries, while learning-based methods like Neural Warp Field can struggle with severe perspective distortions.

    subsection{Overall System Performance}
    To evaluate the performance of our complete system, we conduct end-to-end tests measuring the quality of the final extracted document in terms of both visual quality and text recognition accuracy. We compare our system with three commercial document scanning applications: Google Drive Scanner~cite{googleDriveScanner}, Microsoft Office Lens~cite{office-lens}, and Adobe Scan~cite{adobe-scan}.

    begin{table}[h]
    centering
    caption{End-to-end system performance comparison on manually annotated real-world documents. Higher SSIM indicates better visual quality, lower CER indicates better text recognition. Best results are highlighted in bold.}
    label{tab:system_performance}
    begin{tabular}{lcc}
    toprule
    System & multicolumn{1}{l}{SSIM ($uparrow$)} & CER (%) ($downarrow$)
    midrule
    Google Drive Scanner~cite{googleDriveScanner} & 0.87 & 5.2
    Microsoft Office Lens~cite{office-lens} & 0.85 & 6.1
    Adobe Scan~cite{adobe-scan} & 0.89 & 4.7
    Ours & textbf{0.92} & textbf{3.5}
    bottomrule
    end{tabular}
    end{table}

    The results in Table~ref{tab:system_performance} confirm that our end-to-end system outperforms commercial alternatives in both visual quality (measured by Structural Similarity Index, SSIM) and text recognition accuracy (measured by Character Error Rate, CER). Our system achieves a 3.4% improvement in SSIM and a 25.5% reduction in CER compared to the next best commercial solution (Adobe Scan).

    begin{figure}[ht!]
    centering
    includegraphics[width=columnwidth]{figures/end_to_end_comparison.pdf}
    caption{End-to-end qualitative comparison on real-world documents. Our system (right column) provides better document detection, rectification, and overall quality compared to Google Drive Scanner~cite{googleDriveScanner} (left column) and Adobe Scan~cite{adobe-scan} (middle column).}
    label{fig:end_to_end}
    end{figure}

    The qualitative comparison in Figure~ref{fig:end_to_end} showcases the superiority of our system in handling challenging real-world scenarios. Our system consistently produces better-quality document captures with fewer artifacts, more accurate perspective correction, and improved readability, which directly translates to better OCR performance.

    subsection{Computational Efficiency Analysis}
    Given the importance of computational efficiency for mobile deployment, we conduct an analysis of our system’s runtime performance on different devices, comparing it with Google Drive Scanner as a baseline.

    begin{table}[h]
    centering
    caption{Computational efficiency comparison. All times are in milliseconds. Lower is better.}
    label{tab:computational_efficiency}
    begin{tabular}{lcccc}
    toprule
    multirow{2}{*}{System} & multicolumn{2}{c}{Mid-range mobile} & multicolumn{2}{c}{High-end mobile}
    & CPU & GPU & CPU & GPU
    midrule
    Google Drive Scanner~cite{googleDriveScanner} & 350 & 220 & 210 & 130
    Ours & textbf{280} & textbf{170} & textbf{175} & textbf{95}
    bottomrule
    end{tabular}
    end{table}

    Table~ref{tab:computational_efficiency} shows that our system is significantly more efficient than Google Drive Scanner on both CPU and GPU across different device tiers. This efficiency gain stems from our lightweight detection approach and optimized rectification model. For high-end mobile devices using GPU acceleration, our system processes a document in under 100 milliseconds, making it suitable for real-time camera viewfinder applications.

    subsection{Real-world Validation}
    To validate our system’s performance in real-world settings, we conducted a small user study with 20 participants who were asked to scan 5 different types of documents (receipts, typed pages, forms, handwritten notes, and magazine pages) using both our system and Google Drive Scanner.

    begin{table}[h]
    centering
    caption{User study results comparing our system with Google Drive Scanner~cite{googleDriveScanner} on a 5-point scale (5 being best).}
    label{tab:user_study}
    begin{tabular}{lcc}
    toprule
    Metric & Google Drive Scanner & Ours
    midrule
    Ease of use & 4.1 & 4.3
    Quality of results & 3.8 & 4.5
    Processing speed & 3.9 & 4.4
    Overall satisfaction & 3.7 & 4.6
    bottomrule
    end{tabular}
    end{table}

    The user study results in Table~ref{tab:user_study} indicate a clear preference for our system across all evaluation metrics. Particularly notable is the substantial improvement in perceived quality of results and overall user satisfaction, which suggests that the technical improvements measured in our benchmarks translate to tangible benefits in real-world usage scenarios.

    section{Introduction}
    label{sec:intro}

    With the ubiquity of high-quality cameras on mobile phones, there’s been a significant shift in how people digitize documents. Instead of using traditional desktop scanners, many now simply take a picture of a document with their phone. However, unlike flatbed scanners, these images often contain perspective distortion, uneven lighting, and other artifacts that affect readability.

    This paper introduces an end-to-end automatic document detection, rectification, and text extraction system specifically designed for mobile phones and computers. It includes a novel text segmentation algorithm, an improved text extraction pipeline, and an efficient neural network model for document detection and rectification. The system handles a wide variety of documents, from receipts and forms to text-heavy articles, under different camera views and lighting conditions.

    The key to our approach is treating document processing as a complete pipeline where each component—detection, rectification, and text extraction—is designed to work together. This contrasts with existing solutions that often treat these steps as separate problems. Our integrated approach allows us to optimize the entire system for mobile deployment, considering both accuracy and computational efficiency.

    Our contributions include:
    begin{itemize}
    item A novel text segmentation and detection method that efficiently identifies text regions in documents using a combination of lightweight neural networks and classical image processing.
    item A fully differentiable neural network model for document detection and perspective rectification that outperforms traditional corner detection methods.
    item An improved text extraction pipeline that intelligently combines detected text blocks based on reading order analysis, leading to better OCR results.
    item A comprehensive evaluation on both standard datasets and real-world documents, demonstrating superior performance compared to existing solutions.
    end{itemize}

    The solutions presented in this paper have been successfully deployed in Google Drive, benefiting millions of users worldwide. Our system achieves significantly better results than previous methods, with a 25.5% reduction in character error rate for text extraction, while maintaining real-time performance on mobile devices.

    section{Related Work}
    label{sec:related}

    Our work builds on several research areas, including document detection, rectification, and text extraction. We briefly review key developments in these fields.

    subsection{Document Detection and Rectification}
    Traditional document detection techniques rely on edge detection and geometric analysis. Methods like Hough transform~cite{hough,canny} have been used to detect lines in images, from which document boundaries can be inferred. Contour-based methods~cite{contours} extract document boundaries by identifying the largest quadrilateral in the image.

    More recently, learning-based approaches have shown promise. Zhang et al.~cite{zhang2018documents} proposed a CNN-based model for document detection. Ma et al.~cite{ma2018docunet} introduced DocUNet, combining deep learning with traditional image processing for document detection and rectification. DewarpNet~cite{das2019dewarpnet} uses a two-branch network to estimate both the document’s 3D shape and its boundaries.

    Our approach differentiates itself by using a fully differentiable pipeline that integrates document detection with perspective rectification, allowing for end-to-end optimization.

    subsection{Text Detection and Reading Order Determination}
    Text detection in documents has evolved from traditional techniques like connected component analysis~cite{connected} to modern deep learning methods. EAST~cite{EAST} and TextBoxes~cite{TextBoxes,TextBoxes++} are popular deep learning models for text detection, while DB-CVPR~cite{DB-CVPR} focuses on segmentation-based approaches.

    Reading order determination is crucial for correctly interpreting document content. Traditional approaches use geometric analysis of text block positions~cite{reading_order_geo}. More recent methods leverage machine learning~cite{reading_order_ml} or graph-based algorithms~cite{reading_order_graph} to determine the reading sequence.

    Our solution introduces a novel local region-based text detection method, combined with a sophisticated reading order algorithm that handles complex document layouts.

    subsection{OCR and Document Understanding}
    Optical Character Recognition (OCR) has seen significant advancements with the application of deep learning. Models like Tesseract~cite{tesseract} have incorporated neural networks for better accuracy. End-to-end OCR systems like CRNN~cite{CRNN} and TrOCR~cite{TrOCR} integrate text detection and recognition into a single pipeline.

    Document understanding goes beyond OCR to interpret the structure and meaning of documents. approaches range from rule-based systems to deep learning models like LayoutLM~cite{LayoutLM} and DocFormer~cite{DocFormer}, which leverage transformers for joint text and layout understanding.

    Our work introduces an intelligent block combination algorithm that improves OCR results by providing better context for character recognition, leading to higher accuracy, especially for languages that rely heavily on context.

    subsection{Mobile Document Scanning Applications}
    Commercial applications like Google Drive Scanner~cite{googleDriveScanner}, Microsoft Office Lens~cite{office-lens}, and Adobe Scan~cite{adobe-scan} implement document scanning capabilities on mobile devices. These apps typically include document detection, rectification, and text extraction features, but often prioritize user experience over accuracy or computational efficiency.

    Our solution improves upon these existing applications by providing better accuracy while maintaining real-time performance on mobile devices, as demonstrated in our experimental results.

    section{Detecting Document in an Image}
    label{sec:detection}

    The first step in our document scanning pipeline is to detect the document in an image.
    Instead of using a standard object detector or traditional image processing techniques,
    we introduce a novel neural network-based approach that is both more accurate and
    more efficient for the specific task of document detection. Our approach comprises
    two main stages: edge detection followed by intelligent corner estimation using a
    differentiable homography module.

    subsection{Edge Detection Based on Deep Learning}
    label{sec:edge_det}

    Our edge detection model is designed to identify the boundaries of documents in images. We need
    to address several challenges in this stage: 1) documents may have complex backgrounds, 2) lighting
    can be uneven, and 3) boundaries might be partially occluded or out of frame. To handle these challenges,
    we employ a convolutional neural network $f_{text{edge}}$ that is trained to predict
    edge maps specifically for document boundaries.

    Let $I$ be the input image. Our edge detection network produces an edge map $E = f_{text{edge}}(I)$,
    where $E in [0, 1]^{H times W}$ represents the probability of each pixel being part of a document edge.

    The architecture of $f_{text{edge}}$ is based on a modified U-Net~cite{UNet} with the following
    key improvements:
    begin{itemize}
    item We use dilated convolutions in the encoder to increase the receptive field without
    increasing the number of parameters.
    item We incorporate attention mechanisms that help the network focus on relevant features
    for document boundaries.
    item We add edge-specific output heads that predict both the presence and the direction
    of edges, which helps in subsequent corner estimation.
    end{itemize}

    To train this network, we use a combination of binary cross-entropy loss for edge presence
    and a directional loss for edge orientation:

    begin{equation}
    L_{text{edge}} = alpha L_{text{BCE}}(E, E_{text{gt}}) + beta L_{text{dir}}(D, D_{text{gt}})
    end{equation}

    where $E_{text{gt}}$ is the ground truth edge map, $D$ and $D_{text{gt}}$ are the predicted
    and ground truth edge directions, and $alpha$ and $beta$ are weighting factors.

    Our edge detection approach differs from general-purpose methods like HED~cite{HED}
    or Canny~cite{canny} as it’s specifically trained to identify document boundaries while
    ignoring other edges (e.g., text within the document or patterns in the background).
    This specialization leads to cleaner edge maps that are more suitable for subsequent
    document corner estimation.

    subsection{Corner Estimation with Differentiable Homography}
    label{sec:corner_est}

    Given the edge map $E$, the next step is to estimate the four corners of the document.
    Traditional approaches often rely on Hough transform or contour detection followed by
    polygon approximation. However, these methods can be brittle when edges are partially
    missing or when there are spurious edges in the background.

    Instead, we propose a differentiable homography-based approach that is more robust to
    these challenges. The key insight is that we can train a neural network to directly predict
    the four corners of the document and then use these corners to compute a homography matrix
    for perspective rectification.

    Let $g_{text{corner}}$ be our corner estimation network that takes the edge map $E$ and
    the original image $I$ as inputs and produces the coordinates of the four corners:

    begin{equation}
    C = g_{text{corner}}(E, I)
    end{equation}

    where $C = {(x_1, y_1), (x_2, y_2), (x_3, y_3), (x_4, y_4)}$ represents the coordinates
    of the four corners in clockwise order starting from the top-left.

    The architecture of $g_{text{corner}}$ is designed to capture both local and global context.
    It first processes the edge map through a series of convolutional layers to extract features,
    then applies a global pooling operation to get a fixed-size representation, and finally uses
    a multi-layer perceptron to predict the corner coordinates.

    Once we have the corner coordinates $C$, we compute a homography matrix $H$ that maps the
    quadrilateral defined by $C$ to a rectangle. This homography matrix is then used to warp
    the original image, resulting in a rectified document image.

    The key innovation in our approach is that both corner estimation and homography computation
    are differentiable, allowing us to train the entire pipeline end-to-end. This is achieved by
    using soft argmax operations for corner localization and a differentiable implementation of
    the homography matrix computation.

    Given the target rectangle coordinates $C_{text{target}}$ (typically a unit square), the
    homography matrix $H$ is computed as the solution to:

    begin{equation}
    H C = C_{text{target}}
    end{equation}

    This system of equations is solved in a differentiable manner using the direct linear transform
    algorithm~cite{DLT}, which allows gradients to flow back from the warped image to the corner
    coordinates.

    The loss function for training the corner estimation network combines a corner location loss
    and a reprojection loss:

    begin{equation}
    L_{text{corner}} = gamma L_{text{loc}}(C, C_{text{gt}}) + delta L_{text{reproj}}(I_{text{warped}}, I_{text{gt}})
    end{equation}

    where $L_{text{loc}}$ measures the distance between predicted and ground truth corners,
    $L_{text{reproj}}$ measures the difference between the warped image and the ground truth
    rectified image, and $gamma$ and $delta$ are weighting factors.

    Figure~ref{fig:corner_detection} illustrates the results of our corner estimation approach. By
    leveraging deep learning for edge detection and differentiable homography for corner estimation,
    our approach can handle challenging scenarios such as documents with complex backgrounds or
    partial occlusions.

    begin{figure}[t]
    centering
    includegraphics[width=columnwidth]{figures/corner_detection.pdf}
    caption{Examples of our document detection and corner estimation. Our approach successfully detects documents with complex backgrounds (top row) and handles challenging lighting conditions and partial occlusions (bottom row).}label{fig:corner_detection}
    end{figure}

Kolejne rozdziały

Zapraszamy do dalszego czytania naszego leksykonu.

Wybierz kolejny rozdział z menu poniżej, aby otworzyć nową podstronę kompedium wiedzy i uzyskać szczegółowe informację o leku, substancji lub chorobie.

  1. 09.04.2026
  2. www.leksykon.com.pl

Materiały źródłowe

  • #1 Phimosis | UCSF Department of Urology
    https://urology.ucsf.edu/patient-care/children/phimosis
    Physiologic phimosis: Children are born with tight foreskin at birth and separation occurs naturally over time. […] Pathologic phimosis: Phimosis that occurs due to scarring, infection or inflammation. […] If there is ballooning of the foreskin during urination, difficulty with urination, or infection, then treatment may be warranted. […] No special care is required for foreskin in infancy. […] In the first few years of life, gentle retraction with cleansing underneath the foreskin is sufficient during diaper changes or bathing and will result in progressive retraction over time. […] Treatments for phimosis vary depending on the child and severity of phimosis. […] Medical providers may recommend topical steroid ointment application for children with phimosis. […] These topical ointments are used to help soften the tight foreskin around the penis, so the foreskin may be easily retracted.
  • #1 Phimosis: Causes, Symptoms, Diagnosis & Treatment
    https://my.clevelandclinic.org/health/diseases/22065-phimosis
    Theres no way to prevent physiological phimosis. Nearly all newborns have it. Circumcision will prevent pathologic phimosis. […] Its also important to keep your childs penis clean. Infections are the most common cause of pathologic phimosis. Healthcare providers will give parents or caregivers directions on the best way to clean a penis. […] For adolescents and adults, the easiest way to prevent phimosis is to care for your penis properly. This includes: Retracting your foreskin entirely each time you pee. Pulling back your foreskin and cleaning underneath whenever you shower or bathe. […] Be sure to pull your foreskin back over the head of your penis when you finish peeing or bathing.
  • #1 Phimosis: Learn More – What are the treatment options for phimosis? – InformedHealth.org – NCBI Bookshelf
    https://www.ncbi.nlm.nih.gov/books/NBK326433/
    Nearly all boys have a naturally tightened foreskin for their first several years of life, which than goes away on its own. Treatment is recommended only if it causes problems or remains that way until the child reaches puberty. Using a steroid cream is often enough. Surgery is only rarely needed. […] Areas of stuck skin (adhesions) usually detach and tight foreskins usually loosen on their own within the first few years of life. So experts recommend first waiting if the child experiences problems like pain or trouble peeing. […] Treatment should also be considered if the foreskin first became too tight later in life as the result of scarring (acquired phimosis). […] Parents should never try to force the foreskin back in an attempt to loosen it or to wash the penis. This can be very painful for their son. It can also lead to injury.
  • #1 Phimosis | Conditions | UCSF Benioff Children’s Hospitals
    https://www.ucsfbenioffchildrens.org/conditions/phimosis
    Phimosis is defined as the inability to retract the skin (foreskin or prepuce) covering the head (glans) of the penis. […] Current incidence of phimosis is about 1% in 7th the grade boys. […] Phimosis is normal for the uncircumcised infant/child and usually resolves around 5-7 years of age, however the child may be older. […] If there is ballooning of the foreskin during urination, difficulty with urination, or infection, then treatment may be warranted. […] The foreskin should not be forcibly retracted, however gentle retraction is okay. […] Once the foreskin can be fully retracted, the ointment is discontinued and manual daily retraction (during warm baths and urination for the potty trained child) will prevent phimosis from reoccurring. […] In some rare cases your pediatric urologist may recommend circumcision due to failure of steroid ointment, pathologic phimosis, paraphimosis (foreskin stuck in the retracted position behind the head of the penis), recurrent urinary tract infections, or severe/recurrent balanoposthitis.
  • #1 Foreskin & penile conditions in young males | Paediatric Surgery Perth
    https://www.wapsau.com.au/phimosis-hypospadias-buried-penis-murdoch-perth/
    Almost all newborn males have a tight foreskin, which is a foreskin that cannot retract to reveal the head of the penis. Tightness in the foreskin is termed phimosis. In over 96% of newborn males, it is completely normal for the foreskin not to retract. In this age group the phimosis is normal or physiological. […] For infants and toddlers, parents do not need to retract the foreskin. Boys around the age of 6 or 7 years can be taught to retract their foreskins in the bath or shower for hygiene. By adolescence and throughout adult life, the foreskin should be freely and easily retracting. […] Phimosis treatment, involving paediatric surgery and urology review, is recommended in these cases: If the tightness is associated with pain, swelling, discharge, infections, or if there is difficulty passing urine, ballooning with urination, or spraying urinary stream.
  • #1 Foreskin & penile conditions in young males | Paediatric Surgery Perth
    https://www.wapsau.com.au/phimosis-hypospadias-buried-penis-murdoch-perth/
    If the child is over age 6 or 7 and cannot retract the foreskin, even though there are no symptoms. […] If the foreskin used to be easy to retract but has tightened and now cannot be retracted. In this group, the suspicion is raised of a progressive scarring condition of the foreskin and penis, known as balanitis xerotica obliterans or BXO. […] The inability to retract the foreskin is normal for most infants and young boys, and resolves with age. […] Phimosis only becomes a problem when there are associated conditions, such as pain, infection, swelling, or difficulties with urinating. […] For older children around age 6 or 7 who still cannot retract their foreskins, and who may or may not have mild symptoms, treatment can also be trialled with a course of topical steroid cream. […] Circumcision may be required for various medical indications, including: Children with recurrent foreskin infections, Children with recurrent urine infections, Suspicion of BXO, Failure of topical steroid cream to resolve phimosis, Persistent phimosis at adolescence.
  • #1 Tight foreskin: Causes, treatment, and prevention
    https://www.medicalnewstoday.com/articles/320997
    It is natural to be uncircumcised. However, circumcision removes the possibility of developing a tight foreskin. […] Tightness can often be prevented or treated by employing good hygiene techniques. […] There are several ways to prevent a tight foreskin. These include: Practicing good hygiene, which involves washing and drying the penis daily. Manually stretching the foreskin, from a young age. Treating skin conditions as they arise. Practicing safe sex by using condoms to prevent the spread of STIs. Using a lubricant during intercourse to prevent pain or splitting, which often occurs in men with phimosis. Seeking immediate treatment for infections of the penis or foreskin, which will help to prevent scarring. Discussing any concerns with a doctor. […] To prevent tightness of the foreskin, practice good hygiene and stretching techniques.
  • #1 Tight Foreskin: Causes, Treatment, and More
    https://www.healthline.com/health/mens-health/tight-foreskin
    Gently pulling back the foreskin and cleaning your penis from the time youre young may help prevent phimosis later on. […] If you ever develop an infection that affects the penis or foreskin, treat it early and thoroughly. Proper treatment can reduce your risk for scarring, which may help prevent phimosis from developing.
  • #1
    https://www.baus.org.uk/patients/conditions/13/tight_foreskin_phimosis/
    If you are unable to retract your foreskin fully, especially if it becomes red or painful, you should contact your GP. If a tight foreskin has been retracted and cannot be brought forward again, you should seek urgent treatment in your local hospital. […] If simple conservative measures fail to improve the tightness, your GP will normally recommend referral to a urologist for further advice. […] Stretching of a diseased foreskin is best avoided. There is no scientific evidence that it produces a cure and it can actually precipitate further tearing and scarring. This may worsen a phimosis which then requires surgical treatment later in life. Forcible retraction of the foreskin in children should be avoided. […] Steroid creams may soften your foreskin if the scarring is mild; stopping the cream, however, may result in a return of the condition.
  • #1 How to Stretch Foreskin to Treat Painful Phimosis
    https://www.healthline.com/health/how-to-stretch-foreskin
    Dont wait too long to get medical help. If the cream doesnt help within four to eight weeks, see your doctor for treatment. Seek immediate medical help if you have painful swelling or difficulty peeing. […] Practicing good penis hygiene can help you avoid phimosis or other conditions that can happen with a foreskin: Wash under your foreskin regularly, pulling it back and gently rinsing it with soap and water every time you bathe to prevent buildup of urine, dirt, bacteria, and other substances that can cause smegma or fungal infections. […] Stop trying to treat the foreskin yourself and see a doctor if you experience any of the following: trouble urinating, burning sensation or pain when you pee, painful redness, irritation, or itching, abnormal white or cloudy discharge from the penis, swelling of the head of the penis (balanitis), inability to pull the foreskin over the penis head after you stretch it back (paraphimosis). […] But if it doesnt work after a few weeks and you start to notice new or worsening symptoms, see a doctor for treatment to prevent any complications that a tight foreskin or an associated infection can cause.
  • #1 Phimosis – Wikipedia
    https://en.wikipedia.org/wiki/Phimosis
    Phimosis can prevent the foreskin from retracting during an erection. […] Prevention: Steroid cream, stretching exercises, circumcision. […] Generally, treatment is not considered necessary unless the foreskin still cannot be retracted by the age of 18. […] For those in whom the condition does not improve further, time can be given or a steroid cream may be used to attempt to loosen the tight skin. […] If this method, combined with stretching exercises, is not effective, then other treatments such as circumcision may be recommended. […] Topical steroid creams such as betamethasone, mometasone furoate and cortisone are effective in treating phimosis and should be considered before circumcision. […] Studies involving treating phimosis using topical steroids in conjunction with stretching exercises have reported success rates of up to 96%.
  • #2 Phimosis: Learn More – What are the treatment options for phimosis? – InformedHealth.org – NCBI Bookshelf
    https://www.ncbi.nlm.nih.gov/books/NBK326433/
    Nearly all boys have a naturally tightened foreskin for their first several years of life, which than goes away on its own. Treatment is recommended only if it causes problems or remains that way until the child reaches puberty. Using a steroid cream is often enough. Surgery is only rarely needed. […] Areas of stuck skin (adhesions) usually detach and tight foreskins usually loosen on their own within the first few years of life. So experts recommend first waiting if the child experiences problems like pain or trouble peeing. […] Treatment should also be considered if the foreskin first became too tight later in life as the result of scarring (acquired phimosis). […] Parents should never try to force the foreskin back in an attempt to loosen it or to wash the penis. This can be very painful for their son. It can also lead to injury.
  • #2 Tight foreskin (phimosis)
    https://www.nhs.uk/conditions/phimosis/
    It’s normal for babies and young boys to have a tight foreskin (phimosis), but adults can also be affected. […] If your or your child’s foreskin is tight, but is not causing problems like pain or bleeding, there are some things you can do to help ease it and keep the penis clean. […] Do not pull back the foreskin of a baby or young boy because it could be painful and damage it, leading to problems in later life. […] If your or your child’s foreskin is causing problems, treatments include steroid creams or gels (topical steroids) to help soften the foreskin. […] Sometimes if the foreskin is very tight it can get stuck and cannot go back to its original position covering the end of the penis. […] Immediate treatment is needed to avoid serious complications like restricted blood flow to the penis.
  • #2 Phimosis and Paraphimosis: Symptoms and Treatment
    https://patient.info/mens-health/penis-problems/phimosis-and-paraphimosis
    Phimosis means that the foreskin of the penis is too tight and so cannot be pulled back off the rounded head of the penis (glans). […] Attempts to forcibly pull back the foreskin at this stage can increase the risk of developing 'abnormal’ phimosis in later life. […] Personal hygiene is very important, including regular but gentle cleaning under the foreskin if it can be pulled back. Always leave the foreskin covering the glans of the penis after cleaning. […] For children with normal phimosis, usually no treatment is needed and the phimosis can be expected to resolve with time. You should avoid trying to forcefully pull back the foreskin as this can cause scarring and risks abnormal phimosis developing in later life. […] Phimosis persisting after the age of 2 years may be considered for further treatment, particularly if there is recurrent balanoposthitis or recurrent urinary tract infection. The options are plastic surgery or circumcision. […] One plastic surgery alternative to circumcision is called preputioplasty. This involves making a slit in the foreskin so that the foreskin can be pulled back more easily.
  • #2 Phimosis | UCSF Department of Urology
    https://urology.ucsf.edu/patient-care/children/phimosis
    Once the foreskin can be fully retracted, the ointment is discontinued and manual daily retraction (during warm baths and urination for the potty trained child) will prevent phimosis from reoccurring. […] In some rare cases your pediatric urologist may recommend circumcision due to failure of steroid ointment, pathologic phimosis, paraphimosis (foreskin stuck in the retracted position behind the head of the penis), recurrent urinary tract infections, or severe/recurrent balanoposthitis.
  • #2 Phimosis Causes & Treatment | Baptist Health
    https://www.baptisthealth.com/care-services/conditions-treatments/phimosis
    Phimosis is preventable with good daily hygiene. Gently cleaning your penis daily helps tremendously with phimosis prevention. Other steps you can take to prevent a tightened foreskin is to avoid rough handling of your foreskin and to practice safe sex to reduce the risk of sexually transmitted disease. […] As part of phimosis prevention, your doctor may recommend the following care for an uncircumcised penis: Carefully clean your penis with warm water daily. Gently clean underneath your foreskin. If you use soap to clean your penis and foreskin, use a mild or non-perfumed soap. Avoid retracting the foreskin of a baby or infant boy. You might unintentionally cause pain or harm. Avoid the use of deodorants and talc on your penis. Talc is a natural mineral ingredient in many cosmetic products such as talcum powder. These products can sometimes cause irritation.
  • #2 Phimosis: Causes, Symptoms, Treatment, and Prevention
    https://www.webmd.com/men/phimosis
    Getting circumcised will keep phimosis from happening. […] You can also prevent infections that cause phimosis by keeping your penis clean and taking steps to prevent sexually transmitted infections. […] The penis head and the foreskin need to be washed and dried regularly. Be gentle with the skin when you pull it back, and put it back in place when you finish.
  • #2 Tight Foreskin: Causes, Treatment, and More
    https://www.healthline.com/health/mens-health/tight-foreskin
    Gently pulling back the foreskin and cleaning your penis from the time youre young may help prevent phimosis later on. […] If you ever develop an infection that affects the penis or foreskin, treat it early and thoroughly. Proper treatment can reduce your risk for scarring, which may help prevent phimosis from developing.
  • #2 Tight foreskin: Causes, treatment, and prevention
    https://www.medicalnewstoday.com/articles/320997
    It is natural to be uncircumcised. However, circumcision removes the possibility of developing a tight foreskin. […] Tightness can often be prevented or treated by employing good hygiene techniques. […] There are several ways to prevent a tight foreskin. These include: Practicing good hygiene, which involves washing and drying the penis daily. Manually stretching the foreskin, from a young age. Treating skin conditions as they arise. Practicing safe sex by using condoms to prevent the spread of STIs. Using a lubricant during intercourse to prevent pain or splitting, which often occurs in men with phimosis. Seeking immediate treatment for infections of the penis or foreskin, which will help to prevent scarring. Discussing any concerns with a doctor. […] To prevent tightness of the foreskin, practice good hygiene and stretching techniques.
  • #2 Tight foreskin (phimosis) – Kenya Association of Urological Surgeons
    https://kaus.or.ke/tight-foreskin-phimosis/
    If you are unable to retract your foreskin fully, especially if it becomes red or painful, you should contact your GP. […] Tight foreskins may encourage tumours of the penis to develop but tumours never arise in patients who have been circumcised in childhood. […] If simple conservative measures fail to improve the tightness, your GP will normally recommend referral to a urologist for further advice. […] Stretching of the foreskin is best avoided. There is no scientific evidence that it produces a cure and it can actually precipitate tearing and scarring. This may worsen a phimosis which then requires surgical treatment later in life. Forcible retraction of the foreskin in children should be avoided. […] Circumcision is the mainstay of treatment if the foreskin is scarred by balanitis xerotica obliterans. This is one of medicines oldest operations.
  • #2
    https://www.baus.org.uk/patients/conditions/13/tight_foreskin_phimosis/
    If you are unable to retract your foreskin fully, especially if it becomes red or painful, you should contact your GP. If a tight foreskin has been retracted and cannot be brought forward again, you should seek urgent treatment in your local hospital. […] If simple conservative measures fail to improve the tightness, your GP will normally recommend referral to a urologist for further advice. […] Stretching of a diseased foreskin is best avoided. There is no scientific evidence that it produces a cure and it can actually precipitate further tearing and scarring. This may worsen a phimosis which then requires surgical treatment later in life. Forcible retraction of the foreskin in children should be avoided. […] Steroid creams may soften your foreskin if the scarring is mild; stopping the cream, however, may result in a return of the condition.
  • #2 Phimosis: Learn More – What are the treatment options for phimosis? – InformedHealth.org – NCBI Bookshelf
    https://www.ncbi.nlm.nih.gov/books/NBK326433/
    A naturally tightened foreskin in childhood doesnt need to be treated, unless it is causing problems like pain or is making it difficult to pee […] Treatment of phimosis without any symptoms might be considered if the foreskin remains too tight into and beyond puberty (congenital phimosis), or was loose enough at first, but then became too tight because of scarring (acquired phimosis). […] There are two treatment options: Use a steroid cream to help stretch the foreskin. Have surgery to partially or completely remove the foreskin (circumcision). […] A steroid cream is usually tried first. Surgery is then recommended if the cream doesnt work. […] Treatment with a cream is well tolerated. While phimosis is quite likely to come back after some time following treatment with steroid cream, the treatment can be repeated several times. If phimosis still persists, surgery may be a good idea.
  • #3 Phimosis Causes & Treatment | Baptist Health
    https://www.baptisthealth.com/care-services/conditions-treatments/phimosis
    Phimosis is preventable with good daily hygiene. Gently cleaning your penis daily helps tremendously with phimosis prevention. Other steps you can take to prevent a tightened foreskin is to avoid rough handling of your foreskin and to practice safe sex to reduce the risk of sexually transmitted disease. […] As part of phimosis prevention, your doctor may recommend the following care for an uncircumcised penis: Carefully clean your penis with warm water daily. Gently clean underneath your foreskin. If you use soap to clean your penis and foreskin, use a mild or non-perfumed soap. Avoid retracting the foreskin of a baby or infant boy. You might unintentionally cause pain or harm. Avoid the use of deodorants and talc on your penis. Talc is a natural mineral ingredient in many cosmetic products such as talcum powder. These products can sometimes cause irritation.