Disclaimer: These are my personal observations. This is not medical advice.
You start noticing the various body positions that put maximum weight on your foot, only when your foot is injured and the pain keeps reminding you to be careful.
Same way, I started noticing a lot of tiny details about eye strain which people normally ignore or aren't able to notice. My eye strain became so severe that twelve ophthalmologists in two cities were not even able to diagnose the problem because they never encountered such a case.
These are what I learnt about fatigue related eye strain:
The root cause is a lack of 7 to 8 hours of uninterrupted sleep.
Plastic spectacle lenses strained my eyes faster than glass lenses. Even the top three world-class plastic lenses were nowhere close to the visual acuity provided by an ordinary glass lens that had no extra coatings.
Anti-reflective coatings did not help me. Aspherical lenses do not help. Eye exercises did not help (when muscles are tired, you should rest; not exercise them more). Eating carrots does not help (it's muscle strain; not a vitamin deficiency). Astigmatism lenses did not help (because I didn't have astigmatism). Dry eye remedies did not help (I didn't have dry eyes). Washing the eyes did not help. Looking at far-away objects did not help. Whole body exercise did not help. Eye drops did help a little, but it was only to give initial relief. Eye drops won't cure the problem and aren't meant to be used forever. The only thing that helped was getting 7 to 8 hours of uninterrupted sleep, taking rest periodically and having a well-balanced diet of properly cooked food.
With insufficient sleep, strain builds up and manifests as headaches, burning feeling in the front of the eyeballs, sharp stabbing pains behind the eyeballs, at the sides of the eye balls, muscles all around the eye feeling sore and at the most chronic stages, even the cheek muscles and muscles near the eyebrows feel strained and sore. Muscles around the eye also start twitching sometimes. When any of these happen, immediately stop straining your eyes and keep your eyes closed until the strain subsides, while also relaxing your face muscles and neck muscles. Do not aggravate the problem by trying to be a hero and straining your eyes even more. No career, job, boss or money is worth more than health.
A little experiment I tried
The blue shapes in the image below, are spectacle lenses viewed from the top, and this is about trying to read some words with the right eye. The left eye is closed or covered with one hand. When the lens was perpendicular to the words, the words were clear. But when the head was turned even slightly (not even as much as shown in the image), the word got distorted a bit. With some plastic lenses it's a blur. With some, it's a slight distortion. With glass lenses, it's far lesser. This blurring/distortion didn't happen when not wearing spectacles.
Something the industry does not seem to have considered is that our vision from both eyes is not always parallel.
I am 100% sure of the difference between glass and plastic lenses because I've got repeatable results during a three year period of checking. Scientists would of course call this a subjective result (and I agree), so I hope there would be someone who could verify it objectively. Sadly, the industry doesn't seem to have developed methods to measure extraocular muscle strain.
Keeping eyes fixed in one direction tires your muscles. That's a given. But I have a strong belief (this needs to be impartially and objectively verified) that the distortion created by spectacle lenses are the other major unexplored cause for eye strain and headaches. I don't know if wearing contact lenses would help (didn't try them because of the risk, and lasik doesn't work out for certain people. There is this study and this study that say contact lenses are less problematic than spectacles), but my opinion is that at least when working at a computer, it helps to wear spectacles with a glass lens instead of plastic lenses (it has to be on a frame that gives the same focal point position in front of your eye as the earlier spectacles, to avoid strain from eye accommodation). Keeping a diary/spreadsheet helps record how much uninterrupted sleep one has got everyday versus how bad the eye strain was when wearing spectacles with glass lenses versus plastic lenses. After not wearing spectacles and getting deep sleep, many nights, for two months, my eyesight actually improved.
Plastic lenses obviously have a safety benefit, but for me that's a lot less important than being able to avoid the horrible eye strain. For just sitting in front of the computer, I don't see any safety problems when using glass lenses.
This person Ben, also speaks of why glass lenses are better than plastic or polycarbonate.
Update 2022: At least from Ubuntu 22.04 and Windows 10 onward, there's no need of installing redshift or similar apps, since the OS comes pre-installed with a NightLight app. Even Android has it.
Important: Blue light blocking lenses have been proven to have shown no evidence of preventing digital eye strain. Ref1, Ref2.
When using the computer in dimly lit surroundings, it helps to lower the brightness of the screen. One popular application for Windows was f.lux, and although they appear to have created a version for Linux, Ubuntu users don't need to install f.lux. We have Redshift.
Redshift can be installed hassle-free directly from the Ubuntu software center. Better still, don't even bother installing the GUI. Just install using sudo apt-get install -y redshift
I was initially disappointed when Redshift didn't start because the computer wasn't connected to the internet and Redshift didn't start because it couldn't estimate my location (and hence the time of the day)...which made me wonder why it's programmed in such a dumb way.
Then I discovered that it's just a matter of using: redshift -O 3000
You can change that 3000 to any other value, depending on your comfort.
Some laptops don't allow the brightness to go below a certain level (in which case you can also use xrandr), and the blue light from the screen is quite bright. Redshift creates an apparent reddish colour on the screen which is actually a bit comfortable.
Still better, you can even change the gamma with Redshift: redshift -O 3000 -g .5
To remove the effect of redshift, simply type: redshift -x
Inspite of this, I'd still recommend having ambient lighting, and not working in the dark. Even with Redshift, the monitor is bright and the surroundings are dark.
Alternative to Redshift and f.lux:
Every monitor has buttons for adjusting brightness and contrast. First, reduce the brightness and contrast to a level you are comfortable with. Then explore more of the monitor's menu options, and you'll see some color schemes. One of these will be a "warm" color. That's basically a color scheme that reduces the blue light. Just use that instead of installing redshift or flux or unnecessarily purchasing blue light spectacles that lie about reducing eye strain (because the real cure for eye strain is to stop overworking the eyes).
ps: Reports of digital screens making us lose sleep is a myth. We lose sleep because we force ourselves to stay awake. Not because of the digital screen's blue light. When you feel sleepy, just go to sleep instead of forcing yourself to stay awake longer.
My eye strain had become chronic in 2011 and I haven't fully recovered yet. During these years of crippling strain, I've been able to note subtle details which people ignore because their strain hasn't yet become serious. Also follow the links in "Other medical conditions" below.
Some facts:
Fact 1:Yes; reading text causes more strain to the eye compared to tasks that don't require extreme analysis on tiny areas. This doesn't mean that digital screens are the root cause of strain. Excess brightness of digital screens can slightly increase strain, but that's not the root cause of strain. (Important: Blue light blocking lenses have been proven to have shown no evidence of preventing digital eye strain. Ref1, Ref2)
Fact 2:The strain by itself is not an issue. It happening on a daily basis is not the real issue either. The real issue is that (assuming you don't have other medical problems) no matter how much you think that you are getting enough sleep, you actually aren't. If you get sleep your eye muscles will recover while sleeping and your strain is unlikely to build up to a stage where it hampers you.
Fact 3:When your eyes are strained, washing your eyes or wearing special spectacles or having coatings on spectacle lenses or looking at far away objects or exercising your eye muscles do not help. What helps is keeping your eyes closed until the strain subsides, and relaxing your neck and face muscles.
What to check for:
Sleep:If you are confident that you are getting enough sleep, that's your biggest mistake. Very seriously and thoroughly evaluate yourself on whether you are getting a minimum of 7 to 8 hours of continuous,deep sleep every night. I stress on "continuous, deep". Waking up at night to urinate or being woken up by noise (even if you go back to sleep immediately) or sleep apnea or waking up due to stomach discomfort or waking up after 4 hours of sleep and being unable to go back to sleep etc. are signs that you aren't getting enough sleep. Keep a diary where you write the approximate time you slept and woke. You'll be surprised. Feeling sleepy many times during daytime is a clear indication that you lost sleep at night. Lying in bed awake with your eyes closed does not count as sleep.
Other medical conditions:Astigmatism or deficiencies leading to dry eye (the beginning stages of eye strain can make you feel like your eyes are dry. It does not necessarily mean you have dry eye) or other medical conditions might be a problem, but verify your sleep sufficiency before blindly accepting what the doctor says. Getting second opinions is not guaranteed to give you the right diagnosis. I met twelve ophthalmologists who didn't have a clue of what caused my eye strain and how to cure it. I have been shocked and disappointed at this (also reported by another person, though I don't agree with his diagnosis). There are some doctors though, who actually are experienced enough to identify the problem and carefully examine your medical history and symptoms before they come to a conclusion. Find these doctors. The general physician or ophthalmologist may not always be knowledgeable enough to identify certain highly specific conditions certain people go through. Some examples are here, here, here, here, here, here, here, here, here and here.
Food and water:It's medically known that stomach problems cause sleep problems and sleep problems cause stomach problems. Both of these wreck havoc on the rest of the body. I've listed what precautions to take with food in this post.
Spectacle lenses: Glass lenses were much less strenuous for me. I believe it has to do with the better visual acuity it provides. Having special coatings on the lens didn't help reduce my eye strain. Using cheap, ordinary glass lenses without any special coatings gave me the most relief and I eventually started using the computer without wearing spectacles for a while. Haven't tried contact lenses and am definitely not going for Lasik inspite of the rebuttal because the focus should be on proper food, rest and sleep.
How to fix fatigue-induced eye strain
Step 1: My doctor prescribed eye drops and Lacrigel to give some initial relief. These were only for a few weeks of use just to give some initial relief. They won't solve the problem and are not meant to be used forever. Make sure you close your eyes for a while everytime your eye feel strained.
Step 2: Rule out medical conditions sensibly. A dry eye specialist tried convincing me I had dry eyes and recommended a vitamin B12 test at an affiliate lab and a followup consultation, but a Schirmer's test at another hospital ruled out dry eyes. Computerized eye tests at two hospitals and three ophthalmologists said I had astigmatism because I mentioned eye strain, but those glasses caused unbearable strain and two other ophthalmologists later ruled out astigmatism.Basically, get opinions from multiple doctors to ensure that you have been diagnosed correctly and ensure you verify if you really have a medical problem or if it's just plain fatigue-related strain. Ophthalmologists themselves have told me that vision correction is not an exact science and that mistakes are possible.
Step 3: Examine what food you eat. If you eat from an office/college canteen, bakery, stall or a restaurant (or even if your cook at home doesn't cook properly), chances are very high that you are eating food that is either not fully cooked or has burnt particles in it or is of poor quality or is adulterated. Trust me, a majority of people in this world (including you) are very very poor judges of food quality. Drinking curd after dinner helps give some relief and your sleep should improve with time (probably because curd has Tryptophan) as you change your food habits to eating properly cooked food. More here.
Step 4: Make sure you get 8 hours continuous sleep every night. Don't let people or a phone wake you unnecessarily. Don't let your job make you lose sleep. Make sure you have a quiet, warm, dark, comfortable environment for sleeping. And please take Step 3 very seriously.
Step 5: Make it a point to close your eyes and relax your face muscles everytime you feel even a slight bit of strain. Don't push yourself to work harder unless you have got your rest first. No job, boss, career, pay or recognition is worth as much as health. I learnt that the hard way.
Step 6: Get a good amount of full-body exercise. Exercising does not help reduce eye strain at all. It however does help in maintaining good health which could give you slightly improved sleep and general body function. Oh by the way, when your muscles are aching from exercise at the gym, are you supposed to take rest or fix the ache by exercising more? Take rest obviously! Same way, when your eyes are strained, just close your eyes and rest them.
All you really have to know is that unless you have some underlying medical condition, simple fatigue-induced eye strain can be cured just by getting your eight hours of sleep and some rest when your eyes are tired. It can take a few months/years to recover (and nothing other than rest+sleep can help speed up the recovery), but that's all there is to it. You don't have to spend a fortune on special spectacles or medication. Take care.
Remember: The primary focus should be on getting well cooked food, rest and sleep.
Short answer: Not really necessary, but good if you can.
Long answer:
A suit comes into the picture only after the major necessities are covered. A relative once said: "Anybody can make excuses; but for the person who really wants to attend an event, they will make sure they are there, no matter what". Although his quote seemed like words of wisdom long ago, one now realizes that it is a bit too harsh on people. When dealing with randomness and emotional beings, it isn't right to apply hard rules on anyone.
The first most important thing you can do for someone's wedding, is to attend it when you have been invited. Being there for that person.
The second most important thing is not something for you to consider. It's for the hosts and the other guests to consider. Judging others. I know of people who scrutinize every tiny bit of detail about how another person dresses and grooms themselves. It's the equivalent of burying your head in your smartphone screen during an event. When at a wedding, try to help out with whatever you can and make the day special for the families of the bride and groom. At other times, socialize with others and try making them feel special by letting them talk about what they like and encouraging them to speak about events in their life which they cherish.
When a person has shown the courtesy of attending an event, it is your duty, whether you are the guest or the host, to make that other person feel comfortable and welcome. Remember that rituals, customs and formalities are just a conjuring that are not anywhere close to being worth as much as a person's sense of self worth and respect.
That being said, if a wedding invite specifically mentions casuals, wear casuals. Else, the best bet are formals. If you have a good suit, wear it. If you don't have one or it's at the dry cleaner's, then a well groomed appearance with a formal shirt, pant and shoes will do just fine.
Remember: Mutual respect and consideration are far more important than a suit.
People find weird things cute. They enjoy watching animals perform tricks and
keep flight-gifted creatures as pets in tiny cages. When it comes to
gifting and pets though, there are some things a sensible human can do:
1. Animal tricks: Unless the animal actually enjoys it (dog taught to fetch a ball), don't make animals do tricks. 2. Birds as pets: No
matter how well you take care of your birds, I feel it is a sadist
behavior. A pair of budgies were gifted to a person I know, and she
wanted to breed them. So the birds gave rise to five more baby budgies,
and she's really happy. But I've observed the behavior of these budgies
for many months now. Although they are reasonably affectionate to
humans, their natural behavior tends to finding the highest perch
available and to fly away from human contact as much as possible. They
are independent, intelligent, curious creatures that are denied their
freedom because somebody thinks it's cute to own them or because
somebody thinks they are being protected from the rest of the world. Here are some things you need to know:
The bait: Pet shop owners sell budgies at Rs.150 per bird.
One thinks that's reasonable until one realizes that for the duration of
the bird's life, one has to buy it seeds. So each bird sold, gives them
a permanent customer. Now that they know they got you hooked, they
charge exorbitant prices for the seeds. In Bangalore, bird seeds that
are meant for budgies and finches, are purchased by shop owners for
Rs.26 per kg and sold at Rs.50 or even at Rs.100 per kg. Some people
sell it at Rs.220 or Rs.300 per kg on online shopping sites. Also sold,
are vitamins etc. which the birds don't really need if you simply feed
them with proper diet. Feeling cheated already?
The possible scam: The pet industry in USA is worth $66 BILLION.
I've known shop owners India who deliberately or unknowingly keep pet
birds and fish which have parasites, so that customers who buy it would
come back to buy more when the pet dies. Would the increase in pet cancer be from something deliberately introduced into pet food? Just speculating.
Don't set them free: Animals and birds raised in captivity do
not know where to find food and how to defend themselves. They also do
not have the stamina to escape predators. They don't even know how to
escape predators when pursued (I've seen it happen). If you already have
a pet, keep it with you and care for it. Don't let it breed and create
more of its kind that will have to live a captive life too. If you have
birds, give them a larger space to fly around. Don't think you are
giving them sufficient opportunity to fly if you have an aviary or allow
them to fly in your room. A bird enjoys flying only when it's able to
flap its wings and then glide at high speed for a long distance.
Breeding a bird and keeping it caged denies it of its fundamental right to fly free. There are aviaries like Shuka vana where injured or uncared birds can be taken care of.
Having a pet was an old tradition. Of a time when cruelty was considered
normal. Crazy behaviour was considered a normal part of a ritualistic,
egoistic society. Of a time when people were a lot less civilized and
immature. A time when even humans were displayed in a zoo.
We do not have to continue those practices. Please....stop buying pets.
Stop breeding them. Stop forcing them to live an unhappy, bored life in
captivity. If you've rescued them and are taking care of them, it's an
entirely different thing. Just don't breed more captives for your
pleasure/profit.
The last time I tried Ubuntu 17 was on a non-Intel motherboard, so nothing happened. But there was something that I didn't like, so switched back to 16. Now I read that Ubuntu 17.10 has a bug which corrupts the BIOS and prevents USB boot.
Why it happens: This happens because Intel's SPI driver (allows the OS to rewrite firmware's flash memory) causes the firmware to become write protected. This happens only in Intel Broadwell and Haswell machines with serial flashes with SPI_NOR_HAS_LOCK set.
If your BIOS is affected:Try the fixes mentioned on this page. If it doesn't work, you may have to replace the flash memory chip or the entire motherboard, depending on how it is manufactured. Is it fixed? Yes. This page mentions the problem, the fix and the machines affected. You can now fearlessly download Ubuntu versions higher than 17.10, and you won't have any trouble. Lesson: Although contrary to conventional advice, it helps to not have automatic updates enabled, and to upgrade to a new version of an OS only after some time has elapsed since its release.
A relative of mine was being treated at a hospital, and I heard the hospital was making his friends and relatives run around, to arrange for replacement blood donors. Since he was undergoing plasmapheresis and dialysis, there was a huge demand for blood. Moreover, even though they brought blood donors and paid the donors, they still had to pay extra for blood units that the hospital gave. That was a shame. Especially for a hospital that claimed to treat its patients well.
I wrote a letter to them. The links in the letter are important. They will take you to a whole new level of knowledge.
Hello,
I know there's no point in taking you on a guilt-trip of making relatives of patients running around trying to find blood donors, so let's get down to some facts:
At least in Mumbai, hospitals who arm-twist relatives of patients can lose their NOC.
Blood obtained from relatives/friends or coercion is unreliable. It is the duty of the hospital to organize for safe blood by conducting frequent blood donation camps. Don't promise free blood though.
I understand hospitals have their own logistics to worry about, but when you have a marketing term that claims to treat people well, the hospital's word-of-mouth advertising will definitely improve when people know that this is one hospital that does not inconvenience people. Apart from the blood donation aspect, I really appreciate other procedures that are followed well in the hospital.
Kindly forward this to the person who can take decisions on organizing blood donation drives. Meanwhile, I hope your hospital could immediately stop inconveniencing people and instead organize for processed blood units to be brought to the hospital from other blood banks (which follow strict guidelines). You could of course charge a premium on it.
Regards,
Nav
For the reader: If you can organize for donors, then please do. There is indeed a shortage of blood. But be aware that you are not obligated to.
Bangalore itself needs an average of 800 units of blood everyday!!! Do encourage and participate in blood donation drives. It's the best way to ensure there is safe blood available for everyone in need. Encourage hospitals to organize frequent blood donation camps instead of just complacently indulging them with replacement donors.
----------------------------------------------
Some points from the links above:
With no official complaints raised by the public, corporate blood banks
have no incentive to walk away from replacement blood. “Grievances can be filed at the PM’s portal,” Centralised Public Grievance Redress and Monitoring System (CPGRAMS),
“which collates grievances from multiple sources and forwards them to
the state government, nodal officer, or blood bank concerned,” says Dr Shobini.
Shobini Rajan,
assistant director general, National Aids Control Organisation
(NACO), said the blood policy doesn't say it is illegal for hospitals
to ask for donors but it is undesirable.
In the "good old days", if you forgot your BIOS password, all you had to do was open up the computer, remove the CMOS battery or remove the jumper near the battery and your CMOS password would get reset to no password.
That's changed now. I recently reset my laptop to CMOS factory default settings, saved and exited, and it asked for a password the next time I wanted to enter the CMOS settings. I had not even set a password!!!
Opening up the laptop and finding the CMOS battery was an interesting proposition, so I did just that. Removed the battery, replaced it after 30 seconds, put back all components, started the laptop and it still asked for a password. Darn! Going through the laptop manual showed that the battery had to be removed and kept aside for at least an hour.
Ok good. So I did that. Waited for more than an hour, put back all components, started the laptop and bang! There was the password prompt again!
Turns out that there was a person who even kept the battery aside for three months and yet the password didn't reset. It's likely to be stored in a more permanent location in memory in today's computers.
The solution:
After a lot of anxious searching, I found this website. The ultimate guide to resetting the BIOS password.
Turns out that when you take your computer to the official service people, they don't need to know your BIOS password or hack into it with brute force techniques.
They simply use a default password that the manufacturer programs into the motherboard. These are called backdoor codes.
So all you have to do is try out some of the openly available backdoor codes on the website, and if that doesn't work, then try entering some random password three times and your BIOS password prompt will show you a number. Enter that number into this website https://bios-pw.org/ and it'll show you the backdoor password for your BIOS.
That's it! I was able to access my CMOS settings screen again and this time I set my own password.
Do try this before you take your laptop to some service person who'd use the same simple technique and then charge you a huge amount because you'd think they used some super secret hacking technique to elegantly solve your problem for you.
________________________________
The fact that you are here means that you use the computer a lot. So please also take some time to understand the real cure for eye strain. Yes, it matters.
The draft electoral rolls for Bangalore are out already, and voters can now check/edit their details online.
There is a regional website where the backend didn't function properly, so I'd recommend going to the other regional website which takes you to the national website. Sadly, none of the websites have https, so anything you enter there could be viewed by someone else. Your browser will inform you about this the moment the webpage opens.
Once on the national website, you can search for your existing voter information. I typed in my details and it didn't find anything, but on clicking the Search by EPIC number tab, I entered my voter ID and was shown my details which were exactly what I had entered earlier, and the backend didn't even return an exact name search match. Since the websites were powered by C-DAC, I wrote to them and hope they'd introduce HTTPS.
Still, as long as you are ok with not using https, you can use the website to submit forms online and track your application status online.
Forms are available for:
Inclusion of names for residents electors
Inclusion of names for overseas electors
Any objection on inclusion of names
Correction of entries in the Electoral Rolls
Transposition within Assembly
Some thoughtful person has also created a nice caricature document explaining general voter information. Do go through it and show it to kids.
This may actually be quite a good incentives for scholars and literature enthusiasts, for uploading more books online.
Similar to how Google Trends gives you graphs to compare various Google search terms used over the years, Google Ngram viewer allows you to search and compare the usage of words and phrases used in books over the years. You can even add wildcard characters like the asterisk, and even specify if what you are searching for is a noun or an adjective etc. Two researchers, Sparavinga and R.Marazzato even wrote a paper on it.
For example, searching for "how are you" vs "how do you do" shows that "how do you do" was used more in the 1700's, but slowly the usage declined. On a side note: the reply to "how do you do" is "how do you do", and not "I'm fine".
More on how Ngram works: https://books.google.com/ngrams/info#
If your work is primarily on Google Scholar, there are good search tools (including advanced search) and metrics information available to gauge the visibility and influence of articles published. Useful tools.
Which is better? Finding a bunch of intellectuals online, who love discussing your favourite topics on artificial intelligence, general knowledge, TED talks, research efforts worldwide or switching off your phone and computer and spending time with relatives who discuss cricket runs scored and religious rituals?
Interacting online has the advantage of filtering out a HUGE amount of irrelevant data, awkwardness and annoyances. If you like it, there's nothing wrong with liking it. Time is precious to all of us. Let's spend it doing what we like, and with the people we like. Whether the people are online or physically present with you is irrelevant.
It's the genuineness of your connection with them that matters.
That being said, physical meetings have a flavour of their own, and should be encouraged at the comfort level that people would like it to be encouraged.
As for Simon Sinek's observation...
...it's easy to use the pointing finger to highlight "what's wrong with this generation", but one has to know that this is what every generation has been saying about the next generation for the past millenia.
The truth is, there's nothing ever wrong with a generation. There's nothing wrong with how people do things. Some people build good relationships, some don't. Some people adopt and use technology in specific ways, some don't. Some people will always be less confident and unhappy, some won't. That's how we are meant to be as a population. There's nothing wrong in that.
Every single species on this planet was not meant to live and behave in a certain way forever. We evolve. We are meant to evolve. When you see someone doing something different, it's because that's what they are meant to do. We as a generation, have better access to information. We know and understand relationships better. We know whom to connect with and when to run away from toxic people. We've even researched and spread awareness about addiction to social media. We learn from people all around the world.
Accept change for the good it brings. For as someone once said: There is only one constant: "Change". Rather than point fingers at a generation of people, see how these well informed, intelligent people can help you and you'll be surprised!
The first thing you need to know before your foray into computational intelligence (CI), is that the creators of these algorithms themselves don't know how it works. CI algorithms are inherently analytical techniques that depend on randomness to give solutions that are close to optimal, but not necessarily the best solution. It's like finding a lovely house in a city and choosing it as your home, but you have not actually found out if it is the best house that you could find in the city, because you just did not have the time to explore. The fact that people come up with naming these algorithms after animals (bat algorithm), insects (ant colony, bee colony, glowworm algorithms) and bacteria (bacterial foraging algorithm) is an amusing practice because the lack of theoretical backing makes the creation and optimization of the algorithm more of an art than a science.
Still, the way these algorithms improve over the generations is very impressive. This video shows you how:
This tutorial covers the topic of finding thresholds for a grayscale image using a CI algorithm named Differential Evolution (DE). We check if the thresholds are good enough by using the Otsu criterion. The best references for DE and Otsu criterion are the original papers presented here and here.
What is image thresholding?
Consider Lena's image. When you convert the red, blue and green pixels to gray colours, you end up with colours ranging from 0 to 255. Zero is black. 255 is white and the numbers in between are shades of gray (I'm not talking of Fifty shades of gray). Now if you decide that all pixels below the shade 118 are going to be converted to black and all pixels above or equal to 118 are going to be white, you end up with an image like this:
This is called "image thresholding" or "image segmentation". There are more complex ways of doing image segmentation though. The basic idea is to try and separate the image into distinct segments based on our interest. Sometimes we want to distinguish between foreground and background. Sometimes, to distinguish between parts of objects or multiple objects. If the threshold were closer to 50 or 10, the image would appear too dark. So we have to figure out which threshold will give us an optimum image. An image where the pixels are shaded in such a way that the objects in the image are well distinguished from other objects. An "optimal threshold".
So how did we find this threshold at 118?
We used the "Otsu" technique. A person named Otsu figured out that a simple and nice way to segment images was to first create a histogram of the pixels and then statistically analyze the histogram.
This is what Lena's histogram looks like:
The vertical columns are the count of the pixels of a particular shade of gray. Notice the bottom of the graph showing the shades of gray. At shade 100, the vertical column just crosses 2000. It means that the Lena image has a little more than 2000 pixels which have the gray shade of 100. These vertical columns are called "bins".
In statistics, there is a concept of "class", which is a group of objects with a similar property. So in the above histogram, we want to find a threshold which would separate the pixels into two classes. Black pixels and white pixels.
Otsu figured out that he could statistically find the best combination of classes (and hence the location of the best threshold), by examining the mean and variances of the classes. He created a formula and called it "finding the between class variance". This between class variance will be used as a value that gives us the "fitness" of the image. Higher the value, better the threshold.
If there are two thresholds, there would be three classes. As shown in the image below, the image would be eventually shown with all pixels below grayscale 32, as white. Anything equal to or above 32 and below 106, as gray colour 32 and any pixel equal to or above 106 as white.
The calculation goes like this:
The
gray histogram is first normalized. Each of the 0 to 255
bins of the histogram are
iterated as i.
probability of i = number of pixels in bin i / total number of pixels in image
total mean = sum of probability of i of all bins
If
there are t
thresholds, then there will be t+1
number of classes c
the image can be segmented into. So with a threshold of t=1, there
would be classes c1 and c2. Class mean values would also be computed
as mean1 and mean2. Or, as shown in Figure 2.1, if there are two
thresholds t1 and t2, there would be three classes and therefore
three mean values calculated.
pc = probability of class occurrence c = sum of probability of i of all bins in c
class mean = sum of (i * probability of i of all bins in c) / class occurrence c
Class
variances of each class c
are calculated as:
class variance = sum of ((i - class mean)2 * probability of i / probability of class occurrence c)
The
variance between the classes gives the fitness of the threshold.
between class variance = sum for all bins(pc * (class mean - total mean)2)
Note that the between class variance (BCV) is one single value. You don't calculate between class variances for each threshold and sum them up. You use the one formula given above to calculate it.
Ok, so now we know how to calculate the fitness of a threshold, we can write a simple for loop that places the threshold at the zero'th position in the histogram and calculates the BCV. Then move the threshold to position 1 of the histogram and find the BCV and keep going on for values 2, 3, 4 ... till 255. The threshold with the highest BCV will be the optimal threshold. For a single threshold of the Lena image, it is at 118.
Now you'd say. Hey, that's it? We just have a search space of 0 to 255? Then why do we need a computational intelligence algorithm? Couldn't we just use normal for loops?
Well, for one threshold you can do an exhaustive search from 0 to 255. For two thresholds, you'd have to run two loops nested. So that's 2552. For four thresholds, the number of iterations are 4294967296. It would take 95 days to compute on Matlab.
Enter the saviour: Computational Intelligence algorithm: Differential Evolution:
The basic idea of DE is to place thresholds randomly within 0 and 255, and keep evaluating the BCV. With some luck, you will get good thresholds which won't be the best, but will be good enough.
The secret weapon of DE is "mutation" and "crossover". Similar to how we have a population of humans and our genes undergo mutations and crossover of traits, the DE algorithm initializes a 'population' of vectors. If we are solving a problem of finding two optimal thresholds, then each vector will contain two random thresholds. During the DE algorithm, these vectors will be combined randomly with other vectors in the population to provide some variety to the result, and somehow, we end up finding near-optimal thresholds. Nobody knows how, but it works. Magic.
If there are 4 thresholds and a population of 3 vectors, the vectors would look like this:
X1 = [t1; t2; t3; t4];
X2 = [t1; t2; t3; t4];
X3 = [t1; t2; t3; t4];
Where, the t1 of X1 does not have to be the same as the t1 in X2 and so on.
This is the pseudocode for my DE algorithm:
Load
image and convert to 8 bit grayscale
Generate
histogram from image. Bins
ranging from 0 to 255
Initialize
DE parameters: PopulationSize,
thresh,
crossover probability (cr),
beta.
Set
thresh number of thresholds each, randomly within bin space for each
population entity X.
Evaluate
initial fitness of X
forEach
generation for a defined number of iterations
forEach
population p for PopulationSize
Select
population entity p from X.
Select
3 distinct populations from X. The thresholds should not be equal to
p.
Generate
mutant Up
= X1 + beta * (X2 – X3)
If
Up
== Xp,
regenerate threshold at random position for Up
and continue;
Crossover
at least one threshold from X to U and other thresholds if generated
rnd <= cr
If
mutant thresholds are outside histogram range, regenerate threshold
at random position
end
for population
Evaluate
fitness of Up
forEach
population p for PopulationSize
If
fittest mutants in Up
are fitter than fittest Xp,
replace Xp
with fittest Up
end
for population
decrease
beta by 40-1
end
for generation
Beta value: Ranges from 0 to 2. A high beta value ensures that the mixing of vector values have a much larger variation, so the mutated vector will end up far from the existing vectors. This is called "exploration", and helps visiting many other threshold positions within the 0 to 255 values. Smaller values of beta keep the variations of threshold values closer to the existing thresholds. This is called "exploitation", as you have found a good threshold already and are trying to exploit that area to find better thresholds in the area. Beta is also called the constant of differentiation. The crossover probability: Ranges from 0 to 1. Having a low crossover probability like 0.2 was found to help reach an optimal threshold faster, but it does not necessarily reach the most optimal threshold. A higher value like 0.8 helps reach a more optimal threshold, but it can take three times more number of generations to do so. Setting cr=0.3 appeared to help reach an optimal threshold with a slightly higher number of generations than cr=0.2. Allows exploitation of symmetry and separability of a function.
That's all there is to it. You can have multiple thresholds and the time of execution is just around a minute or two in Matlab even for 6 or eight thresholds. This is a major advantage of CI algorithms. You could achieve the same results with genetic algorithms, particle swarm optimization, bee colony algorithm or bacterial foraging algorithms.
The code for the DE algorithm and Otsu method, I've listed here: https://github.com/nav9/differentialEvolution
People on many blogs say that you have to disable secure boot when you have UEFI and want to install Ubuntu alongside Windows 8 or 10.
Not necessary. You don't even have to switch to Legacy boot.
The basic concept to understand is, that if you have UEFI, you'll have to tell the boot manager where to find your boot file. That's all.
After a lot of searching and ending up at all the wrong blogs and posts, I finally found this post. Worked perfectly!
The steps are:
Install Windows, leaving a separate partition for Ubuntu
That's it! You've got a dual boot system. Grub will show you the options for booting into either Windows or Ubuntu.
If anything goes wrong, you can always press F12 when starting your computer to see the boot options.
Oh btw, don't disable secure boot. It's a very important feature that prevents your system from getting infected at boot time, by malware that might be in an external drive that's connected to your PC at boot time.
I logged into my income tax e-filing account yesterday, and saw this message: "You are not authorized to view this page because either your bank details of your PAN and profile details are incorrect or these details have not been passed onto e-Filing. Please contact the owner of the information for details".
I was completely perplexed. I had filed my taxes correctly, so why this message? I couldn't even access my dashboard and didn't know what to do.
A bit of Googling revealed that few other people had faced the same issue since 2014. One of the answers on a forum said that this message shows up when the website is undergoing some routine maintenance, and we should check back after six to twelve hours.
I logged back in the next day and sure enough, everything was back to normal.
Phew!
Whether it's a routine website maintenance or too many connection requests to the server or because there's an actual issue with the details not matching, I hope the message could be changed to display something that specifies what the actual issue is, so that we could be informed of it and do what is necessary to fix it. For example:
If it's routine maintenance or too many connections to the server: "Routine website maintenance ongoing. Please check back after few hours".
If it's a problem with the bank details: "Your bank details for <bankName> are incorrect. Please ensure that <problem> is fixed by <solution>".
This is for all of you who were perplexed by this message and didn't know whom to ask. Hope it helped. In most cases, you just have to wait a while before you try logging in again. Otherwise, you can always contact the income tax helpline to find out more.
Update 2020: The issue still seems prevalent, as shown in the comments below. I hope contacting the relevant authority or submitting feedback or submitting a grievance or contacting your bank to mention this problem may help resolve the problem faster.