Finger Counting Hand Pose Estimation
Here is a quick finger counting hand pose estimation model. Not perfect, but cool…
Here is a quick finger counting hand pose estimation model. Not perfect, but cool…
We started on a project tonight to build a computer vision model that will classify a few family members including the dogs. We used Teachable Machine to get a model built, and will now be exporting a Keras model to run in TensorFlow. Love teaching the kids the power of AI. More to come…
I believe in on boarding ways of thinking via models to help drive faster, hopefully consistent practical decisions…to quickly say, ah it’s just another one of those. Most models on their own will lead you astray. However, applying multi-model thinking has statically improved outcomes. Here’s another model to add, from Shane Parrish’s The Great Mental Models Volume 2.
Velocity as a model; with deliberate speed
“The concept that underpins using velocity as a model is displacement in a direction. If we take a step forward, we have velocity. If we run in place, we just have speed. Thus, our progress in a given area is not about how fast we are moving now but is best measured by how far we’ve moved relative to where we started. To get to a goal, we cannot just focus on being fast, but need to be aware of the direction we want to go.”
“Velocity challenges us to think about what we can do to put ourselves on the right vector, to find a balance between mass and speed to move in the direction of our goals. Gains come from both improving your tactics and being able to adjust to and respond to new information.”
“Being able to move in the right direction is a lot more useful than going fast in the wrong one.”
The benefit of the doubt may never be equally distributed; however, everyday individual choices are.
Force Field Analysis essentially recognizes that in any situation where change is desired, successful management of that change requires applied *inversion. Here is a brief explanation of this process:
1) Identify the problem
2) Define your objective
3) Identify the forces that support change towards your objective
4) Identify the forces that impede change towards the objective
5) Strategize a solution! This may involve both augmenting or adding to the forces in step 3, and reducing or eliminating the forces in step 4.
*Inversion is a powerful tool to improve your thinking because it helps you identify and remove obstacles to success. The root of inversion is “invert,” which means to upend or turn upside down. As a thinking tool it means approaching a situation from the opposite end of the natural starting point. Most of us tend to think one way about a problem: forward. Inversion allows us to flip the problem around and think backward from objective. Sometimes it’s good to start at the beginning, but it can be more useful to start at the end.
#leadership #mentalmodels
After reading quite a few books on systemic racism. I was compelled to find a book on the discipline of Systems Thinking. I found “Thinking in Systems” by Donella Meadows to be a highly read and rated choice on the topic. Given the complex nature of systemic racism and racist actions, how do you tackle it. I believe systems thinking can provide a framework for doing just that. Given that we can’t just change a system directly, in “Thinking in Systems,” Donella Meadows outlined a list of interventions you can lever to influence the system. She sorts the leverage points in increasing order of effectiveness, from the easiest to lever/least long term impact on the system; to the hardest to lever/most effective to long term impact on the system. The easiest and least effective is effecting Numbers (e.g. effecting #’s and %’s); the hardest and most effective is Transcending Paradigms (which is almost spiritual), but 2nd to the hardest/most impactful is Paradigms (i.e. changing the societal culture around how we consider each other). I think racism needs to be attacked from the top and bottom, that is starting with Numbers AND Paradigms; converging where they do.
There are 12 interventions you can take to impact change in systems:
12. Numbers
Numbers (like subsidies, taxes, standards, minimum wage, research investments) define the rate at which things happen in the system.
11. Buffers
Buffers are stabilizing stock, relatively to flows. Big buffers make the system more stable, small buffers make it more subject to change. A good example of buffer is the money you keep in the bank: it helps you manage extraordinary expenses.
10. Stock-and-Flow Structures
This represent the structure of the system itself, how material stocks move through the system itself, and while changing it can in theory change a lot, in practice it’s very hard to do so. For example the baby-boom put strain on the elementary system, then high school, then jobs, then housing and then retirement, and there’s nothing changeable in that.
9. Delays
They determine how much time passes between the moment a change is made on the system, and the moment when the effect of the change happens. You can clearly see how a long delay makes everything challenging, so being able to shorten it could lead to lots of benefits, if possible. Changing delays can have a big impact, but similar to flows structure they are very hard to change. If there’s energy shortage and you need to build a power plant, that takes time.
8. Balancing/Negative Feedback Loops
A balancing feedback loop is a self-correcting logic composed by three elements: a goal to keep, a monitoring element, and a response mechanism. It is a mechanism that tries to keep a specific measurement around a specific goal. For example a thermostat has a goal temperature and it turns heating on to keep that temperature. While it is relatively simple to spot a loop in terms of mechanics, it’s harder in general. For example a law that grants more protection for whistle-blowers is something that makes the feedback loop that controls the neutrality of a democracy stronger.
7. Reinforcing/Positive Feedback Loops
Reinforcing feedback loops are built similarly to negative feedback loops, but instead of keeping a variable stable around a goal, they aim to reinforce it: the more it works, the more it gains power to work more. For example giving bonuses for every sales done is an incentive to sell more (even if we know that it damages the system as a whole more than the benefits of it), or the more you have in the bank the more interest you earn. Positive feedback loops are usually perceived as positive, but since they keep growing they can build up and damage the system in the long run if they aren’t controlled in some other way.
6. Information Flows
Creating new balancing or reinforcing feedback loops, changing how information is propagated and how it’s made visible in the system, these are all changes in the information flows structure.
For example if you put the energy counter clearly visible to a family you make them more aware of how much they are consuming, and the effect is that they consume less. This basically creates a new negative feedback loop without changing any other parameter in the system.
5. Rules
The rules of the system define its scope, its boundaries, its degrees of freedom. Incentives, punishments, constraints, are all rules of a system. Examples are everywhere, from the constitution (a set of do / do nots) to free speech to game rulebooks. These are strong leverage points, and they can be both written and unwritten.
4. Self-Organization
This is the power to add, change, evolve or self-organize system structure. In biological systems that power is called evolution. In human economies it’s called technical advance or social revolution. In systems lingo it’s called self-organization. These are structural transformation of the system, usually due to new elements appearing, such as the currency or the computer. Variability, diversity, experimentation are usually a key element to make a system evolve, but they are hard to accept because they make “lose control” on the system given what they bring to the table is something new and as such still unknown.
3. Goals
Goals have the power to transform and define each and every leverage point above. If you’re creating a system, like an organization, it’s relatively easy to see the goals because usually there’s someone to set them, and if there isn’t, then the organization is likely to have a problem. Leaders, managers, heads of state, have the power to modify or set new goals. If someone with this power says that the goal is to get a man on the Moon, well, a lot of the other variables are going to change to accommodate this goal.
2. Paradigms
Everything, including goals, arise in specific mindsets, social contexts, beliefs. In a country with a low rate of tax evasion, you need very few rules that try to address that, you probably don’t even need to have “avoid tax evasion” as a goal anywhere. These beliefs can be changed, and while in societies this can take a long time, in individuals can be a matter of an instant. Changing the paradigms from which a complex system emerge can be done by pointing out anomalies and failures. You work on active change, building more and more the new one. You don’t spend time with reactionaries.
1. Transcending Paradigms
No paradigm however is true in an absolute sense, our understanding of this infinite universe is limited. So every paradigm can be embraced, and changed, and treated as a relative variable. There isn’t just a change from an old system to a new system, there’s the possibility of an infinity of them.
This won’t be easy but it’s required, and together we can truly make lasting change, this time.
One of my goals for 2019 was to read 26 books, effectively one every other week. Well, I ended the year having completed 18. I fell short of my goal; still feel like I satisfied my CQ (Curiosity Quotient), with completing one of my other goals of doing a deep dive in to ML/DL, so it’s no longer a black box. Done!
Below are the list of books I completed in 2019. For 2020, I plan on doing 10% better than 2019 so will be targeting 20 books. Currently, I’m reading “Aligning Strategy and Sales” by Frank V. Cespedes, then “The Model Thinker” by Scott E. Page.
The List:
Fun little project his weekend, building a object detection and classification solution for less than $100. Though this pic only shows “person” and “book” classifications, the model can classify some 90 objects! The Tensorflow Lite model is running on a 4GB Raspberry Pi 4 w/ 128GB Sdcard. The camera is a Arducam, which I need to work on the resolution for but it didn’t impact the detection or classification, and ran at ~2.0 fps. Running on a Pi I have a give and take between model performance and accuracy, given the limited resources, but will push to see how resource hungry a model I can run on it. More to come…
Wondering what’s real about artificial intelligence? Today on BrainTrust LIVE, we’re fortunate to have Cynthia Holcomb, founder/CEO of Prefeye, and Shawn Harris, Customer Partnerships & Strategy, SmartLens — two retail practitioners who are working with their clients on real A.I. solutions. They’ll give us the lowdown — more specifically, on how retailers can currently use AI for personalization, the limitations that are frustrating them at present, and what does the future holds.
Recording on Facebook: https://www.facebook.com/retailwire/videos/745383885894757/
I enjoyed doing this segment with Jeff Lahens, my former business partner, and Jarvis Green, good friend and 2X Super Bowl champion with The New England Patriots… now owner of Oceans 97.
This.
“No muscles without strength, friendship without trust, opinion without consequence, change without aesthetics, age without values, life without effort, water without thirst, food without nourishment, love without sacrifice, power without fairness, facts without rigor, statistics without logic, mathematics without proof, teaching without experience, politeness without warmth, values without embodiment, degrees without erudition, militarism without fortitude, progress without civilization, friendship without investment, virtue without risk, probability without ergodicity, wealth without exposure, complication without depth, fluency without content, decision without asymmetry, science without skepticism, religion without tolerance, and, most of all: nothing without skin in the game.” ~ Nassim Nicholas Taleb
When seeking to develop an innovation strategy, here are some questions you should get answered.
How do I see emerging trends before they become problematic?
How do I generate a robust pipeline of new growth ideas to consider?
How do I identify and focus on the highest-potential opportunities in areas like blockchain and AI?
How can I motivate traditional company management to realize the need for digital transformation?
How do I evaluate competitive signals in a noisy, buzzword-filled market?
How do I get the middle layer of my company to embrace change?
How do I bring outside ideas into my organization?
When does it make sense to be a fast-follower? And when does it not?
How do I decide whether to build, buy or partner?
Should I start a venture capital fund?
Introduction
Hype
Limitations
Bias
Adversarial attacks
Impact on developing economics and jobs
A realistic view
Goldilocks rule for AI:
Too optimistic: Sentient/AGI, killer robots
Too pessimistic: AI cannot do everything, so an AI winter is coming
as opposed to the past, AI is creating value today.
Just right: Can't do everything, but will transform industries
Limitations of AI
performance limitations. (limited data issues)
Explainability is hard (instructible)
Biased AI through biased data
Adversarial attacks
Discrimination/Bias
Biases
Bias against women and minorities in hiring
Bias against dark skinned people
banks offering hiring interest rates to minorities
reinforcing unhealthy stereotypes
Technical solutions
"Zero out" the bias in words
Use more inclusive data
More transparency and auditing processes
More Diverse workforce
Adversarial attacks
Minor perturbation to pixels can lead and AI to have a different B output.
Adversarial defenses
Defenses exist; incur some performance cost
There are some applications that will remain in an arms race.
Adverse uses of AI
DeepFakes, fakes can move faster than the truth can catch up
Undermining of democracy and privacy, oppressive surveillance
Generating fake comments
spam vs. anti-spam, fraud vs. anti fraud
AI and developing economies
AI will eliminate lower rung opportunities. The development of leapfrog opportunities will be required. Think how countries jumped to mobile phones, mobile payments, online education, etc.
US and china leading, but still a very immature space.
Use AI to strengthen country's vertical industries.
More public-private partnerships
invest in education
AI and Jobs
AI is automation on steroids.
Solutions
Conditional basic income: provide a safety net but incentivize learning
Lifelong learning society
Political solutions
Conclusion
What is AI?
Building AI projects
Building AI in your company
AI and society
Introduction
Case Study: Smart Speaker
Case study: Self driving car
Roles in AI teams
AI Transformation Playbook
AI pitfalls to avoid
Taking your first steps
Supervised learning
Unsupervised learning
Transfer learning
GANs
Knowledge graphs
There is a great decoupling happening in retail, a structural change. Similar to the decoupling that the computing industry went through, going from being vertically integrated to horizontal specialist. What does this mean for retailers? Retailers need to be clear on what their unique selling proposition is, that is why do customers choose them vs their competitor, or substitute; then double down on those things. Is it your wide assortment, price, convenience, customer service, maybe safety now, or some thing less rational. Everything else should be considered for outsourcing to horizontal specialist, those who are optimized to delivery a particular service, or product.
Within any company, typically the most valuable resources are centered around the making and the selling organizations. There is no difference in retail; instead it’s the merchandising and store operations organizations, and I would add human resources to being core. Most other functions should be evaluated for their need to be an in-house capability.
Introduction
Starting an AI project
Workflow of projects
Selecting AI projects
Organizing data and team for the projects
Workflow of a machine learning project
How do you build, say a speech recognition engine
Key Steps:
Collect Data: people saying “Alexa”, and other words
Train model: learns A to B mapping… audio clip to “word”
many iterations
Deploy the model: implement in to a smart speaker
Will collect new data (get data back), to maintain /update the model
How do you build, say a self driving car
Key steps:
Collect Data: images – > positions of other cars, draw rectangles around cars
Train model: need to iterate and precisely identify cars
Deploy model: may learn that golf carts are identified and positions well. keep iterating.
Workflow of a data science project
output: actionable insights
Optimize a sales funnel
Key steps:
Collect Data: where are people coming from, time of day, machines type, etsc…
Analyze the data: Iterate many time to get good insights insights from the data collected.
Suggest hypotheses/actions: Deploy changes, re-analyze new data periodically.
Optimizing a manufacturing line
Key steps:
Collect Data: clay supplier, mixing time, ingredients, lead times, relative humidity, temperature, kiln duration, etc…
Analyze the data: Iterate many time to get good insights insights from the data collected.
Suggest hypotheses/actions: Deploy changes, re-analyze new data periodically.
Every job function needs to learn how to use data
Use data to optimize workflows through data science based analysis, and to take on tasks with machine learning (remember less than a second), Inputs (A) to Output (B).
From Sales, recruiting, marketing, to agriculture, and beyond DS and ML are having huge impacts
How to choose an AI project
Bring together a cross-functional team knowledgeable in AI, plus domain experts.
Brainstorming framework:
Think about automating “tasks,” vs automating “jobs.”
what are the main drivers of business values?
What are the main pain point in your business?
Note: you can make progress without big data
Having more data almost never hurts
Data makes some business [Google, Facebook, Netflix, Amazon] defensible.
With small datasets, you can still make progress. The amount of data you need is problem dependant.
Due diligence on project
What AI can do + Valuable for your business
Technical diligence
Can AI system meet desired performance (e.g. accuracy, speed, etc)
How much data is need to meet performance goals
Engineering timline
Business diligence
Current business: Lower costs
Current business: Increase revenue ( getting more people to check out)
New business: New product or business
*Ethical diligence*
money vs impact on society
Build vs. buy
ML projects can be in-house or outsourced
DS projects are more commonly in-house
Some things will be industry standard, avoid building those.
“Don’t sprint in front of a train.”
some times it makes sense to adopt another’s platform or approach than to build your own. resource constraints, capability constraints…
Working with an AI team
Specify your acceptance criteria
Goal: defects with 95% accuracy…How do you measure accuracy
Test Set (n1000): labelled training dataset to measure performance.
Training Set: Pictures with labels
Learn mapping from A to B
Test Set: Another data set to test the mappings. Often more than 1 test set will be requested.
Pitfall of expecting 100% accuracy. Discuss with AI engineers what’s reasonable.
Limitations of ML
Insufficient data
Mislabeled data
Ambiguous labels
Technical Tools for AI teams
CPU vs. GPU [Great for deep Learning/Neural Networks] Nvidia
Cloud vs. On-prem, ….Edge [Processor, where data is collected.]
What is AI?
What is Machine Learning?
What is Data?
The Terminilogy of AI
What makes an AI company?
What machine learning can and cannot do
Deep Learning
Transportation Problem
Step 1: Write proc optmodel;
proc optmodel;
That was easy.
Step 2: Create all your “assets”.
I call them assets, but you can call them whatever you want. Think of them as anything in the problem that we can assign attributes to. In this case, we have the Plants and the Regions. So we will create two sets, one for each. That’s why we use the command “set”.
set Plant={“Plant 1″,”Plant 2”};
set Region={“Region 1″,”Region 2”, “Region 3”};
I like calling things by their name, so I can remember them. Make sure to use {} for the sets, and to put each name inside quotes.
Step 3: Input all your data
This is all the information that in being shared in the problem. They will generally be attributes for each of the assets, or they can be constants. For all of these we use the command number:
number demand{Region} = [25 95 80];
number capacity{Plant} = [100 125];
number cost{Plant, Region} = [
250 325 445
275 260 460
];
The general nomenclature is that you give a name to the attribute, put what asset it describes inside {} and then put the values inside []. When writing tables in, make sure to write {rows,columns}. In the case of the cost, the plants would be the rows, and the regions would be the columns. Make sure that the order of the numbers you input matches the order of the items you defined in your set; SAS will assign the first number to the first item in the set, and so on. It also helps to space out tables to better read them and catch mistakes.
Step 4: Establish your variables
In this case, variables are the flows from the Plants to the Regions.
var flow{Plant, Region} >= 0;
Putting Plant,Region inside the {} means we will have a flow for each combination of Plant and Region. This means six variables will be created flow(Plant 1, Region 1), flow(Plant 1, Region 2), flow(Plant 1, Region 3), flow (Plant 2, Region 1), flow(Plant 2, Region 2), and flow(Plant 2, Region 3). Always remember to define what type of variable it is. In this case, we want our variables to be non-negative.
Step 5: Define your objective function
I called it z here, but you can call it anything you want, like TotalCost if you want to be more descriptive
minimize z = sum{i in Plant, j in Region}flow[i,j]*cost[i,j];
When you write sum {i in Plant, j in Region }, it’s the equivalent of doing a sumproduct in Excel. SAS will take every combination of Plant and Region and do the described calculation of flow times cost, and then add them all up. So in this case, it would take flow[Plant 1, Region 1]*cost[Plant 1, Region 1], then flow[Plant 1, Region 2]*cost[Plant 1, Region 2], do that for all the combinations, and then compute the sum.
I could’ve used p instead of i, and r intead of j, like sum {p in Plant, r in Region}flow[p,r]*cost[p,r]), or any other letter for that matter as long as I remain consistent and I haven’t used that letter to describe something else already.
Step 6: Establish your Constraints
In this case there are only two general contraints: capacity contraints for the plants, and demand constraints for the regions:
con capacitycon{i in Plant}: sum{j in Region}flow[i,j] <= capacity[i];
con demandcon{j in Region}: sum{i in Plant}flow[i,j] >= demand[j];
Let’s take as an example the first constraint. On the left side of the :, con capacitycon{i in Plant}, establishes the name of the constraint as capacitycon. The {I in Plant} means this is a constraint that applies individually to every Plant, so the constraint will be calculated individually for every item in the set Plant. This means this constraint really works as two constraints in this case, one using values for Plant 1, and another using values for Plant 2.
After the “:” we define the constraint itself. Here, SAS will take the flow and change the value j using every region, and add them up, and it will compare that to the capacity of the Plant. Since we established before the “:” that the constraint would be calculated separately for each Plant, the Plant remains constant for each iteration of the constraint calculation. In essence, it would take the flow(P1, R1) + flow(P1, R2) + flow(P1,R3) and make sure that is less that or equal to the capacity of (P1). Again notice that the Plant doesn’t change; instead, the constraint will do the calculations for Plant 2 as a separate comparison, because we established the {i in Plant} on the left of the “:”.
Step 7: Wrap it up
solve; print z flow; expand; quit;
Don’t forget to check the log for any error (the middle tab between you code and the results). SAS will highlight any mistakes you would’ve made there. Just scroll up to see where the first red line of text is, and that was your first mistake. You can follow these steps any time you are using SAS with this notation.
Transhipment Problem
Network Facility Location Problem
“transcost” was not used in the sas files, as it is not required when the transportation cost is $1. If it is any other value, will need to add that in.
Network Facility Location Problem w/ LOS
copy and paste matrix from spreadsheet…
to calculate the binary table dynamically, see below from page 12
97529_Using_Arrays_in_SAS_Programming.pdf
For the demand constraint “demandcon“, use an equality instead of inequality as otherwise the solution will create non-integer demand, just to meet the LOS constraint.
Advanced Supply Chain Network Design
Supply Chain Network Design Problem
Multi-Commidity Flow Problem:
Data tables come before “proc optmodel;”
INFILE Statement Options
DELIMITER= option—Specifies what character (other than the blank default character) to use as the delimiter in files that are being read. Common delimiters include comma (,), vertical pipe (|), semi-colon (;) , and the tab. For example, to specify a vertical pipe as the delimiter, the syntax is DLM=’|’, as shown here: infile ‘C:\mydata\test.dat’ dsd dlm=’|’ lrecl=1024;
A tab is specified by its hexadecimal value. For ASCII systems (UNIX, Windows, and Linux), the value is ’09’x. For EBCDIC systems (z/OS and MVS), the value is ‘05’x. As an example, the syntax to specify a tab delimiter on an ASCII system is DLM=’09’x. Note: The positioning of the quotation marks and the x in hexadecimal values is critical. No space is allowed between the x and the quotation marks, as shown in this example: infile ‘C:\mydata\test.txt’ dsd dlm=’09’x truncover;
In my case I have troubles with the ASCII so I used dlm=’,’; and I separated the data with , and it run.
/* Inputing values of multi-dimensional matrix incost in a table form first*/
Data incost;
infile datalines dsd delimiter=’09’x;
input Product $ Plant $ DC $ incost;
datalines;
P1 Chicago Atlanta 6
P1 Chicago Boston 5
P1 Dallas Atlanta 4
P1 Dallas Boston 7
P1 Miami Atlanta 6
P1 Miami Boston 9
P2 Chicago Atlanta 6
P2 Chicago Boston 5
P2 Dallas Atlanta 4
P2 Dallas Boston 7
P2 Miami Atlanta 6
P2 Miami Boston 9
P3 Chicago Atlanta 6
P3 Chicago Boston 5
P3 Dallas Atlanta 4
P3 Dallas Boston 7
P3 Miami Atlanta 4
P3 Miami Boston 7
;
Run;
/* Inputing values of multi-dimensional matrix outcost in a table form first*/
Data outcost;
infile datalines dsd delimiter=’09’x;
input Product $ DC $ Region $ outcost;
datalines;
P1 Atlanta NY 8
P1 Atlanta VA 5
P1 Atlanta PA 6
P1 Boston NY 9
P1 Boston VA 7
P1 Boston PA 6
P2 Atlanta NY 7
P2 Atlanta VA 8
P2 Atlanta PA 5
P2 Boston NY 3
P2 Boston VA 8
P2 Boston PA 6
P3 Atlanta NY 7
P3 Atlanta VA 4
P3 Atlanta PA 4
P3 Boston NY 4
P3 Boston VA 5
P3 Boston PA 4
;
Run;
Fixed Planning Horizon Problem
Aggregate Planning And Distribution Channel Strategies
Aggregate Planning (including numerous factors like hiring and firing, production levels, etc)
Aggregate Planning with Demand Elasticity (including factors like hiring and firing, production levels, discounts, etc)
Omni-channel Network Design
Reverse Logistics…for Batteries
Optimization Based Procurement
Simple Auctions
Capacity by Lane Constraint
Level of Service Constraint
Supplier Capacity Constraint
Minimum $$ Volume Constraint
Combinatorial Bids
Combinatorial Bids (Min 2 carriers) – Add the following constraint to the previous model.
SAS Files
SC2x_W1L1_Transhipment_SandyCo.sasSC2x_W1L1_Transportation_SandyCo.sasSC2x_W1L2_FacilityLocation_NERD2.sasSC2x_W1L2_FacilityLocation_NERD3.sasW2L1_NetworkDesignModels_NERD4.sasW2L2_AdvancedNetworkDesignModels_WUWU1.sasW3L1_FPH.sasW4L1_AggregatePlanning_DireWolf1.sasW4L1_AggregatePlanning_DireWolf2.sasW4L2_Omnichannel_Araz.sasW4L2_ReverseLogistics_Battery.sasW7L2_OBP_CapacityConstraints.sasW7L2_OBP_CapacityConstraintsSupplier.sasW7L2_OBP_CombinatorialBids.sasW7L2_OBP_CombinatorialBids2Carriers.sasW7L2_OBP_LevelOfService.sasW7L2_OBP_MinimumVolumeConstraints.sasW7L2_OBP_SimpleOptimization.sas
When a system operates optimally, when interacting with individuals or groups who mirror the makeup of its creators; yet suboptimally otherwise.
– Shawn Harris