An intelligent lens-free text recognition system
Through the intelligent lensless text recognition system, the modulated amplitude mask and deep learning model are used to solve the problem of insufficient text recognition accuracy under lensless imaging technology and achieve high-accuracy text positioning and recognition, which is suitable for various applications. Device integration.
Patent Information
- Application Number
- CN202210246740.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-03-14
AI Technical Summary
Due to poor imaging quality, existing lensless imaging technology cannot effectively detect and recognize non-single characters, making it incompetent in some application scenarios.
An intelligent lensless text recognition system including an optical module and a computational imaging and text positioning recognition module is used to generate a projected image using a modulated amplitude mask and an optical sensor, and is calculated through an encoder-decoder neural network (U-NET) Imaging, combines CTPN and CRNN models for text positioning and recognition, and optimizes the mask pattern to improve recognition accuracy.
It achieves high-accuracy text recognition under lens-less conditions, reduces lens size restrictions, allows the camera to be more easily integrated on other devices, and improves the system's versatility and practical application.
Smart Images

Figure CN114596571B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of lens-free imaging, and in particular relates to an intelligent lens-free text recognition system. Background Art
[0002] With the rapid development and application of visual tasks, cameras are integrated into various hardware devices. Some application scenarios have strict requirements on the size of the camera. Lensless cameras are imaging systems that use thin masks instead of lenses, so the size of the camera can be greatly reduced.
[0003] Compared with cameras with lenses, lensless cameras need to perform computational imaging on the data collected on the sensor to restore the image. However, the images reconstructed based on lensless technology have the disadvantages of blur and resolution, which makes them incapable of many visual tasks. Currently, there is no research on non-single-character text detection and recognition based on lensless technology.
[0004] Therefore, a lens-free text recognition system is needed. Summary of the invention
[0005] In view of the fact that the current lensless imaging technology has not been applied to the positioning and recognition of texts other than single letters due to its poor imaging quality, the present invention provides a lensless text positioning and recognition system with high recognition accuracy and universal applicability.
[0006] The technical solution adopted by the present invention is as follows:
[0007] The intelligent lens-free text recognition system of the present invention comprises an optical module and a computational imaging and text positioning recognition module. The optical module is mainly composed of a modulated amplitude mask plate and an optical sensor placed in parallel. The target to be recognized is placed in front of the optical module. The light emitted by the target to be recognized is scattered by the modulated amplitude mask plate and then projected on the plane of the optical sensor to form a projection image (raw data). The optical sensor transmits the projection image to the computational imaging and text positioning recognition module.
[0008] The computational imaging and text recognition module includes a computational imaging model, a text positioning model and a text recognition model, and the three models are connected in series; the input of the computational imaging and text recognition module is the projection image obtained on the sensor after passing through the optical module, and the output is the text form of the text on the projection image.
[0009] The modulated amplitude mask plate is a binary mask plate composed of k*k cells, and the value of each cell is 1 or 0, 1 indicates that light can pass through, and 0 indicates that light cannot pass through.
[0010] The projected image is outputted as a predicted reconstructed image by the computational imaging model; the text positioning model processes the input reconstructed image and outputs the position of the text in the image; after the output result of the text positioning model is inputted into the text recognition model, the text recognition result of the image is outputted;
[0011] During the training of computational imaging and text recognition modules, only the computational imaging model participates in the training and needs to update parameters. The text positioning model and text recognition model do not participate in the training.
[0012] The computational imaging model is a neural network of an encoder-decoder system, specifically using U-NET; the text localization model adopts an arbitrary text localization model structure, specifically using CTPN; the text recognition model adopts an arbitrary text recognition model structure, specifically using CRNN.
[0013] The pattern on the modulated amplitude mask is displayed through a liquid crystal display, and the pattern on the mask is randomly generated or determined after training optimization; the method for determining the mask pattern after training optimization includes the following steps:
[0014] 1) The imaging process of the target to be identified and the optical module is modeled as a two-dimensional convolutional layer, specifically:
[0015] m=w*o
[0016]
[0017] Wherein, w represents the amplitude distribution on the mask, that is, the value distribution of the cells on the mask; the coordinate system is constructed with the center point of the mask as the origin, (i, j) is the coordinate of the center point of the cell on the mask, and w i,j Represents the value of the cell with coordinates (i, j) on the mask;
[0018] o represents the scaled image of the target to be identified on the sensor plane when it does not pass through the mask (i.e., o represents the scaled image of the target to be identified on the sensor plane when it passes through the aperture); a coordinate system is constructed with the center point of the sensor plane as the origin, (x, y) represents the coordinate value of the pixel point of the projected image on the sensor plane, o x,y represents the pixel value at (x, y) on the sensor plane when the target to be identified does not pass through the mask; o x+i,y+j Represents the pixel value at (x+i, y+j) on the sensor plane;
[0019] m represents the image of the target to be identified projected onto the sensor plane after passing through the mask; m x,y Represents the pixel value of the target to be identified at (x, y) on the sensor plane after passing through the mask;
[0020] k represents the number of rows or columns of cells on the mask, i∈[1, k];
[0021] 2) Binarize the two-dimensional convolutional layer to obtain a two-dimensional convolutional layer of a binary neural network. The results are as follows:
[0022]
[0023] in,
[0024]
[0025]
[0026] Among them, w b Represents the result after binarization of w;
[0027] Since the mask has only 0 and 1 values, we use a binary neural network for training. The binary neural network uses the sign function to map two continuous values to -1 or +1, then adds 1 and divides by 2;
[0028] 3) Set the parameter w of the two-dimensional convolutional layer of the binary neural network b As model parameters, it is trained and optimized together with the computational imaging and text positioning and recognition modules;
[0029] 3.1) During the training process, the pattern of the mask is randomly initialized through circuit adjustment, and the result of random initialization is used as the initial parameter of the convolution layer of the binary neural network;
[0030] 3.2) Training of the system forward propagation process: Fix the target to be identified, measure the projection image of the target to be identified on the plane of the optical sensor after passing through the mask in the real physical scene, and use it as the input of the computational imaging and text positioning recognition module;
[0031] Training of the back-propagation process: Calculate the loss function Loss between the predicted image and the real image label output by the imaging and text positioning recognition module, back-propagate the loss function Loss to the binary neural network convolution layer, and update the binary neural network convolution layer parameter w b , and according to the updated parameter w b Modulate the adjustable mask, and use the modulation result as the mask pattern in the forward propagation process of the model in the next round of training;
[0032] 3.3) The mask pattern obtained after training is the optimized result.
[0033] The cell size of the modulatable mask is the same as the pixel size on the sensor plane; the distance d1 between the target to be identified and the modulatable amplitude mask is much larger than the distance d2 between the modulatable amplitude mask and the optical sensor, d1>100d2; therefore, the amplitude distribution on the mask is approximately equal to the projection of the amplitude distribution on the mask on the sensor plane.
[0034] The loss function Loss of the computational imaging and text positioning recognition module during the training process is:
[0035] Loss = a × Loss1 + b × Loss2;
[0036] Among them, Loss1 is the error between the predicted image output by the computational imaging model and the real image label (the target image to be identified); Loss2 is the error between the predicted text finally output by the computational imaging and text positioning and recognition module and the real text label of the target to be identified (the text information on the target image to be identified); a and b are weights.
[0037] Effective benefits of the present invention:
[0038] The lens-free text recognition system of the present invention can reduce the size limitation caused by the lens, making it more convenient to integrate the camera into other devices.
[0039] The present invention realizes the optimization of deep learning models of lens-free imaging and text recognition with integrated hardware and software, improves the accuracy of text positioning and text recognition in the lens-free environment, and each module of the system is universal and applicable and has strong practical applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is the overall data flow of the present invention.
[0041] Figure 2 It is a schematic diagram of the optical module in the present invention.
[0042] Figure 3 It is a schematic diagram of the computational imaging and text positioning and recognition module in the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0044] like Figure 1 As shown, the lens-free text recognition system of the present invention includes an optical module, a computational imaging and text positioning recognition module. The target to be recognized obtains raw data through the optical module, and the raw data obtains the text form of the text through the computational imaging and text positioning recognition module.
[0045] The optical module is composed of a modulated amplitude mask and a sensor, wherein the modulated amplitude mask is a binary mask, which is divided into k*k cells, the value of the cell is 1 or 0, 1 represents that the light can pass through, and 0 represents that the light cannot pass through. It is placed in front of the optical sensor, and the two are placed in parallel. The object is placed in front of the mask, and the light emitted by the object is scattered by the modulated amplitude mask, and a specific projection image (raw data) is projected on the plane where the sensor is located, which is recorded by the sensor and transmitted to the computational imaging and text positioning recognition module. The pattern of the modulated amplitude mask can be controlled in real time by the circuit, and can be displayed by a liquid crystal display. The pattern on the mask can be randomly generated or updated by training optimization; the mask obtained by training optimization can make the recognition effect of the computational imaging and text positioning recognition module better. When the mask pattern in the optical module is fixed, without optimizing the mask, using a fixed mask pattern, the positioning and recognition results of the text can still be obtained by the raw data obtained on the sensor through the computational imaging and text positioning recognition module.
[0046] like Figure 2 As shown, the method for training and optimizing the mask pattern is as follows:
[0047] 1) Model the interaction between the imaging target and the mask as a two-dimensional convolutional layer
[0048] m=w*o
[0049]
[0050] Wherein, w represents the amplitude distribution on the mask, that is, the value distribution of the cells on the mask; the coordinate system is constructed with the center point of the mask as the origin, (i, j) is the coordinate of the center point of the cell on the mask, and w i,j Represents the value of the cell with coordinates (i, j) on the mask;
[0051] o represents the scaled image of the target to be identified on the sensor plane when the modulated amplitude mask is fully transparent and does not pass through the mask; the coordinate system is constructed with the center point of the sensor plane as the origin, (x, y) represents the coordinate value of the pixel point on the sensor plane, o x,y Represents the pixel value at (x, y) on the sensor plane when the target to be identified does not pass through the mask;
[0052] m represents the image of the target to be identified projected onto the sensor plane after passing through the mask; m x,y Represents the pixel value of the target to be identified at (x, y) on the sensor plane after passing through the mask;
[0053] k represents the number of rows or columns of cells on the mask, i∈[1,k].
[0054] Since the pixel size of the mask unit cell is the same as the sensor pixel size, and d1>>d2 (d1 is greater than 100 times d2), w can be approximately equal to the projection of the amplitude distribution on the mask on the sensor plane.
[0055] 2) The parameters w of the two-dimensional convolutional layer are used as model parameters to train and optimize together with the subsequent computational imaging and text positioning and recognition modules.
[0056] 2.1) Binarize the two-dimensional convolutional layer to obtain a binary neural network:
[0057]
[0058]
[0059]
[0060] Among them, w b Represents the result of binarization of w.
[0061] Since the mask has only 0 and 1 values, we use a binary neural network for training. The binary neural network uses the sign function to map w to -1 or +1, then adds 1 and divides by 2.
[0062] 2.2) During the training process, the mask pattern is randomly initialized through circuit adjustment, and this value is used as the initial parameter of the convolutional layer of the binary neural network.
[0063] In the forward propagation process of the system: fix the target object to be measured, measure the raw data obtained on the sensor after passing through the mask in the real physical scene, and use it as the input of the computational imaging and text positioning recognition module.
[0064] After the computational imaging and text positioning and recognition modules, the error with the actual label is obtained.
[0065] During the gradient back propagation process: calculate the error between the output of the imaging and text positioning recognition module and the true label, calculate the gradient and back propagate it, back propagate the error to the binary neural network convolution layer, update the binary neural network convolution layer, and modulate the adjustable mask according to the updated weight result as the mask pattern in the forward propagation process of the model in the next round of training.
[0066] After training is completed, the mask pattern is fixed.
[0067] like Figure 3As shown, the computational imaging and text recognition module includes a computational imaging model, a text positioning model, and a text recognition model. During use, the module is composed of three models in series. The input data is the original data obtained on the sensor after passing through the optical module, and the output is the text form of the predicted text. During the training process, only the computational imaging model needs to update the parameters, and the text positioning model and the text recognition model do not participate in the training.
[0068] The computational imaging model is an imaging method based on deep learning, which can calculate the predicted reconstructed image (model output) from the raw data (model input) obtained on the sensor. The computational imaging model is a neural network with an encoder-decoder structure, and a U-NET structure network can be used specifically. During the training process, images containing letters and numbers are used as targets to be identified, and the raw data obtained on the sensor after passing through the optical module is used as the model input. The training loss function consists of two parts: 1) the error Loss1 between the target image to be identified (real image label) and the predicted image output by the model; 2) the predicted reconstructed image is input into the subsequent text positioning model and text recognition model to obtain the predicted text, and the error Loss2 between the predicted text and the text label of the target to be identified is calculated. The loss function Loss = a × Loss1 + b × Loss2.
[0069] Gradient back propagation: This loss function calculates the gradient backpropagation to update the computational imaging model and the two-dimensional convolutional layer mentioned above, and finally obtains the corresponding trained computational imaging model.
[0070] The text localization model is a neural network model. The input data is an image, and the output data is the location of the text. The model can use any text localization model structure, and the specific structure can be CTPN: the image passes through the VGG16 network, and each row of the last convolution layer of the network calculates a 3*3 sliding window, and the results are connected through the BLSTM structure, and finally input into a fully connected layer, and the output is the predicted coordinates and confidence score. And the model is trained, and does not participate in the back propagation update parameter of the loss function in this system.
[0071] The text recognition model is a neural network model. The input data is an image with letters and numbers, and the output is the result of text recognition. The model can use any text recognition model structure, such as CRNN: the image first passes through several convolutional layers to extract the feature sequence, enters the BLSTM, and finally outputs the score of the predicted letter. And the model is trained, and does not participate in the back propagation of the loss function to update the parameters in this system.
Claims
1. An intelligent lens-free text recognition system, characterized in that: It includes an optical module and a computational imaging and text positioning recognition module. The optical module is composed of a modulated amplitude mask plate and an optical sensor placed in parallel. The target to be recognized is placed in front of the optical module. The light emitted by the target to be recognized is scattered by the modulated amplitude mask plate and then projected on the plane of the optical sensor to form a projection image. The optical sensor transmits the projection image to the computational imaging and text positioning recognition module. The pattern on the modulated amplitude mask is displayed on a liquid crystal display, and the pattern on the mask is determined after training optimization; The computational imaging and text recognition module includes a computational imaging model, a text positioning model and a text recognition model, and the three models are connected in series; the input of the computational imaging and text recognition module is the projection image obtained on the sensor after passing through the optical module, and the output is the text form of the text on the projection image; The method for determining the mask pattern after training optimization comprises the following steps: 1) The imaging process of the target to be identified and the optical module is modeled as a two-dimensional convolutional layer, specifically: m=w*o Where w represents the amplitude distribution on the mask, that is, the value distribution of the cells on the mask; the coordinate system is constructed with the center point of the mask as the origin, (i, j) is the coordinate of the center point of the cell on the mask, and w i,j Represents the value of the cell with coordinates (i, j) on the mask; o represents the scaled image of the target to be identified on the sensor plane without passing through the mask; the coordinate system is constructed with the center point of the sensor plane as the origin, (x, y) represents the coordinate value of the pixel point of the projected image on the sensor plane, o x,y Represents the pixel value at (x, y) on the sensor plane when the target to be identified does not pass through the mask; o x+i,y+j Represents the pixel value at (x+i, y+j) on the sensor plane; m represents the image of the target to be identified projected onto the sensor plane after passing through the mask; m x,y Represents the pixel value of the target to be identified at (x, y) on the sensor plane after passing through the mask; k represents the number of rows or columns of cells on the mask, i∈[1,k]; 2) Binarize the two-dimensional convolutional layer to obtain a two-dimensional convolutional layer of a binary neural network. The results are as follows: in, Among them, w b Represents the result after binarization of w; 3) Set the parameter w of the two-dimensional convolutional layer of the binary neural network b As model parameters, it is trained and optimized together with the computational imaging and text positioning and recognition modules; 3.1) During the training process, the pattern of the mask is randomly initialized through circuit adjustment, and the result of random initialization is used as the initial parameter of the convolution layer of the binary neural network; 3.2) Training of the system forward propagation process: Fix the target to be identified, measure the projection image of the target to be identified on the plane of the optical sensor after passing through the mask in the real physical scene, and use it as the input of the computational imaging and text positioning recognition module; Training of the back-propagation process: Calculate the loss function Loss between the predicted image and the real image label output by the imaging and text positioning recognition module, back-propagate the loss function Loss to the binary neural network convolution layer, and update the binary neural network convolution layer parameter w b , and according to the updated parameter w b Modulate the adjustable mask, and use the modulation result as the mask pattern in the forward propagation process of the model in the next round of training; 3.3) The mask pattern obtained after training is the optimized result.
2. The intelligent lens-free text recognition system according to claim 1, characterized in that: The modulated amplitude mask plate is a binary mask plate composed of k*k cells, and the value of each cell is 1 or 0, 1 indicates that light can pass through, and 0 indicates that light cannot pass through.
3. The intelligent lens-free text recognition system according to claim 1, characterized in that: The projected image is outputted as a predicted reconstructed image by the computational imaging model; the text positioning model processes the input reconstructed image and outputs the position of the text in the image; after the output result of the text positioning model is inputted into the text recognition model, the text recognition result of the image is outputted; During the training of the computational imaging and text recognition modules, only the computational imaging model participates in the training, while the text positioning model and the text recognition model do not participate in the training.
4. The intelligent lens-free text recognition system according to claim 3, characterized in that: The computational imaging model is a neural network of an encoder-decoder system, specifically using U-NET; the text localization model adopts an arbitrary text localization model structure, specifically using CTPN; the text recognition model adopts an arbitrary text recognition model structure, specifically using CRNN.
5. The intelligent lens-free text recognition system according to claim 1, characterized in that: The cell size of the modulatable mask is the same as the pixel size on the sensor plane; the distance d1 between the target to be identified and the modulatable amplitude mask is much larger than the distance d2 between the modulatable amplitude mask and the optical sensor, d1>100d2; therefore, the amplitude distribution on the mask is approximately equal to the projection of the amplitude distribution on the mask on the sensor plane.
6. The intelligent lens-free text recognition system according to claim 3, characterized in that: The loss function Loss of the computational imaging and text positioning recognition module during the training process is: Loss = a × Loss1 + b × Loss2; Among them, Loss1 is the error between the predicted image output by the computational imaging model and the real image label; Loss2 is the error between the predicted text finally output by the computational imaging and text positioning and recognition module and the real text label of the target to be recognized; a and b are weights.
Citation Information
Patent Citations
A method for detecting and recognizing sensitive characters in natural scene images
CN109447078A
Cell viability analysis and counting from holograms by using deep learning and appropriate lensless holographic microscope
WO2021076075A2
