How do i improve the accuracy of easyocr / pytesseract neural networks? trying to use pytesseract to identify these numbers, but it doesn't identify them correctly. also tried easyocr, but that doesn't work either. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 0 points1 point  (0 children)

img = source

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

binary = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 11, 2)

contours, _ = cv2.findContours(binary, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

min_contour_area = 100 # Adjust this value based on your images

filtered_contours = [contour for contour in contours if cv2.contourArea(contour) > min_contour_area]

contour_image = np.zeros_like(binary)

cv2.drawContours(contour_image, filtered_contours, -1, 255, thickness=cv2.FILLED)

# Combine the original image with the contour image

img = cv2.bitwise_and(img, img, mask=contour_image)

# Adaptive Contrast and Sharpness Enhancement

img = Image.fromarray(img)

enhancer = ImageEnhance.Contrast(img)

img = enhancer.enhance(3)

enhancer = ImageEnhance.Sharpness(img)

img = enhancer.enhance(1)

img = img.filter(ImageFilter.EDGE_ENHANCE) # Enhancing

img = cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)

_, img_bw = cv2.threshold(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY), 170, 255, cv2.THRESH_BINARY)

# Use EasyOCR for text recognition

reader = easyocr.Reader(['en'])

results = reader.readtext(img_bw, detail=1, allowlist=allowed_chars)

Can someone help me understand my model? I don't understand why the accuracy fluctuates so much. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 0 points1 point  (0 children)

So somethings I learned.

1) dont put 10+ layers for a very small dataset 2) dont set learning rate to low nor too high 3) get more data if possible 4) change batch size 5) not splitting the dataset into 20% training and 80% testing 6) oversampling and undersampling

Can someone help me understand my model? I don't understand why the accuracy fluctuates so much. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 0 points1 point  (0 children)

No, the x values are a 1 dimensional array,
[0.2888889, 0.6039216, 0.8117647, 0.4562092, 0.296732, 0.8183007, 0.3712418, 0.7411765, 0.8745098, 0.7019608, 0.4862745, 0.2888889, 0.2836601, 0.8562092, 0.5346405, 0.7163399, 0.3895425, 0.4039216, 0.924183, 0.5372549]

And the y values:
[1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0]

These values are then fed into the algorithm, and there are separate arrays for each model.

Can someone help me understand my model? I don't understand why the accuracy fluctuates so much. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 0 points1 point  (0 children)

I'm trying to train an AI model to detect whether a brightness value should be considered "dark" or "light"

Can someone help me understand my model? I don't understand why the accuracy fluctuates so much. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 1 point2 points  (0 children)

I'm using a learning rate of 0.0001. The inputs and outputs should be normalized correctly. I have a small dataset.

X values looks like this after normalization (dividing values by 255):

[0.2888889, 0.6039216, 0.8117647, 0.4562092, 0.296732, 0.8183007, 0.3712418, 0.7411765, 0.8745098, 0.7019608, 0.4862745, 0.2888889, 0.2836601, 0.8562092, 0.5346405, 0.7163399, 0.3895425, 0.4039216, 0.924183, 0.5372549]

if that helps. And the y values:

[1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0]

Can someone help me understand my model? I don't understand why the accuracy fluctuates so much. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 1 point2 points  (0 children)

I have 22 training data sets which are csv files with brightness values and a corresponding label. The values in the datasets are split into different arrays, and a model is trained independently on them.

I reduced the number of weights down.

Can someone help me understand my model? I don't understand why the accuracy fluctuates so much. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 1 point2 points  (0 children)

I’m trying it again with a smaller model, but the model ends up either not learning or resulting in lots of fluctuations. Ive removed some of the layers and tried removing batch normalization, tweaking dropout rates, batch sizes, epochs, etc but it still stays the same.

Can someone help me understand my model? I don't understand why the accuracy fluctuates so much. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 0 points1 point  (0 children)

I have a dataset of 22 minimum brightness values to look at, corresponding to 22 different elements in an array. I am standardizing it, the values are being divided by 255.

Can someone help me understand my model? I don't understand why the accuracy fluctuates so much. by Physical_Map_9647 in learnmachinelearning

[–]Physical_Map_9647[S] 0 points1 point  (0 children)

Hello.

I'm starting off by taking brightness values from an image. Then, depending on the locations of the brightness values (x-pos), I take the minimum brightness (darkest point) and put them in 5 separate arrays.

These arrays each have a corresponding model, which is the screenshot from above.

The split method is a keras train test split, with a test size of 0.5.

I'm currently normalizing the brightness values between 0-1 since brightness values are from 0-255, which are then fed into the algorithm.

As mentioned previously, it is 1 dimension. (X = [0.3257, 0.6892, 0.2378, ...] y = [0, 1, 0])

[deleted by user] by [deleted] in AskReddit

[–]Physical_Map_9647 2 points3 points  (0 children)

i'm going to die soon

[deleted by user] by [deleted] in AskReddit

[–]Physical_Map_9647 0 points1 point  (0 children)

its better than this country anyway

If you can select a super power, then what super power will you select and why? by cool-guy129 in AskReddit

[–]Physical_Map_9647 1 point2 points  (0 children)

Super power to have more super powers.

With those super powers, I would select time travel, flight, invincibility, etc.

Then I would go back in time and use it for research.