Using AI to Create the Perfect Keyboard

1,442,888
0
2022-09-23に共有
Try the keyboards for yourself: adumb-codes.github.io/

Code for all my videos is available at: github.com/sponsors/adumb-codes/
Twitter: twitter.com/adumb_codes

In this video I use a genetic algorithm to create a keyboard layout optimized for decreasing the distance the fingers have to travel when typing.

Resources used:
- arXiv.org dataset: www.kaggle.com/datasets/Cornell-University/arxiv
- GitHub Java Corpus: groups.inf.ed.ac.uk/cup/javaGithub

Stock footage provided by Videvo, downloaded from www.videvo.net/

#ai #machinelearning #geneticalgorithm

コメント (21)
  • Thanks for all of the support and feedback on the video so far! I realize there are plenty of ways this video could be expanded upon. I need to make one correction about how I combine two keyboards together: At 4:40 I said that the keys are added from the left of the split point from keyboard 1. What actually happens is that the keys are added starting from the right of the split point. The number of keys to be added from keyboard 1 is random. This means that if the number of keys to be added is greater than the number of keys to the right of the split point then we will "wrap around" and start adding the keys from the left side from keyboard 1. We then fill in all the remaining keys from keyboard 2 starting from where we left off from keyboard 1. This is also reflected in the code at 5:37. I did all the coding for this video about 6 months ago and only just decided to make it into a video, which is why I misremembered how the keyboards were combined. Sorry for the mistake. Thank you again for watching.
  • @qsykip
    Something interesting about the design philosophy for Dvorak vs Colemak was that they not only wanted to minimise travel, but they had different ideas of ergonomics as well. Dvorak aims to maximise the alternating of hands when typing, which is why the vowels are on one hand, while the frequently used consonants are on the other. Colemak on the other hand, was trying to maximise "rolls", so letters that frequently appeared together should be placed such that they can be typed with adjacent fingers on each hand. These are clearly conflicting goals, and I'm not sure how these metrics can be integrated into your score, but it's worth thinking about it regardless.
  • @smalin
    If you're trying to minimize time (maximize speed), "distance moved" is the wrong thing to measure. The maximum speed of each finger is different, so (on QWERTY) typing T is faster than typing Q, even though its distance is further, because the 4th finger is slower. (To demonstrate this, compare typing ftftftft... and aqaqaqaq...). Also, one hand can be moving while the other hand is typing, so when keys alternate hands, one hand can be moving while the other is typing, which makes the distance have less impact on time.
  • @boomvangmusic
    I've been using Dvorak for a long time now and this really intrigues me! The only minor thing that I think you missed out on is taking into account that by having two hands, it should be more efficient to split the board between letters that follow each other. Dvorak has all the major consonants on the right hand side and the vowels on the left because a vowel usually follows a consonant and vice versa. So typing should be quicker by going from right-left-right-left and so on. If you're ever up to redoing this one, I'd love to see that taken into account!
  • I think something you've overlooked is that typing with the same finger in a row, is way less efficient and comfortable than "rolling" to the next finger. Would be really cool if we would get a v2 of this with some suggestions from the comments. Really cool video:)
  • Your RSTLNE setup is surprisingly easy to pick up. The only one that throws me for a loop is T. With that home row you could also call it RESTLINE, which is fitting for the design intent
  • I'm curious to see what the results would be in an ortholinear layout. I'm building a custom mechanical keyboard, and it could be interesting to see what layouts would work best if everything is on a grid instead of staggered. Not sure how much of a difference it would make, but it could be interesting to test.
  • Hey Guys, It's been about month since I have been using the 2 fingered layout now and just wanted to share back my feedback. It was quite tricky at the beginning to get used to the new layout given the muscle memory i had built over the years on QWERTY although after a week i gradually started getting the hang of it. Personally, there is a slight speed improvement as of now around 10-15 words per min but i think it would turn out great eventually. Also, i customised the keyboard a little as per my personal use bringing some letters closer to type out some common words i use better and faster.
  • A couple thoughts. 1. In most genetic algorithms, random mutations are usually introduced to reduce "local minima" like what your runs seem to produce fairly quickly. You may have done this but not explained in the video, but purposefully imposing "bad genes" into the pool can help get around these local ideals to help find even lower distance sets. 2. You mention that in the Java keyboard, the semicolon is moved closer to the home row, when in QWERTY, it is already on the home row, as right hand pinky, something not a part of older typewriter QWERTY, but solidified once computers became mainstream. 3. As others have mentioned, there are some optimizations to how you measure suitability. Some important factors I think should be accounted for in a follow up are: a. Whole hand travel: if as an example, I go to type QWERTY, my fingers are not going to individually raise up off the home row, but are going to move as an entire hand up to the top row, and reset, making the first move for Q a standard move, but WER a 0 move, and T and Y two lateral moves of 1 each. b. As others have pointed out, Dvorak not only tries to minimize travel distance, but it also tries to alternate hand movement, as opposite hands can be moved at the same time, so that should also be factored in to a suitability score, because if my left hand is dancing all over the left side of the keyboard to make a word using those keys, my right hand is sitting there doing nothing, cutting my potential speed effectively in half. c. Others have also mentioned that not all fingers move and actuate with the same performance, pinkies especially, generally don't stretch as well and aren't a quick to move (bringing in time again) so going up to a Q or P or down to a Z or /? takes more effort than the rest of the characters in their respective rows. d. The shift keys! Going off of some of the other points, using the shift keys locks up one pinky or the other, something that is generally avoided by having one on each side, but in cases where holding shift is more practical than using the caps lock (usually just from muscle memory of using shift instead of caps lock), the left or right pinky may be locked up, and the right hand especially may be shifted from JKL; as it's home keys to KL; making characters like HYN further away from right index.
  • I think the reason the commonly used letters (for the one-finger keyboard) were grouped to the left was how the left side was taken as a whole when combining the genetic material. Layouts with more common letters to the left will preserve their fitness better than ones with the letters to the right.
  • @myteachingcoach
    I have been thinking about keyboards since I learned about alternative layouts like 30 years ago, but I’ve never used a keyboard that’s different than the regularly QWERTY one. I loved that you took this so deep and I nerded out on this! Thank you!!
  • Love it! Would love a part two with more variables like ortholinear (and more languages). Nice work!
  • One thing I immediately noticed when trying the 2 finger keyboard is that this design doesn't seem to be accounting for you being able to move multiple fingers at once. By that I mean, as i'm typing one key with the right finger, I can begin moving my left finger to the next key to increase speed. When I tried the example sentence, I immediately felt like I lost that back and forth cadence between my fingers and that one would regularly be hitting many characters in a row where it otherwise wouldn't be on the qwerty keyboard. Just an observation!
  • @smuecke
    Your distance metric doesn't take into account that your hands can move at the same time, i.e., while typing a letter with your left hand, your right hand can already move toward its next letter. Moreover, you might want to multiply the distance with some weight depending on the finger, because you have more control in your index finger compared with your pinky or ring finger. I assume this would lead to more common letters being put near the center. Would be interesting to see how this new cost function changes the resulting layout.
  • @DarkGravitys
    Great video, I love the background you use. It looks very good and gives something interesting while not being to overwhelming.
  • Saw this on my recommended and this is an amazing video! Keep up the hard work, you definitely earned my subscription!
  • when testing one finger typing, did you still create further chromosomes by splitting the keyboard? that might explain why the algorithm preferred to group the most commonly used letters on one side.
  • I think there is a flaw, you should also take into account the dexterity of a finger, for some fingers a movement is easier. I don't thin it is just the distance
  • @th3oth3rjak3_
    This video is awesome! I just switched to a ZSA voyager keyboard with the Colemak DH layout and it has been a really interesting experience learning another layout. Great work, maybe we'll see more alternate layouts in the future.